diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml
new file mode 100644
index 0000000000..5642237764
--- /dev/null
+++ b/.github/workflows/format.yml
@@ -0,0 +1,27 @@
+name: format
+
+permissions:
+ contents: read
+
+concurrency:
+ group: ${{ github.workflow }}-${{ github.event_name == 'workflow_dispatch' && inputs.run-id || github.ref }}
+ cancel-in-progress: true
+
+on:
+ workflow_dispatch:
+ inputs:
+ run-id:
+ type: string
+ description: The workflow ID to download artifacts (skips the build step)
+ pull_request:
+ paths:
+ - "**/*.{ts,js,json,md,toml,yml,yaml,tsx,jsx}"
+
+jobs:
+ format:
+ if: ${{ !inputs.run-id }}
+ name: Run format
+ uses: ./.github/workflows/run-format.yml
+ secrets: inherit
+ with:
+ zig-version: 0.13.0
diff --git a/.github/workflows/run-format.yml b/.github/workflows/run-format.yml
index 4d03ce22e8..479b9f2032 100644
--- a/.github/workflows/run-format.yml
+++ b/.github/workflows/run-format.yml
@@ -20,16 +20,20 @@ jobs:
uses: actions/checkout@v4
with:
sparse-checkout: |
+ .prettierrc-ci
.github
src
scripts
packages
test
bench
+ package.json
+ bun.lockb
+ .vscode
- name: Setup Bun
uses: ./.github/actions/setup-bun
with:
- bun-version: "1.1.20"
+ bun-version: "1.1.26"
- name: Setup Zig
uses: mlugg/setup-zig@v1
with:
@@ -43,9 +47,6 @@ jobs:
- name: Format Zig
run: |
bun fmt:zig
- - name: Generate submodule versions
- run: |
- bash ./scripts/write-versions.sh
- name: Commit
uses: stefanzweifel/git-auto-commit-action@v5
with:
diff --git a/.prettierignore b/.prettierignore
index d7360d9d2f..ea7e4eeb79 100644
--- a/.prettierignore
+++ b/.prettierignore
@@ -5,3 +5,6 @@ test/js/deno
test/node.js
src/react-refresh.js
*.min.js
+test/js/node/test/fixtures
+test/js/node/test/common
+test/snippets
diff --git a/.prettierrc-ci b/.prettierrc-ci
new file mode 100644
index 0000000000..b9cd5bacb7
--- /dev/null
+++ b/.prettierrc-ci
@@ -0,0 +1,31 @@
+{
+ "arrowParens": "avoid",
+ "printWidth": 120,
+ "trailingComma": "all",
+ "useTabs": false,
+ "quoteProps": "preserve",
+ "plugins": [
+ "prettier-plugin-organize-imports"
+ ],
+ "overrides": [
+ {
+ "files": [
+ ".vscode/*.json"
+ ],
+ "options": {
+ "parser": "jsonc",
+ "quoteProps": "preserve",
+ "singleQuote": false,
+ "trailingComma": "all"
+ }
+ },
+ {
+ "files": [
+ "*.md"
+ ],
+ "options": {
+ "printWidth": 80
+ }
+ }
+ ]
+}
diff --git a/bench/async/bun.js b/bench/async/bun.js
index 51d0d119bb..e99e05a2dc 100644
--- a/bench/async/bun.js
+++ b/bench/async/bun.js
@@ -1,4 +1,4 @@
-import { run, bench } from "mitata";
+import { bench, run } from "mitata";
bench("sync", () => {});
bench("async", async () => {});
diff --git a/bench/async/deno.js b/bench/async/deno.js
index 9e4347b539..4e691a1cdb 100644
--- a/bench/async/deno.js
+++ b/bench/async/deno.js
@@ -1,4 +1,4 @@
-import { run, bench } from "../node_modules/mitata/src/cli.mjs";
+import { bench, run } from "../node_modules/mitata/src/cli.mjs";
bench("sync", () => {});
bench("async", async () => {});
diff --git a/bench/async/node.mjs b/bench/async/node.mjs
index 51d0d119bb..e99e05a2dc 100644
--- a/bench/async/node.mjs
+++ b/bench/async/node.mjs
@@ -1,4 +1,4 @@
-import { run, bench } from "mitata";
+import { bench, run } from "mitata";
bench("sync", () => {});
bench("async", async () => {});
diff --git a/bench/copyfile/node.mitata.mjs b/bench/copyfile/node.mitata.mjs
index 379150487f..90bf6fe0f6 100644
--- a/bench/copyfile/node.mitata.mjs
+++ b/bench/copyfile/node.mitata.mjs
@@ -1,5 +1,5 @@
-import { copyFileSync, writeFileSync, readFileSync, statSync } from "node:fs";
import { bench, run } from "mitata";
+import { copyFileSync, statSync, writeFileSync } from "node:fs";
function runner(ready) {
for (let size of [1, 10, 100, 1000, 10000, 100000, 1000000, 10000000]) {
diff --git a/bench/deepEqual/map.js b/bench/deepEqual/map.js
index 18e46e607a..51070e466f 100644
--- a/bench/deepEqual/map.js
+++ b/bench/deepEqual/map.js
@@ -1,5 +1,5 @@
-import { bench, run } from "mitata";
import { expect } from "bun:test";
+import { bench, run } from "mitata";
const MAP_SIZE = 10_000;
diff --git a/bench/deepEqual/set.js b/bench/deepEqual/set.js
index 9b1a0cc487..4deef8847b 100644
--- a/bench/deepEqual/set.js
+++ b/bench/deepEqual/set.js
@@ -1,5 +1,5 @@
-import { bench, run } from "mitata";
import { expect } from "bun:test";
+import { bench, run } from "mitata";
const SET_SIZE = 10_000;
diff --git a/bench/emitter/implementations.mjs b/bench/emitter/implementations.mjs
index 2050ac38e0..a925bdce78 100644
--- a/bench/emitter/implementations.mjs
+++ b/bench/emitter/implementations.mjs
@@ -1,4 +1,3 @@
-import EventEmitter3 from "eventemitter3";
import { group } from "mitata";
import EventEmitterNative from "node:events";
diff --git a/bench/expect-to-equal/expect-to-equal.test.js b/bench/expect-to-equal/expect-to-equal.test.js
index e8361596f5..52a904382f 100644
--- a/bench/expect-to-equal/expect-to-equal.test.js
+++ b/bench/expect-to-equal/expect-to-equal.test.js
@@ -1,5 +1,5 @@
// bun:test automatically rewrites this import to bun:test when run in bun
-import { test, expect } from "@jest/globals";
+import { expect, test } from "@jest/globals";
const N = parseInt(process.env.RUN_COUNT || "10000", 10);
if (!Number.isSafeInteger(N)) {
diff --git a/bench/expect-to-equal/expect-to-equal.vitest.test.js b/bench/expect-to-equal/expect-to-equal.vitest.test.js
index aea945180b..d02b56e3e8 100644
--- a/bench/expect-to-equal/expect-to-equal.vitest.test.js
+++ b/bench/expect-to-equal/expect-to-equal.vitest.test.js
@@ -1,4 +1,4 @@
-import { test, expect } from "vitest";
+import { expect, test } from "vitest";
const N = parseInt(process.env.RUN_COUNT || "10000", 10);
if (!Number.isSafeInteger(N)) {
diff --git a/bench/ffi/bun.js b/bench/ffi/bun.js
index 6e83702ee0..bceebc20b9 100644
--- a/bench/ffi/bun.js
+++ b/bench/ffi/bun.js
@@ -1,5 +1,5 @@
-import { ptr, dlopen, CString, toBuffer } from "bun:ffi";
-import { run, bench, group } from "mitata";
+import { CString, dlopen, ptr } from "bun:ffi";
+import { bench, group, run } from "mitata";
const { napiNoop, napiHash, napiString } = require(import.meta.dir + "/src/ffi_napi_bench.node");
diff --git a/bench/ffi/deno.js b/bench/ffi/deno.js
index 63ba6358c8..72d0a849b8 100644
--- a/bench/ffi/deno.js
+++ b/bench/ffi/deno.js
@@ -1,4 +1,4 @@
-import { run, bench, group } from "../node_modules/mitata/src/cli.mjs";
+import { bench, group, run } from "../node_modules/mitata/src/cli.mjs";
const extension = "darwin" !== Deno.build.os ? "so" : "dylib";
const path = new URL("src/target/release/libffi_napi_bench." + extension, import.meta.url).pathname;
diff --git a/bench/ffi/node.mjs b/bench/ffi/node.mjs
index 8c2d069717..db743024b8 100644
--- a/bench/ffi/node.mjs
+++ b/bench/ffi/node.mjs
@@ -1,4 +1,4 @@
-import { run, bench, group } from "mitata";
+import { bench, group, run } from "mitata";
import { createRequire } from "node:module";
const require = createRequire(import.meta.url);
diff --git a/bench/glob/braces.mjs b/bench/glob/braces.mjs
index c81aeb9d98..2e4a9c1c21 100644
--- a/bench/glob/braces.mjs
+++ b/bench/glob/braces.mjs
@@ -1,5 +1,5 @@
import braces from "braces";
-import { group, bench, run } from "mitata";
+import { bench, group, run } from "mitata";
// const iterations = 1000;
const iterations = 100;
diff --git a/bench/glob/scan.mjs b/bench/glob/scan.mjs
index 0d500af668..ce6721a16f 100644
--- a/bench/glob/scan.mjs
+++ b/bench/glob/scan.mjs
@@ -1,6 +1,6 @@
-import { run, bench, group } from "mitata";
import fg from "fast-glob";
import { fdir } from "fdir";
+import { bench, group, run } from "mitata";
const normalPattern = "*.ts";
const recursivePattern = "**/*.ts";
diff --git a/bench/gzip/bun.js b/bench/gzip/bun.js
index 6b69ae1fbb..cfe8615f80 100644
--- a/bench/gzip/bun.js
+++ b/bench/gzip/bun.js
@@ -1,5 +1,5 @@
-import { run, bench, group } from "mitata";
-import { gzipSync, gunzipSync } from "bun";
+import { gunzipSync, gzipSync } from "bun";
+import { bench, group, run } from "mitata";
const data = await Bun.file(require.resolve("@babel/standalone/babel.min.js")).arrayBuffer();
diff --git a/bench/gzip/deno.js b/bench/gzip/deno.js
index 66c858e55b..0c7f73b37c 100644
--- a/bench/gzip/deno.js
+++ b/bench/gzip/deno.js
@@ -1,4 +1,4 @@
-import { run, bench } from "../node_modules/mitata/src/cli.mjs";
+import { bench, run } from "../node_modules/mitata/src/cli.mjs";
const data = new TextEncoder().encode("Hello World!".repeat(9999));
diff --git a/bench/gzip/node.mjs b/bench/gzip/node.mjs
index d7a1abade7..4d1125b368 100644
--- a/bench/gzip/node.mjs
+++ b/bench/gzip/node.mjs
@@ -1,7 +1,7 @@
-import { run, bench } from "mitata";
-import { gzipSync, gunzipSync } from "zlib";
-import { createRequire } from "module";
import { readFileSync } from "fs";
+import { bench, run } from "mitata";
+import { createRequire } from "module";
+import { gunzipSync, gzipSync } from "zlib";
const require = createRequire(import.meta.url);
const data = readFileSync(require.resolve("@babel/standalone/babel.min.js"));
diff --git a/bench/hot-module-reloading/css-stress-test/src/index.tsx b/bench/hot-module-reloading/css-stress-test/src/index.tsx
index 7ca290f48a..5eefb43040 100644
--- a/bench/hot-module-reloading/css-stress-test/src/index.tsx
+++ b/bench/hot-module-reloading/css-stress-test/src/index.tsx
@@ -1,6 +1,5 @@
-import { Main } from "./main";
-import classNames from "classnames";
import ReactDOM from "react-dom";
+import { Main } from "./main";
const Base = ({}) => {
const name = typeof location !== "undefined" ? decodeURIComponent(location.search.substring(1)) : null;
diff --git a/bench/install/app/entry.server.tsx b/bench/install/app/entry.server.tsx
index fbea6220e2..a83df79c87 100644
--- a/bench/install/app/entry.server.tsx
+++ b/bench/install/app/entry.server.tsx
@@ -4,11 +4,11 @@
* For more information, see https://remix.run/docs/en/main/file-conventions/entry.server
*/
-import { PassThrough } from "node:stream";
import type { EntryContext } from "@remix-run/node";
import { Response } from "@remix-run/node";
import { RemixServer } from "@remix-run/react";
import isbot from "isbot";
+import { PassThrough } from "node:stream";
import { renderToPipeableStream } from "react-dom/server";
const ABORT_DELAY = 5_000;
diff --git a/bench/modules/node_os/bun.js b/bench/modules/node_os/bun.js
index 217fae47da..4405c9a456 100644
--- a/bench/modules/node_os/bun.js
+++ b/bench/modules/node_os/bun.js
@@ -1,21 +1,21 @@
import { bench, run } from "mitata";
import {
+ arch,
cpus,
endianness,
- arch,
- uptime,
- networkInterfaces,
- getPriority,
- totalmem,
freemem,
+ getPriority,
homedir,
hostname,
loadavg,
+ networkInterfaces,
platform,
release,
setPriority,
tmpdir,
+ totalmem,
type,
+ uptime,
userInfo,
version,
} from "node:os";
diff --git a/bench/modules/node_os/node.mjs b/bench/modules/node_os/node.mjs
index 217fae47da..4405c9a456 100644
--- a/bench/modules/node_os/node.mjs
+++ b/bench/modules/node_os/node.mjs
@@ -1,21 +1,21 @@
import { bench, run } from "mitata";
import {
+ arch,
cpus,
endianness,
- arch,
- uptime,
- networkInterfaces,
- getPriority,
- totalmem,
freemem,
+ getPriority,
homedir,
hostname,
loadavg,
+ networkInterfaces,
platform,
release,
setPriority,
tmpdir,
+ totalmem,
type,
+ uptime,
userInfo,
version,
} from "node:os";
diff --git a/bench/react-hello-world/react-hello-world.deno.jsx b/bench/react-hello-world/react-hello-world.deno.jsx
index 0bea2574a2..08cb7b0222 100644
--- a/bench/react-hello-world/react-hello-world.deno.jsx
+++ b/bench/react-hello-world/react-hello-world.deno.jsx
@@ -1,5 +1,5 @@
-import { renderToReadableStream } from "https://esm.run/react-dom/server";
import * as React from "https://esm.run/react";
+import { renderToReadableStream } from "https://esm.run/react-dom/server";
const App = () => (
diff --git a/bench/react-hello-world/react-hello-world.node.jsx b/bench/react-hello-world/react-hello-world.node.jsx
index a1a5125737..52dd3b0566 100644
--- a/bench/react-hello-world/react-hello-world.node.jsx
+++ b/bench/react-hello-world/react-hello-world.node.jsx
@@ -1,6 +1,6 @@
// react-ssr.tsx
-import { renderToPipeableStream } from "react-dom/server.node";
import React from "react";
+import { renderToPipeableStream } from "react-dom/server.node";
const http = require("http");
const App = () => (
diff --git a/bench/scanner/remix-route.ts b/bench/scanner/remix-route.ts
index dbacf3a4ca..e9d0880eed 100644
--- a/bench/scanner/remix-route.ts
+++ b/bench/scanner/remix-route.ts
@@ -1,5 +1,5 @@
+import type { ActionFunction, LoaderFunction } from "remix";
import { useParams } from "remix";
-import type { LoaderFunction, ActionFunction } from "remix";
export const loader: LoaderFunction = async ({ params }) => {
console.log(params.postId);
diff --git a/bench/snippets/assert.mjs b/bench/snippets/assert.mjs
index 3b3284e54b..120363aa07 100644
--- a/bench/snippets/assert.mjs
+++ b/bench/snippets/assert.mjs
@@ -1,5 +1,5 @@
-import { bench, group, run } from "./runner.mjs";
import * as assert from "assert";
+import { bench, run } from "./runner.mjs";
bench("deepEqual", () => {
assert.deepEqual({ foo: "123", bar: "baz" }, { foo: "123", bar: "baz" });
diff --git a/bench/snippets/buffer-create.mjs b/bench/snippets/buffer-create.mjs
index 115f8dd4aa..0093f6de83 100644
--- a/bench/snippets/buffer-create.mjs
+++ b/bench/snippets/buffer-create.mjs
@@ -1,7 +1,7 @@
// @runtime bun,node,deno
-import { bench, run } from "./runner.mjs";
-import process from "node:process";
import { Buffer } from "node:buffer";
+import process from "node:process";
+import { bench, run } from "./runner.mjs";
const N = parseInt(process.env.RUN_COUNTER ?? "10000", 10);
var isBuffer = new Buffer(0);
diff --git a/bench/snippets/buffer-to-string.mjs b/bench/snippets/buffer-to-string.mjs
index c4dac62081..f59470f6fa 100644
--- a/bench/snippets/buffer-to-string.mjs
+++ b/bench/snippets/buffer-to-string.mjs
@@ -1,6 +1,6 @@
-import { bench, run } from "./runner.mjs";
import { Buffer } from "node:buffer";
import crypto from "node:crypto";
+import { bench, run } from "./runner.mjs";
const bigBuffer = Buffer.from("hello world".repeat(10000));
const converted = bigBuffer.toString("base64");
diff --git a/bench/snippets/concat.js b/bench/snippets/concat.js
index 76804dae19..85a15c2896 100644
--- a/bench/snippets/concat.js
+++ b/bench/snippets/concat.js
@@ -1,6 +1,6 @@
-import { bench, group, run } from "./runner.mjs";
-import { readFileSync } from "fs";
import { allocUnsafe } from "bun";
+import { readFileSync } from "fs";
+import { bench, group, run } from "./runner.mjs";
function polyfill(chunks) {
var size = 0;
diff --git a/bench/snippets/crypto.mjs b/bench/snippets/crypto.mjs
index 484a4295dd..7c49fe92ee 100644
--- a/bench/snippets/crypto.mjs
+++ b/bench/snippets/crypto.mjs
@@ -1,6 +1,6 @@
// so it can run in environments without node module resolution
-import { bench, run } from "../node_modules/mitata/src/cli.mjs";
import crypto from "node:crypto";
+import { bench, run } from "../node_modules/mitata/src/cli.mjs";
var foo = new Uint8Array(65536);
bench("crypto.getRandomValues(65536)", () => {
crypto.getRandomValues(foo);
diff --git a/bench/snippets/deep-equals.js b/bench/snippets/deep-equals.js
index 53dee81ab4..0b69492342 100644
--- a/bench/snippets/deep-equals.js
+++ b/bench/snippets/deep-equals.js
@@ -1,5 +1,5 @@
-import { bench, group, run } from "./runner.mjs";
import fastDeepEquals from "fast-deep-equal/es6/index";
+import { bench, group, run } from "./runner.mjs";
// const Date = globalThis.Date;
function func1() {}
diff --git a/bench/snippets/dns.ts b/bench/snippets/dns.ts
index 7eeeea689b..12ecfe1198 100644
--- a/bench/snippets/dns.ts
+++ b/bench/snippets/dns.ts
@@ -1,5 +1,5 @@
import { dns } from "bun";
-import { bench, run, group } from "./runner.mjs";
+import { bench, group, run } from "./runner.mjs";
async function forEachBackend(name, fn) {
group(name, () => {
diff --git a/bench/snippets/encode-into.mjs b/bench/snippets/encode-into.mjs
index 5275b6f108..70cb242f36 100644
--- a/bench/snippets/encode-into.mjs
+++ b/bench/snippets/encode-into.mjs
@@ -1,4 +1,4 @@
-import { run, bench } from "../node_modules/mitata/src/cli.mjs";
+import { bench, run } from "../node_modules/mitata/src/cli.mjs";
const encoder = new TextEncoder();
diff --git a/bench/snippets/escapeHTML.js b/bench/snippets/escapeHTML.js
index 809666d71c..96da26d973 100644
--- a/bench/snippets/escapeHTML.js
+++ b/bench/snippets/escapeHTML.js
@@ -1,7 +1,4 @@
-import { group } from "./runner.mjs";
-import { bench, run } from "./runner.mjs";
-import { encode as htmlEntityEncode } from "html-entities";
-import { escape as heEscape } from "he";
+import { bench, group, run } from "./runner.mjs";
var bunEscapeHTML = globalThis.escapeHTML || Bun.escapeHTML;
diff --git a/bench/snippets/ffi-overhead.mjs b/bench/snippets/ffi-overhead.mjs
index bfb92634c2..fed3228574 100644
--- a/bench/snippets/ffi-overhead.mjs
+++ b/bench/snippets/ffi-overhead.mjs
@@ -1,4 +1,4 @@
-import { viewSource, dlopen, CString, ptr, toBuffer, toArrayBuffer, FFIType, callback } from "bun:ffi";
+import { dlopen } from "bun:ffi";
import { bench, group, run } from "./runner.mjs";
const types = {
diff --git a/bench/snippets/new-incomingmessage.mjs b/bench/snippets/new-incomingmessage.mjs
index ae480e0311..2821ee876a 100644
--- a/bench/snippets/new-incomingmessage.mjs
+++ b/bench/snippets/new-incomingmessage.mjs
@@ -1,5 +1,5 @@
-import { bench, run } from "./runner.mjs";
import { IncomingMessage } from "node:http";
+import { bench, run } from "./runner.mjs";
const headers = {
date: "Mon, 06 Nov 2023 05:12:49 GMT",
diff --git a/bench/snippets/node-vm.mjs b/bench/snippets/node-vm.mjs
index 6f9d607736..c8c2ac41bb 100644
--- a/bench/snippets/node-vm.mjs
+++ b/bench/snippets/node-vm.mjs
@@ -1,6 +1,6 @@
// @runtime node, bun
-import { bench, run } from "./runner.mjs";
import * as vm from "node:vm";
+import { bench, run } from "./runner.mjs";
const context = {
animal: "cat",
diff --git a/bench/snippets/object-values.mjs b/bench/snippets/object-values.mjs
index 8dc62780bf..5ca6db473b 100644
--- a/bench/snippets/object-values.mjs
+++ b/bench/snippets/object-values.mjs
@@ -24,7 +24,7 @@ const obj = {
w: 23,
};
-import { bench, group, run } from "./runner.mjs";
+import { bench, run } from "./runner.mjs";
var val = 0;
bench("Object.values(literal)", () => {
diff --git a/bench/snippets/pbkdf2.mjs b/bench/snippets/pbkdf2.mjs
index 6c21d3d6ea..a4f6ac8b58 100644
--- a/bench/snippets/pbkdf2.mjs
+++ b/bench/snippets/pbkdf2.mjs
@@ -1,4 +1,4 @@
-import { pbkdf2, pbkdf2Sync } from "node:crypto";
+import { pbkdf2 } from "node:crypto";
import { bench, run } from "./runner.mjs";
diff --git a/bench/snippets/peek-promise.mjs b/bench/snippets/peek-promise.mjs
index cabb15a313..f883d4d4c5 100644
--- a/bench/snippets/peek-promise.mjs
+++ b/bench/snippets/peek-promise.mjs
@@ -1,5 +1,5 @@
-import { bench, run } from "mitata";
import { peek } from "bun";
+import { bench, run } from "mitata";
let pending = Bun.sleep(1000);
let resolved = Promise.resolve(1);
diff --git a/bench/snippets/performance-now-overhead.js b/bench/snippets/performance-now-overhead.js
index 442d305639..b5283b6ff2 100644
--- a/bench/snippets/performance-now-overhead.js
+++ b/bench/snippets/performance-now-overhead.js
@@ -1,4 +1,3 @@
-import { group } from "./runner.mjs";
import { bench, run } from "./runner.mjs";
bench("performance.now x 1000", () => {
for (let i = 0; i < 1000; i++) {
diff --git a/bench/snippets/process-info.mjs b/bench/snippets/process-info.mjs
index 0366472e5a..13e54e50e7 100644
--- a/bench/snippets/process-info.mjs
+++ b/bench/snippets/process-info.mjs
@@ -1,5 +1,5 @@
-import { bench, run } from "./runner.mjs";
import { performance } from "perf_hooks";
+import { bench, run } from "./runner.mjs";
bench("process.memoryUsage()", () => {
process.memoryUsage();
diff --git a/bench/snippets/react-dom-render.bun.js b/bench/snippets/react-dom-render.bun.js
index b13508d75d..11485b021e 100644
--- a/bench/snippets/react-dom-render.bun.js
+++ b/bench/snippets/react-dom-render.bun.js
@@ -1,6 +1,6 @@
-import { bench, group, run } from "./runner.mjs";
-import { renderToReadableStream } from "react-dom/server.browser";
import { renderToReadableStream as renderToReadableStreamBun } from "react-dom/server";
+import { renderToReadableStream } from "react-dom/server.browser";
+import { bench, group, run } from "./runner.mjs";
const App = () => (
diff --git a/bench/snippets/read-file-chunk.mjs b/bench/snippets/read-file-chunk.mjs
index e6a33a4992..fafdd76b41 100644
--- a/bench/snippets/read-file-chunk.mjs
+++ b/bench/snippets/read-file-chunk.mjs
@@ -1,7 +1,7 @@
-import { tmpdir } from "node:os";
-import { bench, group, run } from "./runner.mjs";
import { createReadStream, writeFileSync } from "node:fs";
+import { tmpdir } from "node:os";
import { sep } from "node:path";
+import { bench, run } from "./runner.mjs";
if (!Promise.withResolvers) {
Promise.withResolvers = function () {
diff --git a/bench/snippets/readdir.mjs b/bench/snippets/readdir.mjs
index 37aefe6ac8..4afd214438 100644
--- a/bench/snippets/readdir.mjs
+++ b/bench/snippets/readdir.mjs
@@ -1,10 +1,10 @@
-import { readdirSync, readdir as readdirCb } from "fs";
+import { createHash } from "crypto";
+import { readdirSync } from "fs";
import { readdir } from "fs/promises";
-import { bench, run } from "./runner.mjs";
+import { relative, resolve } from "path";
import { argv } from "process";
import { fileURLToPath } from "url";
-import { relative, resolve } from "path";
-import { createHash } from "crypto";
+import { bench, run } from "./runner.mjs";
let dir = resolve(argv.length > 2 ? argv[2] : fileURLToPath(new URL("../../node_modules", import.meta.url)));
if (dir.includes(process.cwd())) {
diff --git a/bench/snippets/readfile-not-found.mjs b/bench/snippets/readfile-not-found.mjs
index c28100ba4a..65c3a30e8c 100644
--- a/bench/snippets/readfile-not-found.mjs
+++ b/bench/snippets/readfile-not-found.mjs
@@ -1,6 +1,6 @@
-import { bench, run } from "./runner.mjs";
-import { readFileSync, existsSync } from "node:fs";
+import { readFileSync } from "node:fs";
import { readFile } from "node:fs/promises";
+import { bench, run } from "./runner.mjs";
bench(`readFileSync(/tmp/404-not-found)`, () => {
try {
diff --git a/bench/snippets/realpath.mjs b/bench/snippets/realpath.mjs
index 4793ee3d67..d7fd2ec7a7 100644
--- a/bench/snippets/realpath.mjs
+++ b/bench/snippets/realpath.mjs
@@ -1,7 +1,7 @@
import { realpathSync } from "node:fs";
+import { bench, run } from "./runner.mjs";
const count = parseInt(process.env.ITERATIONS || "1", 10) || 1;
const arg = process.argv[process.argv.length - 1];
-import { bench, run } from "./runner.mjs";
bench("realpathSync x " + count, () => {
for (let i = 0; i < count; i++) realpathSync(arg, "utf-8");
diff --git a/bench/snippets/render.js b/bench/snippets/render.js
index 9ef70bc273..58aaefb1c4 100644
--- a/bench/snippets/render.js
+++ b/bench/snippets/render.js
@@ -1,4 +1,4 @@
-import decoding from "./jsx-entity-decoding";
import ReactDOMServer from "react-dom/server.browser";
+import decoding from "./jsx-entity-decoding";
console.log(ReactDOMServer.renderToString(decoding));
diff --git a/bench/snippets/require-builtins.mjs b/bench/snippets/require-builtins.mjs
index c458f3a356..34c008a892 100644
--- a/bench/snippets/require-builtins.mjs
+++ b/bench/snippets/require-builtins.mjs
@@ -1,7 +1,6 @@
-import { bench, run } from "./runner.mjs";
-import { builtinModules } from "node:module";
-import { writeFile } from "node:fs/promises";
import { spawnSync } from "child_process";
+import { writeFile } from "node:fs/promises";
+import { builtinModules } from "node:module";
for (let builtin of builtinModules) {
const path = `/tmp/require.${builtin.replaceAll("/", "_")}.cjs`;
diff --git a/bench/snippets/rmdir.mjs b/bench/snippets/rmdir.mjs
index 258d69097d..8cc7bb08fb 100644
--- a/bench/snippets/rmdir.mjs
+++ b/bench/snippets/rmdir.mjs
@@ -1,5 +1,5 @@
+import { existsSync, mkdirSync, promises } from "node:fs";
import { tmpdir } from "node:os";
-import { promises, existsSync, mkdirSync } from "node:fs";
const count = 1024 * 12;
var queue = new Array(count);
diff --git a/bench/snippets/runner-entrypoint.js b/bench/snippets/runner-entrypoint.js
index 77011c1317..cbcf0f6726 100644
--- a/bench/snippets/runner-entrypoint.js
+++ b/bench/snippets/runner-entrypoint.js
@@ -1,9 +1,9 @@
// note: this isn't done yet
// we look for `// @runtime` in the file to determine which runtimes to run the benchmark in
import { spawnSync } from "bun";
-import { readdirSync, readFileSync } from "node:fs";
import { Database } from "bun:sqlite";
-import { extname, basename } from "path";
+import { readdirSync, readFileSync } from "node:fs";
+import { basename, extname } from "path";
const exts = [".js", ".ts", ".mjs", ".tsx"];
diff --git a/bench/snippets/runner.mjs b/bench/snippets/runner.mjs
index 4f6e29fba5..1b985c716b 100644
--- a/bench/snippets/runner.mjs
+++ b/bench/snippets/runner.mjs
@@ -1,5 +1,5 @@
-import * as Mitata from "../node_modules/mitata/src/cli.mjs";
import process from "node:process";
+import * as Mitata from "../node_modules/mitata/src/cli.mjs";
const asJSON = !!process?.env?.BENCHMARK_RUNNER;
diff --git a/bench/snippets/serialize.mjs b/bench/snippets/serialize.mjs
index 1a3646f792..acd21c5c6c 100644
--- a/bench/snippets/serialize.mjs
+++ b/bench/snippets/serialize.mjs
@@ -1,4 +1,4 @@
-import { serialize, deserialize } from "node:v8";
+import { deserialize, serialize } from "node:v8";
import { bench, run } from "./runner.mjs";
const obj = {
"id": 1296269,
diff --git a/bench/snippets/set-timeout.mjs b/bench/snippets/set-timeout.mjs
index 47228f77ce..a9f495a319 100644
--- a/bench/snippets/set-timeout.mjs
+++ b/bench/snippets/set-timeout.mjs
@@ -1,5 +1,3 @@
-import { bench, run } from "../node_modules/mitata/src/cli.mjs";
-
let count = 20_000_000;
const batchSize = 1_000_000;
console.time("Run");
diff --git a/bench/snippets/sha512.js b/bench/snippets/sha512.js
index ac162dc248..9b3dcdd7a5 100644
--- a/bench/snippets/sha512.js
+++ b/bench/snippets/sha512.js
@@ -1,5 +1,5 @@
-import { bench, run } from "./runner.mjs";
import { SHA512 } from "bun";
+import { bench, run } from "./runner.mjs";
bench('SHA512.hash("hello world")', () => {
SHA512.hash("hello world");
diff --git a/bench/snippets/sha512.node.mjs b/bench/snippets/sha512.node.mjs
index 3c3ac16976..e373c4cb36 100644
--- a/bench/snippets/sha512.node.mjs
+++ b/bench/snippets/sha512.node.mjs
@@ -1,5 +1,5 @@
-import { bench, run } from "./runner.mjs";
import { createHash } from "crypto";
+import { bench, run } from "./runner.mjs";
bench('createHash("sha256").update("hello world").digest()', () => {
createHash("sha256").update("hello world").digest();
diff --git a/bench/snippets/shell-spawn.mjs b/bench/snippets/shell-spawn.mjs
index aa4da66eeb..eab129eae9 100644
--- a/bench/snippets/shell-spawn.mjs
+++ b/bench/snippets/shell-spawn.mjs
@@ -1,6 +1,6 @@
-import { $ as zx } from "zx";
import { $ as execa$ } from "execa";
-import { bench, run, group } from "./runner.mjs";
+import { $ as zx } from "zx";
+import { bench, group, run } from "./runner.mjs";
const execa = execa$({ stdio: "ignore", cwd: import.meta.dirname });
diff --git a/bench/snippets/stat.mjs b/bench/snippets/stat.mjs
index 17d6a68c83..f39840123f 100644
--- a/bench/snippets/stat.mjs
+++ b/bench/snippets/stat.mjs
@@ -1,6 +1,6 @@
-import { readdirSync, statSync } from "fs";
-import { bench, run } from "./runner.mjs";
+import { statSync } from "fs";
import { argv } from "process";
+import { bench, run } from "./runner.mjs";
const dir = argv.length > 2 ? argv[2] : "/tmp";
diff --git a/bench/snippets/stderr.mjs b/bench/snippets/stderr.mjs
index f4669905b0..1c348a3f46 100644
--- a/bench/snippets/stderr.mjs
+++ b/bench/snippets/stderr.mjs
@@ -1,4 +1,4 @@
-import { run, bench } from "./runner.mjs";
+import { bench, run } from "./runner.mjs";
var writer = globalThis.Bun ? Bun.stderr.writer() : undefined;
if (writer)
diff --git a/bench/snippets/string-decoder.mjs b/bench/snippets/string-decoder.mjs
index b00b7b67d4..950bce9c56 100644
--- a/bench/snippets/string-decoder.mjs
+++ b/bench/snippets/string-decoder.mjs
@@ -1,5 +1,5 @@
-import { bench, run } from "./runner.mjs";
import { StringDecoder } from "string_decoder";
+import { bench, run } from "./runner.mjs";
var short = Buffer.from("Hello World!");
var shortUTF16 = Buffer.from("Hello World 💕💕💕");
diff --git a/bench/snippets/string-width.mjs b/bench/snippets/string-width.mjs
index 03b4833a3b..d37046f832 100644
--- a/bench/snippets/string-width.mjs
+++ b/bench/snippets/string-width.mjs
@@ -1,5 +1,5 @@
-import { bench, run } from "./runner.mjs";
import npmStringWidth from "string-width";
+import { bench, run } from "./runner.mjs";
const bunStringWidth = globalThis?.Bun?.stringWidth;
diff --git a/bench/snippets/tcp-echo.bun.ts b/bench/snippets/tcp-echo.bun.ts
index c0f227e754..193ce0bd2a 100644
--- a/bench/snippets/tcp-echo.bun.ts
+++ b/bench/snippets/tcp-echo.bun.ts
@@ -1,4 +1,4 @@
-import { listen, connect } from "bun";
+import { connect, listen } from "bun";
var counter = 0;
const msg = "Hello World!";
diff --git a/bench/snippets/transpiler.mjs b/bench/snippets/transpiler.mjs
index 3a5c57d0af..5423416067 100644
--- a/bench/snippets/transpiler.mjs
+++ b/bench/snippets/transpiler.mjs
@@ -1,8 +1,8 @@
import { readFileSync } from "fs";
+import { createRequire } from "module";
import { dirname } from "path";
import { fileURLToPath } from "url";
-import { bench, run, group } from "./runner.mjs";
-import { createRequire } from "module";
+import { bench, group, run } from "./runner.mjs";
const require = createRequire(import.meta.url);
const esbuild_ = require("esbuild/lib/main");
const swc_ = require("@swc/core");
diff --git a/bench/snippets/write-file.mjs b/bench/snippets/write-file.mjs
index 4417c817cd..1b054c4daa 100644
--- a/bench/snippets/write-file.mjs
+++ b/bench/snippets/write-file.mjs
@@ -1,4 +1,4 @@
-import { readFileSync, writeFileSync } from "node:fs";
+import { writeFileSync } from "node:fs";
import { bench, run } from "./runner.mjs";
var short = "Hello World!";
diff --git a/bench/snippets/write.bun.js b/bench/snippets/write.bun.js
index 67fbbe3b25..0a747bf958 100644
--- a/bench/snippets/write.bun.js
+++ b/bench/snippets/write.bun.js
@@ -1,6 +1,6 @@
-import { bench, run } from "./runner.mjs";
import { write } from "bun";
import { openSync } from "fs";
+import { bench, run } from "./runner.mjs";
bench('write(/tmp/foo.txt, "short string")', async () => {
await write("/tmp/foo.txt", "short string");
diff --git a/bench/snippets/write.node.mjs b/bench/snippets/write.node.mjs
index f59c98aefa..823648a50b 100644
--- a/bench/snippets/write.node.mjs
+++ b/bench/snippets/write.node.mjs
@@ -1,9 +1,8 @@
// @runtime node, bun, deno
-import { bench, run } from "./runner.mjs";
import { Buffer } from "node:buffer";
-import { openSync } from "node:fs";
+import { openSync, writeSync as write } from "node:fs";
import { writeFile } from "node:fs/promises";
-import { writeSync as write } from "node:fs";
+import { bench, run } from "./runner.mjs";
bench("writeFile(/tmp/foo.txt, short string)", async () => {
await writeFile("/tmp/foo.txt", "short string", "utf8");
diff --git a/bench/sqlite/better-sqlite3.mjs b/bench/sqlite/better-sqlite3.mjs
index 9bf25105b9..2412d141bd 100644
--- a/bench/sqlite/better-sqlite3.mjs
+++ b/bench/sqlite/better-sqlite3.mjs
@@ -1,4 +1,4 @@
-import { run, bench } from "mitata";
+import { bench, run } from "mitata";
import { createRequire } from "module";
const require = createRequire(import.meta.url);
diff --git a/bench/sqlite/bun.js b/bench/sqlite/bun.js
index c178981f17..3e0bc417ae 100644
--- a/bench/sqlite/bun.js
+++ b/bench/sqlite/bun.js
@@ -1,5 +1,5 @@
-import { run, bench } from "mitata";
import { Database } from "bun:sqlite";
+import { bench, run } from "mitata";
import { join } from "path";
const db = Database.open(join(import.meta.dir, "src", "northwind.sqlite"));
diff --git a/bench/sqlite/deno.js b/bench/sqlite/deno.js
index 8b4b215ee8..f4e4cc1b3b 100644
--- a/bench/sqlite/deno.js
+++ b/bench/sqlite/deno.js
@@ -1,5 +1,5 @@
import { Database } from "https://deno.land/x/sqlite3@0.11.1/mod.ts";
-import { run, bench } from "../node_modules/mitata/src/cli.mjs";
+import { bench, run } from "../node_modules/mitata/src/cli.mjs";
const db = new Database("./src/northwind.sqlite");
diff --git a/bench/sqlite/node.mjs b/bench/sqlite/node.mjs
index 7602a87612..6e2fb2dc9f 100644
--- a/bench/sqlite/node.mjs
+++ b/bench/sqlite/node.mjs
@@ -1,6 +1,6 @@
// Run `node --experimental-sqlite bench/sqlite/node.mjs` to run the script.
// You will need `--experimental-sqlite` flag to run this script and node v22.5.0 or higher.
-import { run, bench } from "mitata";
+import { bench, run } from "mitata";
import { DatabaseSync as Database } from "node:sqlite";
const db = new Database("./src/northwind.sqlite");
diff --git a/bench/tsconfig.json b/bench/tsconfig.json
new file mode 100644
index 0000000000..2432a3c9d6
--- /dev/null
+++ b/bench/tsconfig.json
@@ -0,0 +1,7 @@
+{
+ "extends": "../tsconfig.json",
+ "compilerOptions": {
+ // For the organize imports plugin
+ "jsx": "react"
+ }
+}
diff --git a/bun.lockb b/bun.lockb
index 0e38e94cfc..9e6b62e3f2 100755
Binary files a/bun.lockb and b/bun.lockb differ
diff --git a/jsconfig.json b/jsconfig.json
new file mode 100644
index 0000000000..7d894d529d
--- /dev/null
+++ b/jsconfig.json
@@ -0,0 +1,22 @@
+{
+ "extends": "./tsconfig.base.json",
+ "compilerOptions": {
+ "importsNotUsedAsValues": "preserve"
+ },
+ "include": [".", "packages/bun-types/index.d.ts"],
+ "exclude": [
+ "src/test",
+ "src/js/out",
+ // "src/js/builtins",
+ "packages",
+ "bench",
+ "examples/*/*",
+ "test",
+ "src/deps",
+ "bun-webkit",
+ "src/bun.js/WebKit",
+ "src/api/demo",
+ "node_modules"
+ ],
+ "files": ["src/js/builtins.d.ts"]
+}
diff --git a/package.json b/package.json
index 7ad1387664..da392ef244 100644
--- a/package.json
+++ b/package.json
@@ -5,6 +5,10 @@
"./packages/bun-types"
],
"devDependencies": {
+ "@types/bun": "^1.1.3",
+ "@types/react": "^18.3.3",
+ "@typescript-eslint/eslint-plugin": "^7.11.0",
+ "@typescript-eslint/parser": "^7.11.0",
"@vscode/debugadapter": "^1.65.0",
"esbuild": "^0.21.4",
"eslint": "^9.4.0",
@@ -12,14 +16,11 @@
"mitata": "^0.1.11",
"peechy": "0.4.34",
"prettier": "^3.2.5",
+ "prettier-plugin-organize-imports": "^4.0.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"source-map-js": "^1.2.0",
- "typescript": "^5.4.5",
- "@types/bun": "^1.1.3",
- "@types/react": "^18.3.3",
- "@typescript-eslint/eslint-plugin": "^7.11.0",
- "@typescript-eslint/parser": "^7.11.0"
+ "typescript": "^5.4.5"
},
"resolutions": {
"bun-types": "workspace:packages/bun-types"
@@ -39,7 +40,7 @@
"build:windows": "cmake -B build -S . -G Ninja -DCMAKE_BUILD_TYPE=Debug && ninja -Cbuild",
"build:windows:release": "cmake -B build-release -S . -G Ninja -DCMAKE_BUILD_TYPE=Release && ninja -Cbuild-release",
"typecheck": "tsc --noEmit && cd test && bun run typecheck",
- "fmt": "prettier --write --cache './{.vscode,src,test,bench,packages/{bun-types,bun-inspector-*,bun-vscode,bun-debug-adapter-protocol}}/**/*.{mjs,ts,tsx,js,jsx}'",
+ "fmt": "prettier --config=.prettierrc-ci --write --cache './{.vscode,src,test,bench,packages/{bun-types,bun-inspector-*,bun-vscode,bun-debug-adapter-protocol}}/**/*.{mjs,ts,tsx,js,jsx}'",
"fmt:zig": "zig fmt src/*.zig src/*/*.zig src/*/*/*.zig src/*/*/*/*.zig",
"lint": "eslint './**/*.d.ts' --cache",
"lint:fix": "eslint './**/*.d.ts' --cache --fix",
diff --git a/packages/bun-debug-adapter-protocol/index.ts b/packages/bun-debug-adapter-protocol/index.ts
index 170a8d1c10..16ab4e7cc7 100644
--- a/packages/bun-debug-adapter-protocol/index.ts
+++ b/packages/bun-debug-adapter-protocol/index.ts
@@ -1,3 +1,3 @@
-export type * from "./src/protocol";
export * from "./src/debugger/adapter";
export * from "./src/debugger/signal";
+export type * from "./src/protocol";
diff --git a/packages/bun-debug-adapter-protocol/scripts/generate-protocol.ts b/packages/bun-debug-adapter-protocol/scripts/generate-protocol.ts
index 41847c6db7..3b350ced10 100644
--- a/packages/bun-debug-adapter-protocol/scripts/generate-protocol.ts
+++ b/packages/bun-debug-adapter-protocol/scripts/generate-protocol.ts
@@ -1,6 +1,6 @@
-import type { Protocol, Type } from "../src/protocol/schema";
-import { writeFileSync } from "node:fs";
import { spawnSync } from "node:child_process";
+import { writeFileSync } from "node:fs";
+import type { Protocol, Type } from "../src/protocol/schema";
run().catch(console.error);
diff --git a/packages/bun-debug-adapter-protocol/src/debugger/adapter.ts b/packages/bun-debug-adapter-protocol/src/debugger/adapter.ts
index 8d1953bff2..fca2d9677f 100644
--- a/packages/bun-debug-adapter-protocol/src/debugger/adapter.ts
+++ b/packages/bun-debug-adapter-protocol/src/debugger/adapter.ts
@@ -1,13 +1,13 @@
-import type { DAP } from "../protocol";
-import type { JSC } from "../../../bun-inspector-protocol/src/protocol";
import type { InspectorEventMap } from "../../../bun-inspector-protocol/src/inspector";
+import type { JSC } from "../../../bun-inspector-protocol/src/protocol";
+import type { DAP } from "../protocol";
// @ts-ignore
-import { WebSocketInspector, remoteObjectToString } from "../../../bun-inspector-protocol/index";
import type { ChildProcess } from "node:child_process";
import { spawn } from "node:child_process";
-import { Location, SourceMap } from "./sourcemap";
import { EventEmitter } from "node:events";
+import { WebSocketInspector, remoteObjectToString } from "../../../bun-inspector-protocol/index";
import { UnixSignal, randomUnixPath } from "./signal";
+import { Location, SourceMap } from "./sourcemap";
const capabilities: DAP.Capabilities = {
supportsConfigurationDoneRequest: true,
diff --git a/packages/bun-debug-adapter-protocol/src/debugger/signal.ts b/packages/bun-debug-adapter-protocol/src/debugger/signal.ts
index d7c52d4482..6cd6e5ca3b 100644
--- a/packages/bun-debug-adapter-protocol/src/debugger/signal.ts
+++ b/packages/bun-debug-adapter-protocol/src/debugger/signal.ts
@@ -1,8 +1,8 @@
-import { tmpdir } from "node:os";
-import { join } from "node:path";
+import { EventEmitter } from "node:events";
import type { Server } from "node:net";
import { createServer } from "node:net";
-import { EventEmitter } from "node:events";
+import { tmpdir } from "node:os";
+import { join } from "node:path";
const isDebug = process.env.NODE_ENV === "development";
diff --git a/packages/bun-debug-adapter-protocol/src/debugger/sourcemap.test.ts b/packages/bun-debug-adapter-protocol/src/debugger/sourcemap.test.ts
index 44d9ca3621..fa3eba0eb4 100644
--- a/packages/bun-debug-adapter-protocol/src/debugger/sourcemap.test.ts
+++ b/packages/bun-debug-adapter-protocol/src/debugger/sourcemap.test.ts
@@ -1,4 +1,4 @@
-import { test, expect } from "bun:test";
+import { expect, test } from "bun:test";
import { readFileSync } from "node:fs";
import { SourceMap } from "./sourcemap";
diff --git a/packages/bun-inspector-frontend/scripts/build.ts b/packages/bun-inspector-frontend/scripts/build.ts
index bb346db177..08f6e68e15 100644
--- a/packages/bun-inspector-frontend/scripts/build.ts
+++ b/packages/bun-inspector-frontend/scripts/build.ts
@@ -1,4 +1,3 @@
-import { build } from "esbuild";
import { copyFileSync, mkdirSync, readdirSync, rmSync, statSync } from "fs";
import { join } from "path";
diff --git a/packages/bun-inspector-protocol/index.ts b/packages/bun-inspector-protocol/index.ts
index c5e46dbf6d..21951bd4cb 100644
--- a/packages/bun-inspector-protocol/index.ts
+++ b/packages/bun-inspector-protocol/index.ts
@@ -1,4 +1,4 @@
-export type * from "./src/protocol";
export type * from "./src/inspector";
-export * from "./src/util/preview";
export * from "./src/inspector/websocket";
+export type * from "./src/protocol";
+export * from "./src/util/preview";
diff --git a/packages/bun-inspector-protocol/scripts/generate-protocol.ts b/packages/bun-inspector-protocol/scripts/generate-protocol.ts
index 7a0826009c..968796059c 100644
--- a/packages/bun-inspector-protocol/scripts/generate-protocol.ts
+++ b/packages/bun-inspector-protocol/scripts/generate-protocol.ts
@@ -1,6 +1,6 @@
-import type { Protocol, Domain, Property } from "../src/protocol/schema";
-import { readFileSync, writeFileSync } from "node:fs";
import { spawnSync } from "node:child_process";
+import { readFileSync, writeFileSync } from "node:fs";
+import type { Domain, Property, Protocol } from "../src/protocol/schema";
run().catch(console.error);
diff --git a/packages/bun-inspector-protocol/src/inspector/websocket.ts b/packages/bun-inspector-protocol/src/inspector/websocket.ts
index f88217bd40..e20ebe2a1a 100644
--- a/packages/bun-inspector-protocol/src/inspector/websocket.ts
+++ b/packages/bun-inspector-protocol/src/inspector/websocket.ts
@@ -1,7 +1,7 @@
-import type { Inspector, InspectorEventMap } from ".";
-import type { JSC } from "../protocol";
import { EventEmitter } from "node:events";
import { WebSocket } from "ws";
+import type { Inspector, InspectorEventMap } from ".";
+import type { JSC } from "../protocol";
/**
* An inspector that communicates with a debugger over a WebSocket.
diff --git a/packages/bun-inspector-protocol/test/inspector/websocket.test.ts b/packages/bun-inspector-protocol/test/inspector/websocket.test.ts
index 4a6c60c28a..2514728cbc 100644
--- a/packages/bun-inspector-protocol/test/inspector/websocket.test.ts
+++ b/packages/bun-inspector-protocol/test/inspector/websocket.test.ts
@@ -1,7 +1,7 @@
-import { describe, test, expect, mock, beforeAll, afterAll } from "bun:test";
-import { WebSocketInspector } from "../../src/inspector/websocket";
import type { Server } from "bun";
import { serve } from "bun";
+import { afterAll, beforeAll, describe, expect, mock, test } from "bun:test";
+import { WebSocketInspector } from "../../src/inspector/websocket";
let server: Server;
let url: URL;
diff --git a/packages/bun-types/globals.d.ts b/packages/bun-types/globals.d.ts
index a9d6aec5ee..54b50e79ea 100644
--- a/packages/bun-types/globals.d.ts
+++ b/packages/bun-types/globals.d.ts
@@ -137,8 +137,8 @@ type _Body = typeof globalThis extends { onerror: any }
readonly text: () => Promise;
};
+import type { TextDecoder as NodeTextDecoder, TextEncoder as NodeTextEncoder } from "util";
import type { MessagePort } from "worker_threads";
-import type { TextEncoder as NodeTextEncoder, TextDecoder as NodeTextDecoder } from "util";
import type { WebSocket as _WebSocket } from "ws";
declare module "*.txt" {
@@ -955,7 +955,7 @@ declare global {
ref(): Timer;
unref(): Timer;
hasRef(): boolean;
- refresh(): Timer
+ refresh(): Timer;
[Symbol.toPrimitive](): number;
}
diff --git a/packages/bun-types/overrides.d.ts b/packages/bun-types/overrides.d.ts
index 4c4941ebdd..2c95632243 100644
--- a/packages/bun-types/overrides.d.ts
+++ b/packages/bun-types/overrides.d.ts
@@ -1,6 +1,6 @@
export {};
-import type { Env, PathLike, BunFile } from "bun";
+import type { BunFile, Env, PathLike } from "bun";
declare global {
namespace NodeJS {
diff --git a/packages/bun-types/test/fs.test.ts b/packages/bun-types/test/fs.test.ts
index ce78e13f84..863c528d1b 100644
--- a/packages/bun-types/test/fs.test.ts
+++ b/packages/bun-types/test/fs.test.ts
@@ -1,4 +1,4 @@
-import { constants, watch, readdir } from "node:fs";
+import { constants, readdir, watch } from "node:fs";
constants.O_APPEND;
diff --git a/packages/bun-vscode/example/example.test.ts b/packages/bun-vscode/example/example.test.ts
index 8e855745ca..2d6dc8b100 100644
--- a/packages/bun-vscode/example/example.test.ts
+++ b/packages/bun-vscode/example/example.test.ts
@@ -1,4 +1,4 @@
-import { describe, test, expect } from "bun:test";
+import { describe, expect, test } from "bun:test";
describe("example", () => {
test("it works", () => {
diff --git a/packages/bun-vscode/scripts/build.mjs b/packages/bun-vscode/scripts/build.mjs
index 4f22925992..c2281c467a 100644
--- a/packages/bun-vscode/scripts/build.mjs
+++ b/packages/bun-vscode/scripts/build.mjs
@@ -1,6 +1,6 @@
import { buildSync } from "esbuild";
-import { rmSync, mkdirSync, cpSync } from "node:fs";
import { spawnSync } from "node:child_process";
+import { cpSync, mkdirSync, rmSync } from "node:fs";
const { pathname } = new URL("..", import.meta.url);
process.chdir(pathname);
diff --git a/packages/bun-vscode/scripts/test.mjs b/packages/bun-vscode/scripts/test.mjs
index 6e890c4208..e844fa2a66 100644
--- a/packages/bun-vscode/scripts/test.mjs
+++ b/packages/bun-vscode/scripts/test.mjs
@@ -1,5 +1,5 @@
-import { readdirSync } from "node:fs";
import { spawn } from "node:child_process";
+import { readdirSync } from "node:fs";
const { pathname } = new URL("..", import.meta.url);
process.chdir(pathname);
diff --git a/packages/bun-vscode/src/extension.ts b/packages/bun-vscode/src/extension.ts
index 175165fa78..fc1abe4240 100644
--- a/packages/bun-vscode/src/extension.ts
+++ b/packages/bun-vscode/src/extension.ts
@@ -1,8 +1,8 @@
import * as vscode from "vscode";
-import { registerTaskProvider } from "./features/tasks/tasks";
import { registerDebugger } from "./features/debug";
-import { registerPackageJsonProviders } from "./features/tasks/package.json";
import { registerBunlockEditor } from "./features/lockfile";
+import { registerPackageJsonProviders } from "./features/tasks/package.json";
+import { registerTaskProvider } from "./features/tasks/tasks";
export function activate(context: vscode.ExtensionContext) {
registerBunlockEditor(context);
diff --git a/packages/bun-vscode/src/features/debug.ts b/packages/bun-vscode/src/features/debug.ts
index caa0c93783..88434622a1 100644
--- a/packages/bun-vscode/src/features/debug.ts
+++ b/packages/bun-vscode/src/features/debug.ts
@@ -1,8 +1,8 @@
+import { DebugSession } from "@vscode/debugadapter";
+import { tmpdir } from "node:os";
import * as vscode from "vscode";
import type { DAP } from "../../../bun-debug-adapter-protocol";
import { DebugAdapter, UnixSignal } from "../../../bun-debug-adapter-protocol";
-import { DebugSession } from "@vscode/debugadapter";
-import { tmpdir } from "node:os";
export const DEBUG_CONFIGURATION: vscode.DebugConfiguration = {
type: "bun",
diff --git a/packages/bun-vscode/src/features/lockfile/index.ts b/packages/bun-vscode/src/features/lockfile/index.ts
index cef9a17686..3e525434e0 100644
--- a/packages/bun-vscode/src/features/lockfile/index.ts
+++ b/packages/bun-vscode/src/features/lockfile/index.ts
@@ -1,5 +1,5 @@
-import * as vscode from "vscode";
import { spawn } from "node:child_process";
+import * as vscode from "vscode";
import { styleLockfile } from "./lockfile.style";
export type BunLockfile = vscode.CustomDocument & {
diff --git a/packages/bun-vscode/src/features/tasks/package.json.ts b/packages/bun-vscode/src/features/tasks/package.json.ts
index 55947a4a11..0944382b91 100644
--- a/packages/bun-vscode/src/features/tasks/package.json.ts
+++ b/packages/bun-vscode/src/features/tasks/package.json.ts
@@ -2,8 +2,8 @@
* Automatically generates tasks from package.json scripts.
*/
import * as vscode from "vscode";
-import { BunTask } from "./tasks";
import { debugCommand } from "../debug";
+import { BunTask } from "./tasks";
/**
* Parses tasks defined in the package.json.
diff --git a/src/api/schema.js b/src/api/schema.js
index 8451955b9d..908a044ab1 100644
--- a/src/api/schema.js
+++ b/src/api/schema.js
@@ -3434,157 +3434,159 @@ function encodeGetTestsResponse(message, bb) {
}
}
-export { Loader };
-export { LoaderKeys };
-export { FrameworkEntryPointType };
-export { FrameworkEntryPointTypeKeys };
-export { StackFrameScope };
-export { StackFrameScopeKeys };
-export { decodeStackFrame };
-export { encodeStackFrame };
-export { decodeStackFramePosition };
-export { encodeStackFramePosition };
-export { decodeSourceLine };
-export { encodeSourceLine };
-export { decodeStackTrace };
-export { encodeStackTrace };
-export { decodeJSException };
-export { encodeJSException };
-export { FallbackStep };
-export { FallbackStepKeys };
-export { decodeProblems };
-export { encodeProblems };
-export { decodeRouter };
-export { encodeRouter };
-export { decodeFallbackMessageContainer };
-export { encodeFallbackMessageContainer };
-export { ResolveMode };
-export { ResolveModeKeys };
-export { Target };
-export { TargetKeys };
-export { CSSInJSBehavior };
-export { CSSInJSBehaviorKeys };
-export { JSXRuntime };
-export { JSXRuntimeKeys };
-export { decodeJSX };
-export { encodeJSX };
-export { decodeStringPointer };
-export { encodeStringPointer };
-export { decodeJavascriptBundledModule };
-export { encodeJavascriptBundledModule };
-export { decodeJavascriptBundledPackage };
-export { encodeJavascriptBundledPackage };
-export { decodeJavascriptBundle };
-export { encodeJavascriptBundle };
-export { decodeJavascriptBundleContainer };
-export { encodeJavascriptBundleContainer };
-export { ScanDependencyMode };
-export { ScanDependencyModeKeys };
-export { ModuleImportType };
-export { ModuleImportTypeKeys };
-export { decodeModuleImportRecord };
-export { encodeModuleImportRecord };
-export { decodeModule };
-export { encodeModule };
-export { decodeStringMap };
-export { encodeStringMap };
-export { decodeLoaderMap };
-export { encodeLoaderMap };
-export { DotEnvBehavior };
-export { DotEnvBehaviorKeys };
-export { decodeEnvConfig };
-export { encodeEnvConfig };
-export { decodeLoadedEnvConfig };
-export { encodeLoadedEnvConfig };
-export { decodeFrameworkConfig };
-export { encodeFrameworkConfig };
-export { decodeFrameworkEntryPoint };
-export { encodeFrameworkEntryPoint };
-export { decodeFrameworkEntryPointMap };
-export { encodeFrameworkEntryPointMap };
-export { decodeFrameworkEntryPointMessage };
-export { encodeFrameworkEntryPointMessage };
-export { decodeLoadedFramework };
-export { encodeLoadedFramework };
-export { decodeLoadedRouteConfig };
-export { encodeLoadedRouteConfig };
-export { decodeRouteConfig };
-export { encodeRouteConfig };
-export { decodeTransformOptions };
-export { encodeTransformOptions };
-export { SourceMapMode };
-export { SourceMapModeKeys };
-export { decodeFileHandle };
-export { encodeFileHandle };
-export { decodeTransform };
-export { encodeTransform };
-export { decodeScan };
-export { encodeScan };
-export { decodeScanResult };
-export { encodeScanResult };
-export { decodeScannedImport };
-export { encodeScannedImport };
-export { ImportKind };
-export { ImportKindKeys };
-export { TransformResponseStatus };
-export { TransformResponseStatusKeys };
-export { decodeOutputFile };
-export { encodeOutputFile };
-export { decodeTransformResponse };
-export { encodeTransformResponse };
-export { MessageLevel };
-export { MessageLevelKeys };
-export { decodeLocation };
-export { encodeLocation };
-export { decodeMessageData };
-export { encodeMessageData };
-export { decodeMessageMeta };
-export { encodeMessageMeta };
-export { decodeMessage };
-export { encodeMessage };
-export { decodeLog };
-export { encodeLog };
-export { Reloader };
-export { ReloaderKeys };
-export { WebsocketMessageKind };
-export { WebsocketMessageKindKeys };
-export { WebsocketCommandKind };
-export { WebsocketCommandKindKeys };
-export { decodeWebsocketMessage };
-export { encodeWebsocketMessage };
-export { decodeWebsocketMessageWelcome };
-export { encodeWebsocketMessageWelcome };
-export { decodeWebsocketMessageFileChangeNotification };
-export { encodeWebsocketMessageFileChangeNotification };
-export { decodeWebsocketCommand };
-export { encodeWebsocketCommand };
-export { decodeWebsocketCommandBuild };
-export { encodeWebsocketCommandBuild };
-export { decodeWebsocketCommandManifest };
-export { encodeWebsocketCommandManifest };
-export { decodeWebsocketMessageBuildSuccess };
-export { encodeWebsocketMessageBuildSuccess };
-export { decodeWebsocketMessageBuildFailure };
-export { encodeWebsocketMessageBuildFailure };
-export { decodeWebsocketCommandBuildWithFilePath };
-export { encodeWebsocketCommandBuildWithFilePath };
-export { decodeWebsocketMessageResolveID };
-export { encodeWebsocketMessageResolveID };
-export { decodeNPMRegistry };
-export { encodeNPMRegistry };
-export { decodeNPMRegistryMap };
-export { encodeNPMRegistryMap };
-export { decodeBunInstall };
-export { encodeBunInstall };
-export { decodeClientServerModule };
-export { encodeClientServerModule };
-export { decodeClientServerModuleManifest };
-export { encodeClientServerModuleManifest };
-export { decodeGetTestsRequest };
-export { encodeGetTestsRequest };
-export { TestKind };
-export { TestKindKeys };
-export { decodeTestResponseItem };
-export { encodeTestResponseItem };
-export { decodeGetTestsResponse };
-export { encodeGetTestsResponse };
+export {
+ CSSInJSBehavior,
+ CSSInJSBehaviorKeys,
+ DotEnvBehavior,
+ DotEnvBehaviorKeys,
+ FallbackStep,
+ FallbackStepKeys,
+ FrameworkEntryPointType,
+ FrameworkEntryPointTypeKeys,
+ ImportKind,
+ ImportKindKeys,
+ JSXRuntime,
+ JSXRuntimeKeys,
+ Loader,
+ LoaderKeys,
+ MessageLevel,
+ MessageLevelKeys,
+ ModuleImportType,
+ ModuleImportTypeKeys,
+ Reloader,
+ ReloaderKeys,
+ ResolveMode,
+ ResolveModeKeys,
+ ScanDependencyMode,
+ ScanDependencyModeKeys,
+ SourceMapMode,
+ SourceMapModeKeys,
+ StackFrameScope,
+ StackFrameScopeKeys,
+ Target,
+ TargetKeys,
+ TestKind,
+ TestKindKeys,
+ TransformResponseStatus,
+ TransformResponseStatusKeys,
+ WebsocketCommandKind,
+ WebsocketCommandKindKeys,
+ WebsocketMessageKind,
+ WebsocketMessageKindKeys,
+ decodeBunInstall,
+ decodeClientServerModule,
+ decodeClientServerModuleManifest,
+ decodeEnvConfig,
+ decodeFallbackMessageContainer,
+ decodeFileHandle,
+ decodeFrameworkConfig,
+ decodeFrameworkEntryPoint,
+ decodeFrameworkEntryPointMap,
+ decodeFrameworkEntryPointMessage,
+ decodeGetTestsRequest,
+ decodeGetTestsResponse,
+ decodeJSException,
+ decodeJSX,
+ decodeJavascriptBundle,
+ decodeJavascriptBundleContainer,
+ decodeJavascriptBundledModule,
+ decodeJavascriptBundledPackage,
+ decodeLoadedEnvConfig,
+ decodeLoadedFramework,
+ decodeLoadedRouteConfig,
+ decodeLoaderMap,
+ decodeLocation,
+ decodeLog,
+ decodeMessage,
+ decodeMessageData,
+ decodeMessageMeta,
+ decodeModule,
+ decodeModuleImportRecord,
+ decodeNPMRegistry,
+ decodeNPMRegistryMap,
+ decodeOutputFile,
+ decodeProblems,
+ decodeRouteConfig,
+ decodeRouter,
+ decodeScan,
+ decodeScanResult,
+ decodeScannedImport,
+ decodeSourceLine,
+ decodeStackFrame,
+ decodeStackFramePosition,
+ decodeStackTrace,
+ decodeStringMap,
+ decodeStringPointer,
+ decodeTestResponseItem,
+ decodeTransform,
+ decodeTransformOptions,
+ decodeTransformResponse,
+ decodeWebsocketCommand,
+ decodeWebsocketCommandBuild,
+ decodeWebsocketCommandBuildWithFilePath,
+ decodeWebsocketCommandManifest,
+ decodeWebsocketMessage,
+ decodeWebsocketMessageBuildFailure,
+ decodeWebsocketMessageBuildSuccess,
+ decodeWebsocketMessageFileChangeNotification,
+ decodeWebsocketMessageResolveID,
+ decodeWebsocketMessageWelcome,
+ encodeBunInstall,
+ encodeClientServerModule,
+ encodeClientServerModuleManifest,
+ encodeEnvConfig,
+ encodeFallbackMessageContainer,
+ encodeFileHandle,
+ encodeFrameworkConfig,
+ encodeFrameworkEntryPoint,
+ encodeFrameworkEntryPointMap,
+ encodeFrameworkEntryPointMessage,
+ encodeGetTestsRequest,
+ encodeGetTestsResponse,
+ encodeJSException,
+ encodeJSX,
+ encodeJavascriptBundle,
+ encodeJavascriptBundleContainer,
+ encodeJavascriptBundledModule,
+ encodeJavascriptBundledPackage,
+ encodeLoadedEnvConfig,
+ encodeLoadedFramework,
+ encodeLoadedRouteConfig,
+ encodeLoaderMap,
+ encodeLocation,
+ encodeLog,
+ encodeMessage,
+ encodeMessageData,
+ encodeMessageMeta,
+ encodeModule,
+ encodeModuleImportRecord,
+ encodeNPMRegistry,
+ encodeNPMRegistryMap,
+ encodeOutputFile,
+ encodeProblems,
+ encodeRouteConfig,
+ encodeRouter,
+ encodeScan,
+ encodeScanResult,
+ encodeScannedImport,
+ encodeSourceLine,
+ encodeStackFrame,
+ encodeStackFramePosition,
+ encodeStackTrace,
+ encodeStringMap,
+ encodeStringPointer,
+ encodeTestResponseItem,
+ encodeTransform,
+ encodeTransformOptions,
+ encodeTransformResponse,
+ encodeWebsocketCommand,
+ encodeWebsocketCommandBuild,
+ encodeWebsocketCommandBuildWithFilePath,
+ encodeWebsocketCommandManifest,
+ encodeWebsocketMessage,
+ encodeWebsocketMessageBuildFailure,
+ encodeWebsocketMessageBuildSuccess,
+ encodeWebsocketMessageFileChangeNotification,
+ encodeWebsocketMessageResolveID,
+ encodeWebsocketMessageWelcome,
+};
diff --git a/src/bun.js/api/bun/subprocess.zig b/src/bun.js/api/bun/subprocess.zig
index 8fdd863222..562e4bbeb7 100644
--- a/src/bun.js/api/bun/subprocess.zig
+++ b/src/bun.js/api/bun/subprocess.zig
@@ -1422,7 +1422,6 @@ pub const Subprocess = struct {
defer this.deref();
defer this.disconnectIPC(true);
-
var stdin: ?*JSC.WebCore.FileSink = this.weak_file_sink_stdin_ptr;
var existing_stdin_value = JSC.JSValue.zero;
if (this_jsvalue != .zero) {
@@ -2072,12 +2071,12 @@ pub const Subprocess = struct {
.pid_rusage = null,
.stdin = undefined,
.stdout = undefined,
- .stderr = undefined,
+ .stderr = undefined,
.stdio_pipes = .{},
.on_exit_callback = .{},
.on_disconnect_callback = .{},
.ipc_data = null,
- .ipc_callback =.{},
+ .ipc_callback = .{},
.flags = .{
.is_sync = is_sync,
},
diff --git a/src/bun.js/ipc.zig b/src/bun.js/ipc.zig
index 0522e3b78b..cf8d53a869 100644
--- a/src/bun.js/ipc.zig
+++ b/src/bun.js/ipc.zig
@@ -454,7 +454,7 @@ const NamedPipeIPCData = struct {
source.pipe.unref();
this.writer.source = null;
- if(this.is_server) {
+ if (this.is_server) {
source.pipe.data = source.pipe;
source.pipe.close(onServerPipeClose);
this.onPipeClose();
@@ -576,7 +576,7 @@ const NamedPipeIPCData = struct {
if (this.disconnected) {
_ = this.writer.flush();
this.writer.end();
- if(this.writer.getStream()) |stream| {
+ if (this.writer.getStream()) |stream| {
stream.readStop();
}
if (!this.writer.hasPendingData()) {
diff --git a/src/bun.js/node/node_crypto_binding.zig b/src/bun.js/node/node_crypto_binding.zig
index 6add98307d..026450dc45 100644
--- a/src/bun.js/node/node_crypto_binding.zig
+++ b/src/bun.js/node/node_crypto_binding.zig
@@ -15,25 +15,24 @@ const validators = @import("./util/validators.zig");
fn randomInt(globalThis: *JSC.JSGlobalObject, callframe: *JSC.CallFrame) JSC.JSValue {
const arguments = callframe.arguments(2).slice();
-
//min, max
if (!arguments[0].isNumber()) return globalThis.throwInvalidArgumentTypeValue("min", "safe integer", arguments[0]);
if (!arguments[1].isNumber()) return globalThis.throwInvalidArgumentTypeValue("max", "safe integer", arguments[1]);
const min = arguments[0].to(i64);
const max = arguments[1].to(i64);
-
- if(min > validators.NUMBER__MAX_SAFE_INTEGER or min < validators.NUMBER__MIN_SAFE_INTEGER) {
- return globalThis.throwInvalidArgumentRangeValue("min", "It must be a safe integer type number", min);
+
+ if (min > validators.NUMBER__MAX_SAFE_INTEGER or min < validators.NUMBER__MIN_SAFE_INTEGER) {
+ return globalThis.throwInvalidArgumentRangeValue("min", "It must be a safe integer type number", min);
}
- if(max > validators.NUMBER__MAX_SAFE_INTEGER) {
- return globalThis.throwInvalidArgumentRangeValue("max", "It must be a safe integer type number", max);
+ if (max > validators.NUMBER__MAX_SAFE_INTEGER) {
+ return globalThis.throwInvalidArgumentRangeValue("max", "It must be a safe integer type number", max);
}
- if(min >= max) {
- return globalThis.throwInvalidArgumentRangeValue("max", "should be greater than min", max);
+ if (min >= max) {
+ return globalThis.throwInvalidArgumentRangeValue("max", "should be greater than min", max);
}
const diff = max - min;
- if(diff > 281474976710655) {
- return globalThis.throwInvalidArgumentRangeValue("max - min", "It must be <= 281474976710655", diff);
+ if (diff > 281474976710655) {
+ return globalThis.throwInvalidArgumentRangeValue("max - min", "It must be <= 281474976710655", diff);
}
return JSC.JSValue.jsNumberFromInt64(std.crypto.random.intRangeLessThan(i64, min, max));
diff --git a/src/codegen/bundle-modules.ts b/src/codegen/bundle-modules.ts
index 59b72320bf..a7289ce5d3 100644
--- a/src/codegen/bundle-modules.ts
+++ b/src/codegen/bundle-modules.ts
@@ -9,15 +9,15 @@
//
// For explanation on this, please nag @paperdave to write documentation on how everything works.
import fs from "fs";
-import { writeFile, mkdir } from "fs/promises";
+import { mkdir, writeFile } from "fs/promises";
+import { builtinModules } from "node:module";
import path from "path";
import { sliceSourceCode } from "./builtin-parser";
-import { cap, declareASCIILiteral, writeIfNotChanged } from "./helpers";
import { createAssertClientJS, createLogClientJS } from "./client-js";
-import { builtinModules } from "node:module";
-import { define } from "./replacements";
-import { createInternalModuleRegistry } from "./internal-module-registry-scanner";
import { getJS2NativeCPP, getJS2NativeZig } from "./generate-js2native";
+import { cap, declareASCIILiteral, writeIfNotChanged } from "./helpers";
+import { createInternalModuleRegistry } from "./internal-module-registry-scanner";
+import { define } from "./replacements";
const BASE = path.join(import.meta.dir, "../js");
const debug = process.argv[2] === "--debug=ON";
diff --git a/src/codegen/generate-classes.ts b/src/codegen/generate-classes.ts
index ff499e1c10..7295986bfd 100644
--- a/src/codegen/generate-classes.ts
+++ b/src/codegen/generate-classes.ts
@@ -1,7 +1,7 @@
// @ts-nocheck
import path from "path";
-import type { Field, ClassDefinition } from "./class-definitions";
-import { writeIfNotChanged, camelCase, pascalCase } from "./helpers";
+import type { ClassDefinition, Field } from "./class-definitions";
+import { camelCase, pascalCase, writeIfNotChanged } from "./helpers";
if (process.env.BUN_SILENT === "1") {
console.log = () => {};
diff --git a/src/codegen/generate-jssink.ts b/src/codegen/generate-jssink.ts
index a89c445726..b8e760e3fb 100644
--- a/src/codegen/generate-jssink.ts
+++ b/src/codegen/generate-jssink.ts
@@ -1,4 +1,4 @@
-import { resolve, join } from "path";
+import { join, resolve } from "path";
const classes = ["ArrayBufferSink", "FileSink", "HTTPResponseSink", "HTTPSResponseSink"];
diff --git a/src/codegen/generate-node-errors.ts b/src/codegen/generate-node-errors.ts
index 838fc32f90..e8683237f1 100644
--- a/src/codegen/generate-node-errors.ts
+++ b/src/codegen/generate-node-errors.ts
@@ -1,6 +1,6 @@
+import path from "node:path";
import NodeErrors from "../bun.js/bindings/ErrorCode.ts";
const outputDir = process.argv[2];
-import path from "node:path";
if (!outputDir) {
throw new Error("Missing output directory");
diff --git a/src/codegen/helpers.ts b/src/codegen/helpers.ts
index aa9ce40ce9..bfd6cdafcc 100644
--- a/src/codegen/helpers.ts
+++ b/src/codegen/helpers.ts
@@ -1,6 +1,6 @@
+import { isAscii } from "buffer";
import fs from "fs";
import path from "path";
-import { isAscii } from "buffer";
// MSVC has a max of 16k characters per string literal
// Combining string literals didn't support constexpr apparently
diff --git a/src/fallback.ts b/src/fallback.ts
index 1893fde366..0e0f735cea 100644
--- a/src/fallback.ts
+++ b/src/fallback.ts
@@ -1,6 +1,5 @@
declare var document: any;
import { ByteBuffer } from "peechy";
-import { FallbackStep } from "./api/schema";
import { decodeFallbackMessageContainer, FallbackMessageContainer } from "./api/schema";
function getFallbackInfo(): FallbackMessageContainer {
diff --git a/src/http/websocket_http_client.zig b/src/http/websocket_http_client.zig
index ad5d1f046c..c2c78cc093 100644
--- a/src/http/websocket_http_client.zig
+++ b/src/http/websocket_http_client.zig
@@ -399,9 +399,9 @@ pub fn NewHTTPUpgradeClient(comptime ssl: bool) type {
if (handshake_success) {
// handshake completed but we may have ssl errors
- if(reject_unauthorized) {
- // only reject the connection if reject_unauthorized == true
- if(ssl_error.error_no != 0){
+ if (reject_unauthorized) {
+ // only reject the connection if reject_unauthorized == true
+ if (ssl_error.error_no != 0) {
this.fail(ErrorCode.tls_handshake_failed);
return;
}
@@ -415,10 +415,9 @@ pub fn NewHTTPUpgradeClient(comptime ssl: bool) type {
}
} else {
// if we are here is because server rejected us, and the error_no is the cause of this
- // if we set reject_unauthorized == false this means the server requires custom CA aka NODE_EXTRA_CA_CERTS
+ // if we set reject_unauthorized == false this means the server requires custom CA aka NODE_EXTRA_CA_CERTS
this.fail(ErrorCode.tls_handshake_failed);
}
-
}
pub fn handleOpen(this: *HTTPClient, socket: Socket) void {
diff --git a/src/js/internal/debugger.ts b/src/js/internal/debugger.ts
index 2c049d9550..6c4b8376dc 100644
--- a/src/js/internal/debugger.ts
+++ b/src/js/internal/debugger.ts
@@ -1,4 +1,4 @@
-import type { Server as WebSocketServer, WebSocketHandler, ServerWebSocket, SocketHandler, Socket } from "bun";
+import type { ServerWebSocket, Socket, SocketHandler, WebSocketHandler, Server as WebSocketServer } from "bun";
export default function (
executionContextId: string,
diff --git a/src/node-fallbacks/events.js b/src/node-fallbacks/events.js
index 70f47eb539..321f14c204 100644
--- a/src/node-fallbacks/events.js
+++ b/src/node-fallbacks/events.js
@@ -478,6 +478,5 @@ function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
}
export default EventEmitter;
-export { once };
-export { EventEmitter };
+export { EventEmitter, once };
export var prototype = EventEmitter.prototype;
diff --git a/src/node-fallbacks/querystring.js b/src/node-fallbacks/querystring.js
index 00404cc1bf..8c71d38b8a 100644
--- a/src/node-fallbacks/querystring.js
+++ b/src/node-fallbacks/querystring.js
@@ -1,2 +1 @@
-export { unescapeBuffer, unescape, escape, stringify, encode, parse, decode } from "querystring-es3";
-export { default } from "querystring-es3";
+export { decode, default, encode, escape, parse, stringify, unescape, unescapeBuffer } from "querystring-es3";
diff --git a/src/node-fallbacks/tty.js b/src/node-fallbacks/tty.js
index 914833c562..3844312ca4 100644
--- a/src/node-fallbacks/tty.js
+++ b/src/node-fallbacks/tty.js
@@ -5,5 +5,5 @@ function WriteStream() {
function ReadStream() {
throw new Error("tty.ReadStream is not implemented for browsers");
}
-export { isatty, ReadStream, WriteStream };
+export { ReadStream, WriteStream, isatty };
export default { isatty, ReadStream, WriteStream };
diff --git a/src/node-fallbacks/url.js b/src/node-fallbacks/url.js
index 78cc1e860b..571d30b934 100644
--- a/src/node-fallbacks/url.js
+++ b/src/node-fallbacks/url.js
@@ -732,12 +732,15 @@ Url.prototype.parseHost = function () {
if (host) this.hostname = host;
};
-export { URL, URLSearchParams };
-export { urlParse as parse };
-export { urlResolve as resolve };
-export { urlResolveObject as resolveObject };
-export { urlFormat as format };
-export { Url as Url };
+export {
+ URL,
+ URLSearchParams,
+ Url as Url,
+ urlFormat as format,
+ urlParse as parse,
+ urlResolve as resolve,
+ urlResolveObject as resolveObject,
+};
export default {
parse: urlParse,
diff --git a/src/node-fallbacks/util.js b/src/node-fallbacks/util.js
index 1ad352a2ae..5973068686 100644
--- a/src/node-fallbacks/util.js
+++ b/src/node-fallbacks/util.js
@@ -3,5 +3,5 @@ export * from "util";
const TextEncoder = globalThis.TextEncoder;
const TextDecoder = globalThis.TextDecoder;
-export { TextEncoder, TextDecoder };
+export { TextDecoder, TextEncoder };
export default { TextEncoder, TextDecoder };
diff --git a/src/runtime/errors.ts b/src/runtime/errors.ts
index c5968e4228..830ed3881d 100644
--- a/src/runtime/errors.ts
+++ b/src/runtime/errors.ts
@@ -76,4 +76,4 @@ var __ImportKind;
__ImportKind = ImportKind;
}
-export { __ResolveLog as ResolveMessage, __BuildLog as BuildMessage, __ImportKind as ImportKind };
+export { __BuildLog as BuildMessage, __ImportKind as ImportKind, __ResolveLog as ResolveMessage };
diff --git a/src/runtime/hmr.ts b/src/runtime/hmr.ts
index 5aff4389dc..61dc9a93a5 100644
--- a/src/runtime/hmr.ts
+++ b/src/runtime/hmr.ts
@@ -1669,4 +1669,4 @@ if (typeof window !== "undefined") {
globalThis["__BUN_ERROR"] = BunError;
}
-export { __HMRModule, __FastRefreshModule, __HMRClient, __injectFastRefresh };
+export { __FastRefreshModule, __HMRClient, __HMRModule, __injectFastRefresh };
diff --git a/src/runtime/index-with-refresh.ts b/src/runtime/index-with-refresh.ts
index abea4c0f4c..670caa8bf1 100644
--- a/src/runtime/index-with-refresh.ts
+++ b/src/runtime/index-with-refresh.ts
@@ -1,8 +1,8 @@
// @ts-nocheck
-export * from "./hmr";
-export * from "./errors";
-export * from "./index-without-hmr";
export * as __FastRefreshRuntime from "../react-refresh";
+export * from "./errors";
+export * from "./hmr";
+export * from "./index-without-hmr";
globalThis.process ||= {
env: {},
diff --git a/src/runtime/index.ts b/src/runtime/index.ts
index 3c35e361ce..313abe8f5b 100644
--- a/src/runtime/index.ts
+++ b/src/runtime/index.ts
@@ -1,6 +1,6 @@
// @ts-nocheck
-export * from "./hmr";
export * from "./errors";
+export * from "./hmr";
export * from "./index-without-hmr";
globalThis.process ||= {
diff --git a/test/.prettierignore b/test/.prettierignore
index d8d94cdf27..29277a7e13 100644
--- a/test/.prettierignore
+++ b/test/.prettierignore
@@ -2,3 +2,5 @@ node_modules
snapshots
js/deno
*.min.js
+snippets
+js/node/test/fixtures
diff --git a/test/bundler/bun-build-api.test.ts b/test/bundler/bun-build-api.test.ts
index cca783b3dc..9ef848cc09 100644
--- a/test/bundler/bun-build-api.test.ts
+++ b/test/bundler/bun-build-api.test.ts
@@ -1,8 +1,7 @@
-import { test, expect, describe } from "bun:test";
+import { describe, expect, test } from "bun:test";
import { readFileSync, writeFileSync } from "fs";
import { bunEnv, bunExe, tempDirWithFiles } from "harness";
-import { join } from "path";
-import path from "path";
+import path, { join } from "path";
describe("Bun.build", () => {
test("passing undefined doesnt segfault", () => {
diff --git a/test/bundler/bundler_browser.test.ts b/test/bundler/bundler_browser.test.ts
index f677ba08dd..40ddd09226 100644
--- a/test/bundler/bundler_browser.test.ts
+++ b/test/bundler/bundler_browser.test.ts
@@ -1,6 +1,6 @@
import assert from "assert";
-import { itBundled } from "./expectBundled";
import { describe, expect } from "bun:test";
+import { itBundled } from "./expectBundled";
describe("bundler", () => {
const nodePolyfillList = {
diff --git a/test/bundler/bundler_bun.test.ts b/test/bundler/bundler_bun.test.ts
index aaec7beeb1..63820dd4c3 100644
--- a/test/bundler/bundler_bun.test.ts
+++ b/test/bundler/bundler_bun.test.ts
@@ -1,6 +1,6 @@
-import { itBundled } from "./expectBundled";
import { Database } from "bun:sqlite";
import { describe, expect } from "bun:test";
+import { itBundled } from "./expectBundled";
describe("bundler", () => {
itBundled("bun/embedded-sqlite-file", {
diff --git a/test/bundler/bundler_cjs2esm.test.ts b/test/bundler/bundler_cjs2esm.test.ts
index 67929082f6..0063ce5189 100644
--- a/test/bundler/bundler_cjs2esm.test.ts
+++ b/test/bundler/bundler_cjs2esm.test.ts
@@ -1,5 +1,5 @@
-import { itBundled } from "./expectBundled";
import { describe, expect } from "bun:test";
+import { itBundled } from "./expectBundled";
const fakeReactNodeModules = {
"/node_modules/react/index.js": /* js */ `
diff --git a/test/bundler/bundler_compile.test.ts b/test/bundler/bundler_compile.test.ts
index d80fb4ea77..078f9bb3c2 100644
--- a/test/bundler/bundler_compile.test.ts
+++ b/test/bundler/bundler_compile.test.ts
@@ -1,8 +1,7 @@
-import { itBundled } from "./expectBundled";
import { Database } from "bun:sqlite";
-import { expect } from "bun:test";
-import { describe } from "bun:test";
+import { describe, expect } from "bun:test";
import { rmSync } from "fs";
+import { itBundled } from "./expectBundled";
describe("bundler", () => {
itBundled("compile/HelloWorld", {
diff --git a/test/bundler/bundler_decorator_metadata.test.ts b/test/bundler/bundler_decorator_metadata.test.ts
index 33a0e5fac8..8005e41521 100644
--- a/test/bundler/bundler_decorator_metadata.test.ts
+++ b/test/bundler/bundler_decorator_metadata.test.ts
@@ -1,5 +1,5 @@
-import { itBundled } from "./expectBundled";
import { describe } from "bun:test";
+import { itBundled } from "./expectBundled";
const reflectMetadata = `
var Reflect2;
diff --git a/test/bundler/bundler_edgecase.test.ts b/test/bundler/bundler_edgecase.test.ts
index 11bff6744c..866c98d0ea 100644
--- a/test/bundler/bundler_edgecase.test.ts
+++ b/test/bundler/bundler_edgecase.test.ts
@@ -1,6 +1,6 @@
+import { describe, expect } from "bun:test";
import { join } from "node:path";
import { itBundled } from "./expectBundled";
-import { describe, expect } from "bun:test";
describe("bundler", () => {
itBundled("edgecase/EmptyFile", {
diff --git a/test/bundler/bundler_jsx.test.ts b/test/bundler/bundler_jsx.test.ts
index 68fcbfbd4f..06731d060a 100644
--- a/test/bundler/bundler_jsx.test.ts
+++ b/test/bundler/bundler_jsx.test.ts
@@ -1,5 +1,5 @@
-import { BundlerTestInput, itBundled } from "./expectBundled";
import { describe, expect } from "bun:test";
+import { BundlerTestInput, itBundled } from "./expectBundled";
const helpers = {
"/node_modules/bun-test-helpers/index.js": /* js */ `
diff --git a/test/bundler/bundler_loader.test.ts b/test/bundler/bundler_loader.test.ts
index ca086fca53..7abc86bd04 100644
--- a/test/bundler/bundler_loader.test.ts
+++ b/test/bundler/bundler_loader.test.ts
@@ -1,6 +1,6 @@
import { fileURLToPath } from "bun";
-import { itBundled } from "./expectBundled";
import { describe } from "bun:test";
+import { itBundled } from "./expectBundled";
describe("bundler", async () => {
for (let target of ["bun", "node"] as const) {
diff --git a/test/bundler/bundler_minify.test.ts b/test/bundler/bundler_minify.test.ts
index 54ad7ab614..97c4107bb0 100644
--- a/test/bundler/bundler_minify.test.ts
+++ b/test/bundler/bundler_minify.test.ts
@@ -1,5 +1,5 @@
-import { itBundled } from "./expectBundled";
import { describe, expect } from "bun:test";
+import { itBundled } from "./expectBundled";
describe("bundler", () => {
itBundled("minify/TemplateStringFolding", {
diff --git a/test/bundler/bundler_naming.test.ts b/test/bundler/bundler_naming.test.ts
index a415f53d91..8f4aeb5281 100644
--- a/test/bundler/bundler_naming.test.ts
+++ b/test/bundler/bundler_naming.test.ts
@@ -1,5 +1,5 @@
-import { ESBUILD, itBundled } from "./expectBundled";
import { describe } from "bun:test";
+import { ESBUILD, itBundled } from "./expectBundled";
describe("bundler", () => {
itBundled("naming/EntryNamingCollission", {
diff --git a/test/bundler/bundler_npm.test.ts b/test/bundler/bundler_npm.test.ts
index dcbc14705d..b765e58598 100644
--- a/test/bundler/bundler_npm.test.ts
+++ b/test/bundler/bundler_npm.test.ts
@@ -1,6 +1,6 @@
-import { itBundled } from "./expectBundled";
import { describe } from "bun:test";
import { isWindows } from "harness";
+import { itBundled } from "./expectBundled";
describe("bundler", () => {
itBundled("npm/ReactSSR", {
diff --git a/test/bundler/bundler_plugin.test.ts b/test/bundler/bundler_plugin.test.ts
index 8bc40d1b0a..0918ff33a9 100644
--- a/test/bundler/bundler_plugin.test.ts
+++ b/test/bundler/bundler_plugin.test.ts
@@ -1,6 +1,6 @@
-import { join, resolve, dirname } from "node:path";
-import { itBundled } from "./expectBundled";
import { describe, expect } from "bun:test";
+import { dirname, join, resolve } from "node:path";
+import { itBundled } from "./expectBundled";
describe("bundler", () => {
const loadFixture = {
diff --git a/test/bundler/bundler_regressions.test.ts b/test/bundler/bundler_regressions.test.ts
index a6642a84e8..315515b0d9 100644
--- a/test/bundler/bundler_regressions.test.ts
+++ b/test/bundler/bundler_regressions.test.ts
@@ -1,5 +1,5 @@
-import { itBundled } from "./expectBundled";
import { describe } from "bun:test";
+import { itBundled } from "./expectBundled";
describe("bundler", () => {
// https://x.com/jeroendotdot/status/1740651288239460384?s=46&t=0Uhw6mmGT650_9M2pXUsCw
diff --git a/test/bundler/bundler_string.test.ts b/test/bundler/bundler_string.test.ts
index ef7a9d74e4..2b5901d782 100644
--- a/test/bundler/bundler_string.test.ts
+++ b/test/bundler/bundler_string.test.ts
@@ -1,5 +1,5 @@
-import { itBundled, dedent } from "./expectBundled";
import { describe } from "bun:test";
+import { dedent, itBundled } from "./expectBundled";
interface TemplateStringTest {
expr: string;
diff --git a/test/bundler/cli.test.ts b/test/bundler/cli.test.ts
index b4c0308fdf..4830840f38 100644
--- a/test/bundler/cli.test.ts
+++ b/test/bundler/cli.test.ts
@@ -1,5 +1,5 @@
-import { bunEnv, bunExe, tmpdirSync } from "harness";
import { describe, expect, test } from "bun:test";
+import { bunEnv, bunExe, tmpdirSync } from "harness";
import fs from "node:fs";
import path from "node:path";
diff --git a/test/bundler/esbuild/css.test.ts b/test/bundler/esbuild/css.test.ts
index 2c6917ecc8..ee52bbe2c2 100644
--- a/test/bundler/esbuild/css.test.ts
+++ b/test/bundler/esbuild/css.test.ts
@@ -1,5 +1,5 @@
+import { describe } from "bun:test";
import { itBundled } from "../expectBundled";
-import { describe, expect } from "bun:test";
// Tests ported from:
// https://github.com/evanw/esbuild/blob/main/internal/bundler_tests/bundler_css_test.go
diff --git a/test/bundler/esbuild/dce.test.ts b/test/bundler/esbuild/dce.test.ts
index a4a5b84250..f718bd9670 100644
--- a/test/bundler/esbuild/dce.test.ts
+++ b/test/bundler/esbuild/dce.test.ts
@@ -1,6 +1,6 @@
-import { itBundled, dedent } from "../expectBundled";
import { describe, expect } from "bun:test";
-import { isWindows } from 'harness';
+import { isWindows } from "harness";
+import { dedent, itBundled } from "../expectBundled";
// Tests ported from:
// https://github.com/evanw/esbuild/blob/main/internal/bundler_tests/bundler_dce_test.go
diff --git a/test/bundler/esbuild/default.test.ts b/test/bundler/esbuild/default.test.ts
index a5dc5130fa..7c60b5d447 100644
--- a/test/bundler/esbuild/default.test.ts
+++ b/test/bundler/esbuild/default.test.ts
@@ -1,7 +1,7 @@
import assert from "assert";
-import { ESBUILD_PATH, itBundled, dedent } from "../expectBundled";
-import { osSlashes } from "harness";
import { describe, expect } from "bun:test";
+import { osSlashes } from "harness";
+import { dedent, ESBUILD_PATH, itBundled } from "../expectBundled";
// Tests ported from:
// https://github.com/evanw/esbuild/blob/main/internal/bundler_tests/bundler_default_test.go
diff --git a/test/bundler/esbuild/extra.test.ts b/test/bundler/esbuild/extra.test.ts
index 27742af79e..fae84dd219 100644
--- a/test/bundler/esbuild/extra.test.ts
+++ b/test/bundler/esbuild/extra.test.ts
@@ -1,5 +1,5 @@
-import { itBundled } from "../expectBundled";
import { describe } from "bun:test";
+import { itBundled } from "../expectBundled";
// Tests ported from:
// https://github.com/evanw/esbuild
diff --git a/test/bundler/esbuild/importstar.test.ts b/test/bundler/esbuild/importstar.test.ts
index f30bc6f727..3cec66e2b8 100644
--- a/test/bundler/esbuild/importstar.test.ts
+++ b/test/bundler/esbuild/importstar.test.ts
@@ -1,5 +1,5 @@
-import { itBundled } from "../expectBundled";
import { describe } from "bun:test";
+import { itBundled } from "../expectBundled";
// Tests ported from:
// https://github.com/evanw/esbuild/blob/main/internal/bundler_tests/bundler_importstar_test.go
diff --git a/test/bundler/esbuild/importstar_ts.test.ts b/test/bundler/esbuild/importstar_ts.test.ts
index 4c11dab040..35ce54499d 100644
--- a/test/bundler/esbuild/importstar_ts.test.ts
+++ b/test/bundler/esbuild/importstar_ts.test.ts
@@ -1,5 +1,5 @@
-import { itBundled } from "../expectBundled";
import { describe } from "bun:test";
+import { itBundled } from "../expectBundled";
// Tests ported from:
// https://github.com/evanw/esbuild/blob/main/internal/bundler_tests/bundler_importstar_ts_test.go
diff --git a/test/bundler/esbuild/loader.test.ts b/test/bundler/esbuild/loader.test.ts
index 39232b2602..bb765099ff 100644
--- a/test/bundler/esbuild/loader.test.ts
+++ b/test/bundler/esbuild/loader.test.ts
@@ -1,5 +1,5 @@
-import { itBundled } from "../expectBundled";
import { describe } from "bun:test";
+import { itBundled } from "../expectBundled";
// Tests ported from:
// https://github.com/evanw/esbuild/blob/main/internal/bundler_tests/bundler_loader_test.go
diff --git a/test/bundler/esbuild/lower.test.ts b/test/bundler/esbuild/lower.test.ts
index 4cf08a781d..428af0d689 100644
--- a/test/bundler/esbuild/lower.test.ts
+++ b/test/bundler/esbuild/lower.test.ts
@@ -1,5 +1,5 @@
-import { itBundled } from "../expectBundled";
import { describe } from "bun:test";
+import { itBundled } from "../expectBundled";
// Tests ported from:
// https://github.com/evanw/esbuild/blob/main/internal/bundler_tests/bundler_lower_test.go
diff --git a/test/bundler/esbuild/packagejson.test.ts b/test/bundler/esbuild/packagejson.test.ts
index 714f1e3cd0..6983b3162a 100644
--- a/test/bundler/esbuild/packagejson.test.ts
+++ b/test/bundler/esbuild/packagejson.test.ts
@@ -1,5 +1,5 @@
-import { itBundled } from "../expectBundled";
import { describe } from "bun:test";
+import { itBundled } from "../expectBundled";
// Tests ported from:
// https://github.com/evanw/esbuild/blob/main/internal/bundler_tests/bundler_packagejson_test.go
diff --git a/test/bundler/esbuild/splitting.test.ts b/test/bundler/esbuild/splitting.test.ts
index 9e8567e490..2f31caf0e2 100644
--- a/test/bundler/esbuild/splitting.test.ts
+++ b/test/bundler/esbuild/splitting.test.ts
@@ -1,7 +1,7 @@
import assert from "assert";
-import { readdirSync } from "fs";
-import { itBundled, testForFile } from "../expectBundled";
import { describe, expect } from "bun:test";
+import { readdirSync } from "fs";
+import { itBundled } from "../expectBundled";
// Tests ported from:
// https://github.com/evanw/esbuild/blob/main/internal/bundler_tests/bundler_splitting_test.go
diff --git a/test/bundler/esbuild/ts.test.ts b/test/bundler/esbuild/ts.test.ts
index 2aa02132c8..196fa9a242 100644
--- a/test/bundler/esbuild/ts.test.ts
+++ b/test/bundler/esbuild/ts.test.ts
@@ -1,6 +1,6 @@
import assert from "assert";
-import { itBundled } from "../expectBundled";
import { describe, expect } from "bun:test";
+import { itBundled } from "../expectBundled";
// Tests ported from:
// https://github.com/evanw/esbuild/blob/main/internal/bundler_tests/bundler_ts_test.go
diff --git a/test/bundler/esbuild/tsconfig.test.ts b/test/bundler/esbuild/tsconfig.test.ts
index d96d822f96..b62a6d7694 100644
--- a/test/bundler/esbuild/tsconfig.test.ts
+++ b/test/bundler/esbuild/tsconfig.test.ts
@@ -1,5 +1,5 @@
-import { itBundled } from "../expectBundled";
import { describe, test } from "bun:test";
+import { itBundled } from "../expectBundled";
// Tests ported from:
// https://github.com/evanw/esbuild/blob/main/internal/bundler_tests/bundler_tsconfig_test.go
diff --git a/test/bundler/expectBundled.ts b/test/bundler/expectBundled.ts
index 06f34a9962..6107cbb9f2 100644
--- a/test/bundler/expectBundled.ts
+++ b/test/bundler/expectBundled.ts
@@ -1,15 +1,14 @@
/**
* See `./expectBundled.md` for how this works.
*/
-import { existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync, readdirSync, realpathSync } from "fs";
-import path from "path";
+import { BuildConfig, BunPlugin, fileURLToPath, PluginBuilder } from "bun";
+import { callerSourceOrigin } from "bun:jsc";
+import type { Matchers } from "bun:test";
+import * as esbuild from "esbuild";
+import { existsSync, mkdirSync, mkdtempSync, readdirSync, readFileSync, realpathSync, rmSync, writeFileSync } from "fs";
import { bunEnv, bunExe, isDebug } from "harness";
import { tmpdir } from "os";
-import { callerSourceOrigin } from "bun:jsc";
-import { BuildConfig, BunPlugin, fileURLToPath } from "bun";
-import type { Matchers } from "bun:test";
-import { PluginBuilder } from "bun";
-import * as esbuild from "esbuild";
+import path from "path";
import { SourceMapConsumer } from "source-map";
/** Dedent module does a bit too much with their stuff. we will be much simpler */
diff --git a/test/bundler/fixtures/bundler-reloader-script.ts b/test/bundler/fixtures/bundler-reloader-script.ts
index b52766f561..051bd27cd2 100644
--- a/test/bundler/fixtures/bundler-reloader-script.ts
+++ b/test/bundler/fixtures/bundler-reloader-script.ts
@@ -6,10 +6,9 @@
//
// 2. Checks the file descriptor count to make sure we're not leaking any files between re-builds.
+import { closeSync, openSync, realpathSync, unlinkSync } from "fs";
import { tmpdir } from "os";
-import { realpathSync, unlinkSync } from "fs";
import { join } from "path";
-import { openSync, closeSync } from "fs";
const tmp = realpathSync(process.env.BUNDLER_RELOADER_SCRIPT_TMP_DIR || tmpdir());
const input = join(tmp, "input.js");
diff --git a/test/bundler/transpiler/decorators.test.ts b/test/bundler/transpiler/decorators.test.ts
index fd33ce3f9c..e51fc524af 100644
--- a/test/bundler/transpiler/decorators.test.ts
+++ b/test/bundler/transpiler/decorators.test.ts
@@ -1,5 +1,5 @@
// @ts-nocheck
-import { test, expect, describe } from "bun:test";
+import { describe, expect, test } from "bun:test";
import DecoratedClass from "./decorator-export-default-class-fixture";
import DecoratedAnonClass from "./decorator-export-default-class-fixture-anon";
diff --git a/test/bundler/transpiler/export-default.test.js b/test/bundler/transpiler/export-default.test.js
index e557ffe00c..2ab9d08c81 100644
--- a/test/bundler/transpiler/export-default.test.js
+++ b/test/bundler/transpiler/export-default.test.js
@@ -1,5 +1,5 @@
+import { expect, test } from "bun:test";
import WithStatic from "./export-default-with-static-initializer";
-import { test, expect } from "bun:test";
test("static initializer", () => {
expect(WithStatic.boop).toBe("boop");
diff --git a/test/bundler/transpiler/macro-test.test.ts b/test/bundler/transpiler/macro-test.test.ts
index 8404ab4b15..5c95553400 100644
--- a/test/bundler/transpiler/macro-test.test.ts
+++ b/test/bundler/transpiler/macro-test.test.ts
@@ -1,6 +1,6 @@
+import { escapeHTML } from "bun" assert { type: "macro" };
import { expect, test } from "bun:test";
import { addStrings, addStringsUTF16, escape, identity } from "./macro.ts" assert { type: "macro" };
-import { escapeHTML } from "bun" assert { type: "macro" };
test("bun builtins can be used in macros", async () => {
expect(escapeHTML("abc!")).toBe("abc!");
diff --git a/test/bundler/transpiler/preserve-use-strict-cjs.test.ts b/test/bundler/transpiler/preserve-use-strict-cjs.test.ts
index 675f17d278..fc459cdc6b 100644
--- a/test/bundler/transpiler/preserve-use-strict-cjs.test.ts
+++ b/test/bundler/transpiler/preserve-use-strict-cjs.test.ts
@@ -1,4 +1,4 @@
-import { test, expect } from "bun:test";
+import { expect, test } from "bun:test";
import path from "path";
test(`"use strict'; preserves strict mode in CJS`, async () => {
diff --git a/test/bundler/transpiler/property.test.ts b/test/bundler/transpiler/property.test.ts
index df02790da4..10786513ab 100644
--- a/test/bundler/transpiler/property.test.ts
+++ b/test/bundler/transpiler/property.test.ts
@@ -1,4 +1,4 @@
-import { test, expect } from "bun:test";
+import { expect, test } from "bun:test";
import { bunEnv, bunExe } from "harness";
// See https://github.com/oven-sh/bun/pull/2939
diff --git a/test/bundler/transpiler/template-literal.test.ts b/test/bundler/transpiler/template-literal.test.ts
index a0fd2170f3..aa17d48395 100644
--- a/test/bundler/transpiler/template-literal.test.ts
+++ b/test/bundler/transpiler/template-literal.test.ts
@@ -1,4 +1,4 @@
-import { test, expect } from "bun:test";
+import { expect, test } from "bun:test";
import { bunEnv, bunExe } from "harness";
import { join } from "path";
diff --git a/test/bundler/transpiler/transpiler-stack-overflow.test.ts b/test/bundler/transpiler/transpiler-stack-overflow.test.ts
index 7db3d7f3cf..73835e8f78 100644
--- a/test/bundler/transpiler/transpiler-stack-overflow.test.ts
+++ b/test/bundler/transpiler/transpiler-stack-overflow.test.ts
@@ -1,7 +1,7 @@
-import { test, expect } from "bun:test";
-import { writeFileSync, mkdirSync } from "node:fs";
-import { join } from "path";
+import { expect, test } from "bun:test";
import { bunEnv, bunExe, tmpdirSync } from "harness";
+import { mkdirSync, writeFileSync } from "node:fs";
+import { join } from "path";
test("long chain of expressions does not cause stack overflow", () => {
const chain = `globalThis.a = {};` + "\n" + `globalThis.a + globalThis.a +`.repeat(1000000) + `globalThis.a` + "\n";
diff --git a/test/bundler/transpiler/transpiler.test.js b/test/bundler/transpiler/transpiler.test.js
index 581591fb3e..c140cd2140 100644
--- a/test/bundler/transpiler/transpiler.test.js
+++ b/test/bundler/transpiler/transpiler.test.js
@@ -1,4 +1,4 @@
-import { expect, it, describe } from "bun:test";
+import { describe, expect, it } from "bun:test";
import { hideFromStackTrace } from "harness";
describe("Bun.Transpiler", () => {
diff --git a/test/cli/bun.test.ts b/test/cli/bun.test.ts
index 9b48eeba3e..c6dd62858f 100644
--- a/test/cli/bun.test.ts
+++ b/test/cli/bun.test.ts
@@ -1,8 +1,8 @@
-import { describe, test, expect } from "bun:test";
import { spawnSync } from "bun";
+import { describe, expect, test } from "bun:test";
import { bunEnv, bunExe } from "harness";
-import { tmpdir } from "node:os";
import fs from "node:fs";
+import { tmpdir } from "node:os";
describe("bun", () => {
describe("NO_COLOR", () => {
diff --git a/test/cli/hot/hot-runner.js b/test/cli/hot/hot-runner.js
index 9f5e81d03f..1023740e9d 100644
--- a/test/cli/hot/hot-runner.js
+++ b/test/cli/hot/hot-runner.js
@@ -1,6 +1,6 @@
-import "./hot-runner-imported";
-import "./hot-file-loader.file";
import "./hot-file-loader.css";
+import "./hot-file-loader.file";
+import "./hot-runner-imported";
globalThis.counter ??= 0;
diff --git a/test/cli/hot/hot.test.ts b/test/cli/hot/hot.test.ts
index 646e48108f..81d4e046d8 100644
--- a/test/cli/hot/hot.test.ts
+++ b/test/cli/hot/hot.test.ts
@@ -1,7 +1,7 @@
import { spawn } from "bun";
import { beforeEach, expect, it } from "bun:test";
-import { bunExe, bunEnv, tmpdirSync, isDebug, isWindows } from "harness";
-import { cpSync, readFileSync, renameSync, rmSync, unlinkSync, writeFileSync, copyFileSync } from "fs";
+import { copyFileSync, cpSync, readFileSync, renameSync, rmSync, unlinkSync, writeFileSync } from "fs";
+import { bunEnv, bunExe, isDebug, tmpdirSync } from "harness";
import { join } from "path";
const timeout = isDebug ? Infinity : 10_000;
diff --git a/test/cli/hot/watch.test.ts b/test/cli/hot/watch.test.ts
index 1cd7d77ace..094d916707 100644
--- a/test/cli/hot/watch.test.ts
+++ b/test/cli/hot/watch.test.ts
@@ -1,7 +1,7 @@
import { spawn } from "bun";
import { describe, expect, test } from "bun:test";
-import { writeFile } from "node:fs/promises";
import { bunEnv, bunExe, forEachLine, tempDirWithFiles } from "harness";
+import { writeFile } from "node:fs/promises";
import { join } from "node:path";
describe("--watch works", async () => {
diff --git a/test/cli/init/init.test.ts b/test/cli/init/init.test.ts
index a12889b88f..fb8f7c2ee8 100644
--- a/test/cli/init/init.test.ts
+++ b/test/cli/init/init.test.ts
@@ -1,7 +1,7 @@
+import { expect, test } from "bun:test";
import fs from "fs";
+import { bunEnv, bunExe, tmpdirSync } from "harness";
import path from "path";
-import { bunExe, bunEnv, tmpdirSync } from "harness";
-import { test, expect } from "bun:test";
test("bun init works", () => {
const temp = tmpdirSync();
diff --git a/test/cli/inspect/inspect.test.ts b/test/cli/inspect/inspect.test.ts
index 30897ea619..e648ad8c8a 100644
--- a/test/cli/inspect/inspect.test.ts
+++ b/test/cli/inspect/inspect.test.ts
@@ -1,6 +1,6 @@
-import { test, expect, afterEach } from "bun:test";
-import { bunExe, bunEnv, randomPort } from "harness";
import { Subprocess, spawn } from "bun";
+import { afterEach, expect, test } from "bun:test";
+import { bunEnv, bunExe, randomPort } from "harness";
import { WebSocket } from "ws";
let inspectee: Subprocess;
diff --git a/test/cli/install/bad-workspace.test.ts b/test/cli/install/bad-workspace.test.ts
index c3d61e4250..36200df4e7 100644
--- a/test/cli/install/bad-workspace.test.ts
+++ b/test/cli/install/bad-workspace.test.ts
@@ -1,7 +1,7 @@
import { spawnSync } from "bun";
-import { beforeEach, expect, test, beforeAll, setDefaultTimeout } from "bun:test";
+import { beforeAll, beforeEach, expect, setDefaultTimeout, test } from "bun:test";
import { writeFileSync } from "fs";
-import { bunExe, bunEnv, tmpdirSync } from "harness";
+import { bunEnv, bunExe, tmpdirSync } from "harness";
let cwd: string;
diff --git a/test/cli/install/bun-add.test.ts b/test/cli/install/bun-add.test.ts
index b4edc54ffd..385a14f283 100644
--- a/test/cli/install/bun-add.test.ts
+++ b/test/cli/install/bun-add.test.ts
@@ -1,7 +1,7 @@
import { file, spawn } from "bun";
import { afterAll, afterEach, beforeAll, beforeEach, expect, it, setDefaultTimeout } from "bun:test";
-import { bunExe, bunEnv as env, toHaveBins, toBeValidBin, toBeWorkspaceLink, tmpdirSync } from "harness";
-import { access, mkdir, readlink, rm, writeFile, copyFile, appendFile, readFile } from "fs/promises";
+import { access, appendFile, copyFile, mkdir, readlink, rm, writeFile } from "fs/promises";
+import { bunExe, bunEnv as env, tmpdirSync, toBeValidBin, toBeWorkspaceLink, toHaveBins } from "harness";
import { join, relative } from "path";
import {
dummyAfterAll,
diff --git a/test/cli/install/bun-create.test.ts b/test/cli/install/bun-create.test.ts
index b57d2e2faa..1e8937a014 100644
--- a/test/cli/install/bun-create.test.ts
+++ b/test/cli/install/bun-create.test.ts
@@ -1,7 +1,7 @@
import { spawn, spawnSync } from "bun";
-import { beforeEach, expect, it, describe } from "bun:test";
+import { beforeEach, describe, expect, it } from "bun:test";
+import { exists, stat } from "fs/promises";
import { bunExe, bunEnv as env, tmpdirSync } from "harness";
-import { mkdir, stat, exists } from "fs/promises";
import { join } from "path";
let x_dir: string;
diff --git a/test/cli/install/bun-install-dep.test.ts b/test/cli/install/bun-install-dep.test.ts
index 6e0ce18b65..03321aa867 100644
--- a/test/cli/install/bun-install-dep.test.ts
+++ b/test/cli/install/bun-install-dep.test.ts
@@ -1,5 +1,5 @@
-import { test, expect, describe } from "bun:test";
import { npa } from "bun:internal-for-testing";
+import { expect, test } from "bun:test";
const bitbucket = [
"bitbucket:dylan-conway/public-install-test",
diff --git a/test/cli/install/bun-install-patch.test.ts b/test/cli/install/bun-install-patch.test.ts
index 332aed1d1c..1c47d0197d 100644
--- a/test/cli/install/bun-install-patch.test.ts
+++ b/test/cli/install/bun-install-patch.test.ts
@@ -1,6 +1,6 @@
import { $ } from "bun";
-import { bunExe, bunEnv as env, toBeValidBin, toHaveBins, toBeWorkspaceLink, tempDirWithFiles, bunEnv } from "harness";
-import { afterAll, afterEach, beforeAll, beforeEach, expect, it, describe, test, setDefaultTimeout } from "bun:test";
+import { beforeAll, describe, expect, it, setDefaultTimeout, test } from "bun:test";
+import { bunEnv, bunExe, tempDirWithFiles } from "harness";
beforeAll(() => {
setDefaultTimeout(1000 * 60 * 5);
diff --git a/test/cli/install/bun-install-pathname-trailing-slash.test.ts b/test/cli/install/bun-install-pathname-trailing-slash.test.ts
index 68983ab312..5f6e4b43db 100644
--- a/test/cli/install/bun-install-pathname-trailing-slash.test.ts
+++ b/test/cli/install/bun-install-pathname-trailing-slash.test.ts
@@ -1,4 +1,4 @@
-import { afterEach, beforeEach, expect, test } from "bun:test";
+import { beforeEach, expect, test } from "bun:test";
import { bunEnv, bunExe, tmpdirSync } from "harness";
import { join } from "path";
diff --git a/test/cli/install/bun-install-retry.test.ts b/test/cli/install/bun-install-retry.test.ts
index 87735923fd..27f3f70522 100644
--- a/test/cli/install/bun-install-retry.test.ts
+++ b/test/cli/install/bun-install-retry.test.ts
@@ -1,8 +1,8 @@
import { file, spawn } from "bun";
import { afterAll, afterEach, beforeAll, beforeEach, expect, it, setDefaultTimeout } from "bun:test";
-import { bunExe, bunEnv as env, toHaveBins, toBeValidBin, toBeWorkspaceLink, tmpdirSync } from "harness";
-import { access, mkdir, readlink, rm, writeFile, copyFile, appendFile, readFile } from "fs/promises";
-import { join, relative } from "path";
+import { access, writeFile } from "fs/promises";
+import { bunExe, bunEnv as env, tmpdirSync, toBeValidBin, toBeWorkspaceLink, toHaveBins } from "harness";
+import { join } from "path";
import {
dummyAfterAll,
dummyAfterEach,
diff --git a/test/cli/install/bun-install.test.ts b/test/cli/install/bun-install.test.ts
index b75dcd26e1..072bcb22ee 100644
--- a/test/cli/install/bun-install.test.ts
+++ b/test/cli/install/bun-install.test.ts
@@ -1,8 +1,7 @@
-import { $ } from "bun";
import { file, listen, Socket, spawn } from "bun";
-import { afterAll, afterEach, beforeAll, beforeEach, expect, it, describe, test, setDefaultTimeout } from "bun:test";
-import { bunExe, bunEnv as env, toBeValidBin, toHaveBins, toBeWorkspaceLink, tempDirWithFiles, bunEnv } from "harness";
-import { access, mkdir, readlink as readlink, realpath, rm, writeFile } from "fs/promises";
+import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it, setDefaultTimeout, test } from "bun:test";
+import { access, mkdir, readlink, rm, writeFile } from "fs/promises";
+import { bunEnv, bunExe, bunEnv as env, tempDirWithFiles, toBeValidBin, toBeWorkspaceLink, toHaveBins } from "harness";
import { join, sep } from "path";
import {
dummyAfterAll,
diff --git a/test/cli/install/bun-link.test.ts b/test/cli/install/bun-link.test.ts
index 120e9ed976..713088fe04 100644
--- a/test/cli/install/bun-link.test.ts
+++ b/test/cli/install/bun-link.test.ts
@@ -1,7 +1,7 @@
-import { spawn, file } from "bun";
+import { file, spawn } from "bun";
import { afterAll, afterEach, beforeAll, beforeEach, expect, it } from "bun:test";
-import { bunExe, bunEnv as env, runBunInstall, toBeValidBin, toHaveBins, tmpdirSync } from "harness";
-import { access, writeFile, mkdir } from "fs/promises";
+import { access, mkdir, writeFile } from "fs/promises";
+import { bunExe, bunEnv as env, runBunInstall, tmpdirSync, toBeValidBin, toHaveBins } from "harness";
import { basename, join } from "path";
import {
dummyAfterAll,
diff --git a/test/cli/install/bun-patch.test.ts b/test/cli/install/bun-patch.test.ts
index 4fd2db9035..c81a74404e 100644
--- a/test/cli/install/bun-patch.test.ts
+++ b/test/cli/install/bun-patch.test.ts
@@ -1,7 +1,7 @@
-import { $, ShellOutput, ShellPromise } from "bun";
-import { bunExe, bunEnv as env, toBeValidBin, toHaveBins, toBeWorkspaceLink, tempDirWithFiles, bunEnv } from "harness";
-import { afterAll, afterEach, beforeAll, beforeEach, expect, it, describe, test, setDefaultTimeout } from "bun:test";
-import { join, sep } from "path";
+import { $, ShellOutput } from "bun";
+import { beforeAll, describe, expect, setDefaultTimeout, test } from "bun:test";
+import { bunEnv, bunExe, tempDirWithFiles } from "harness";
+import { join } from "path";
const expectNoError = (o: ShellOutput) => expect(o.stderr.toString()).not.toContain("error");
// const platformPath = (path: string) => (process.platform === "win32" ? path.replaceAll("/", sep) : path);
diff --git a/test/cli/install/bun-pm.test.ts b/test/cli/install/bun-pm.test.ts
index 474dc7b7f2..d1a6042f96 100644
--- a/test/cli/install/bun-pm.test.ts
+++ b/test/cli/install/bun-pm.test.ts
@@ -1,7 +1,8 @@
-import { hash, spawn } from "bun";
+import { spawn } from "bun";
import { afterAll, afterEach, beforeAll, beforeEach, expect, it } from "bun:test";
+import { exists, mkdir, writeFile } from "fs/promises";
import { bunEnv, bunExe, bunEnv as env, tmpdirSync } from "harness";
-import { mkdir, writeFile, exists } from "fs/promises";
+import { cpSync } from "node:fs";
import { join } from "path";
import {
dummyAfterAll,
@@ -15,7 +16,6 @@ import {
root_url,
setHandler,
} from "./dummy.registry";
-import { cpSync } from "node:fs";
beforeAll(dummyBeforeAll);
afterAll(dummyAfterAll);
diff --git a/test/cli/install/bun-remove.test.ts b/test/cli/install/bun-remove.test.ts
index 1dd224d021..c7ae73618d 100644
--- a/test/cli/install/bun-remove.test.ts
+++ b/test/cli/install/bun-remove.test.ts
@@ -1,10 +1,9 @@
-import { bunExe, bunEnv as env, tmpdirSync } from "harness";
-import { mkdir, writeFile } from "fs/promises";
-import { join, relative } from "path";
+import { file, spawn } from "bun";
import { afterAll, afterEach, beforeAll, beforeEach, expect, it } from "bun:test";
+import { mkdir, writeFile } from "fs/promises";
+import { bunExe, bunEnv as env, tmpdirSync } from "harness";
+import { join, relative } from "path";
import { dummyAfterAll, dummyAfterEach, dummyBeforeAll, dummyBeforeEach, package_dir } from "./dummy.registry";
-import { spawn } from "bun";
-import { file } from "bun";
beforeAll(dummyBeforeAll);
afterAll(dummyAfterAll);
diff --git a/test/cli/install/bun-repl.test.ts b/test/cli/install/bun-repl.test.ts
index 466b956029..7f95580d16 100644
--- a/test/cli/install/bun-repl.test.ts
+++ b/test/cli/install/bun-repl.test.ts
@@ -1,4 +1,4 @@
-import { test, expect } from "bun:test";
+import { expect, test } from "bun:test";
import "harness";
// https://github.com/oven-sh/bun/issues/12070
diff --git a/test/cli/install/bun-run-bunfig.test.ts b/test/cli/install/bun-run-bunfig.test.ts
index 471c50775a..a5890fb92d 100644
--- a/test/cli/install/bun-run-bunfig.test.ts
+++ b/test/cli/install/bun-run-bunfig.test.ts
@@ -1,7 +1,6 @@
import { describe, expect, test } from "bun:test";
-import { realpathSync, chmodSync } from "fs";
+import { realpathSync } from "fs";
import { bunEnv, bunExe, isWindows, tempDirWithFiles, toTOMLString } from "harness";
-import { join } from "path";
describe.each(["bun run", "bun"])(`%s`, cmd => {
const runCmd = cmd === "bun" ? ["-c=bunfig.toml", "run"] : ["-c=bunfig.toml"];
diff --git a/test/cli/install/bun-run.test.ts b/test/cli/install/bun-run.test.ts
index 21f48c4c9f..e20c2efda2 100644
--- a/test/cli/install/bun-run.test.ts
+++ b/test/cli/install/bun-run.test.ts
@@ -1,7 +1,7 @@
import { file, spawn, spawnSync } from "bun";
-import { afterEach, beforeEach, expect, it, describe } from "bun:test";
+import { beforeEach, describe, expect, it } from "bun:test";
+import { exists, mkdir, rm, writeFile } from "fs/promises";
import { bunEnv, bunExe, bunEnv as env, isWindows, tempDirWithFiles, tmpdirSync } from "harness";
-import { rm, writeFile, exists, mkdir } from "fs/promises";
import { join } from "path";
import { readdirSorted } from "./dummy.registry";
diff --git a/test/cli/install/bun-update.test.ts b/test/cli/install/bun-update.test.ts
index b15df2de3d..9b6575a73b 100644
--- a/test/cli/install/bun-update.test.ts
+++ b/test/cli/install/bun-update.test.ts
@@ -1,7 +1,7 @@
-import { file, listen, Socket, spawn } from "bun";
+import { file, spawn } from "bun";
import { afterAll, afterEach, beforeAll, beforeEach, expect, it } from "bun:test";
+import { access, readFile, rm, writeFile } from "fs/promises";
import { bunExe, bunEnv as env, toBeValidBin, toHaveBins } from "harness";
-import { readFile, access, mkdir, readlink, realpath, rm, writeFile } from "fs/promises";
import { join } from "path";
import {
dummyAfterAll,
diff --git a/test/cli/install/bun-upgrade.test.ts b/test/cli/install/bun-upgrade.test.ts
index b62f7e93f1..4380313a31 100644
--- a/test/cli/install/bun-upgrade.test.ts
+++ b/test/cli/install/bun-upgrade.test.ts
@@ -1,9 +1,9 @@
import { spawn, spawnSync } from "bun";
-import { beforeEach, expect, it, setDefaultTimeout, beforeAll } from "bun:test";
-import { bunExe, bunEnv as env, tls, tmpdirSync } from "harness";
-import { join, basename } from "path";
-import { copyFileSync } from "node:fs";
import { upgrade_test_helpers } from "bun:internal-for-testing";
+import { beforeAll, beforeEach, expect, it, setDefaultTimeout } from "bun:test";
+import { bunExe, bunEnv as env, tls, tmpdirSync } from "harness";
+import { copyFileSync } from "node:fs";
+import { basename, join } from "path";
const { openTempDirWithoutSharingDelete, closeTempDirHandle } = upgrade_test_helpers;
let cwd: string;
diff --git a/test/cli/install/bun-workspaces.test.ts b/test/cli/install/bun-workspaces.test.ts
index 90ca47d7f4..318b563bea 100644
--- a/test/cli/install/bun-workspaces.test.ts
+++ b/test/cli/install/bun-workspaces.test.ts
@@ -1,10 +1,9 @@
-import { spawnSync, write, file } from "bun";
+import { file, write } from "bun";
+import { install_test_helpers } from "bun:internal-for-testing";
+import { beforeEach, describe, expect, test } from "bun:test";
+import { mkdirSync, rmSync, writeFileSync } from "fs";
import { bunExe, bunEnv as env, runBunInstall, tmpdirSync, toMatchNodeModulesAt } from "harness";
import { join } from "path";
-import { writeFileSync, mkdirSync, rmSync } from "fs";
-import { writeFile, mkdir } from "fs/promises";
-import { beforeEach, test, expect, describe } from "bun:test";
-import { install_test_helpers } from "bun:internal-for-testing";
const { parseLockfile } = install_test_helpers;
expect.extend({ toMatchNodeModulesAt });
diff --git a/test/cli/install/bunx.test.ts b/test/cli/install/bunx.test.ts
index 48ecca2707..87a26b0c7b 100644
--- a/test/cli/install/bunx.test.ts
+++ b/test/cli/install/bunx.test.ts
@@ -2,10 +2,10 @@ import { spawn } from "bun";
import { beforeAll, beforeEach, expect, it, setDefaultTimeout } from "bun:test";
import { rm, writeFile } from "fs/promises";
import { bunEnv, bunExe, isWindows, tmpdirSync } from "harness";
+import { readdirSync } from "node:fs";
import { tmpdir } from "os";
import { join, resolve } from "path";
import { readdirSorted } from "./dummy.registry";
-import { readdirSync } from "node:fs";
let x_dir: string;
let current_tmpdir: string;
diff --git a/test/cli/install/dummy.registry.ts b/test/cli/install/dummy.registry.ts
index b559f06345..65b7db7c41 100644
--- a/test/cli/install/dummy.registry.ts
+++ b/test/cli/install/dummy.registry.ts
@@ -4,11 +4,11 @@
* PACKAGE_DIR_TO_USE=(realpath .) bun test/cli/install/dummy.registry.ts
*/
import { file, Server } from "bun";
-
-let expect: (typeof import("bun:test"))["expect"];
import { tmpdirSync } from "harness";
-import { readdir, rm, writeFile } from "fs/promises";
+let expect: (typeof import("bun:test"))["expect"];
+
+import { readdir, writeFile } from "fs/promises";
import { basename, join } from "path";
type Handler = (req: Request) => Response | Promise;
diff --git a/test/cli/install/migration/complex-workspace.test.ts b/test/cli/install/migration/complex-workspace.test.ts
index 4db23618b5..094aef74d4 100644
--- a/test/cli/install/migration/complex-workspace.test.ts
+++ b/test/cli/install/migration/complex-workspace.test.ts
@@ -1,7 +1,7 @@
+import { beforeAll, expect, setDefaultTimeout, test } from "bun:test";
import fs from "fs";
-import path from "path";
-import { test, expect, describe, beforeAll, setDefaultTimeout } from "bun:test";
import { bunEnv, bunExe, tmpdirSync } from "harness";
+import path from "path";
let cwd = tmpdirSync();
diff --git a/test/cli/install/migration/migrate.test.ts b/test/cli/install/migration/migrate.test.ts
index 536311c981..bd5d19b5fd 100644
--- a/test/cli/install/migration/migrate.test.ts
+++ b/test/cli/install/migration/migrate.test.ts
@@ -1,5 +1,5 @@
+import { beforeAll, expect, setDefaultTimeout, test } from "bun:test";
import fs from "fs";
-import { test, expect, beforeAll, setDefaultTimeout } from "bun:test";
import { bunEnv, bunExe, tmpdirSync } from "harness";
import { join } from "path";
diff --git a/test/cli/install/overrides.test.ts b/test/cli/install/overrides.test.ts
index 30df82dd40..71400fe8ca 100644
--- a/test/cli/install/overrides.test.ts
+++ b/test/cli/install/overrides.test.ts
@@ -1,7 +1,7 @@
-import { join } from "path";
+import { beforeAll, expect, setDefaultTimeout, test } from "bun:test";
import { readFileSync, writeFileSync } from "fs";
import { bunEnv, bunExe, tmpdirSync } from "harness";
-import { test, expect, beforeAll, setDefaultTimeout } from "bun:test";
+import { join } from "path";
beforeAll(() => {
setDefaultTimeout(1000 * 60 * 5);
diff --git a/test/cli/install/registry/bun-install-registry.test.ts b/test/cli/install/registry/bun-install-registry.test.ts
index 16de31c1bc..4663a170fd 100644
--- a/test/cli/install/registry/bun-install-registry.test.ts
+++ b/test/cli/install/registry/bun-install-registry.test.ts
@@ -1,28 +1,28 @@
import { file, spawn, write } from "bun";
+import { install_test_helpers } from "bun:internal-for-testing";
+import { afterAll, beforeAll, beforeEach, describe, expect, it, setDefaultTimeout, test } from "bun:test";
+import { ChildProcess, fork } from "child_process";
+import { copyFileSync, mkdirSync } from "fs";
+import { cp, exists, mkdir, readlink, rm, writeFile } from "fs/promises";
import {
+ assertManifestsPopulated,
bunExe,
bunEnv as env,
isLinux,
isWindows,
- toBeValidBin,
- toHaveBins,
- writeShebangScript,
- tmpdirSync,
- toMatchNodeModulesAt,
+ mergeWindowEnvs,
+ randomPort,
runBunInstall,
runBunUpdate,
tempDirWithFiles,
- randomPort,
- mergeWindowEnvs,
- assertManifestsPopulated,
+ tmpdirSync,
+ toBeValidBin,
+ toHaveBins,
+ toMatchNodeModulesAt,
+ writeShebangScript,
} from "harness";
-import { join, sep, resolve } from "path";
-import { mkdirSync, copyFileSync } from "fs";
-import { rm, writeFile, mkdir, exists, cp, readlink } from "fs/promises";
+import { join, resolve, sep } from "path";
import { readdirSorted } from "../dummy.registry";
-import { fork, ChildProcess } from "child_process";
-import { beforeAll, afterAll, beforeEach, test, expect, describe, it, setDefaultTimeout } from "bun:test";
-import { install_test_helpers } from "bun:internal-for-testing";
const { parseLockfile } = install_test_helpers;
const { iniInternals } = require("bun:internal-for-testing");
const { loadNpmrc } = iniInternals;
diff --git a/test/cli/run/as-node.test.ts b/test/cli/run/as-node.test.ts
index 9881fed9c5..871a1809d2 100644
--- a/test/cli/run/as-node.test.ts
+++ b/test/cli/run/as-node.test.ts
@@ -1,6 +1,6 @@
-import { describe, test, expect } from "bun:test";
-import { bunExe, fakeNodeRun, tempDirWithFiles } from "../../harness";
+import { describe, expect, test } from "bun:test";
import { join } from "path";
+import { fakeNodeRun, tempDirWithFiles } from "../../harness";
describe("fake node cli", () => {
test("the node cli actually works", () => {
diff --git a/test/cli/run/commonjs-no-export.test.ts b/test/cli/run/commonjs-no-export.test.ts
index b0bedd9d63..39b7e82781 100644
--- a/test/cli/run/commonjs-no-export.test.ts
+++ b/test/cli/run/commonjs-no-export.test.ts
@@ -1,4 +1,4 @@
-import { test, expect } from "bun:test";
+import { expect, test } from "bun:test";
import { bunEnv, bunExe } from "harness";
import { join } from "path";
diff --git a/test/cli/run/empty-file.test.ts b/test/cli/run/empty-file.test.ts
index f29162bf7a..e9f2975752 100644
--- a/test/cli/run/empty-file.test.ts
+++ b/test/cli/run/empty-file.test.ts
@@ -1,4 +1,4 @@
-import { it, expect } from "bun:test";
+import { expect, it } from "bun:test";
import { bunEnv, bunExe } from "harness";
import { join } from "path";
diff --git a/test/cli/run/env.test.ts b/test/cli/run/env.test.ts
index 2837bfa5f8..18dd4122ff 100644
--- a/test/cli/run/env.test.ts
+++ b/test/cli/run/env.test.ts
@@ -1,5 +1,5 @@
-import { describe, expect, test, beforeAll, afterAll } from "bun:test";
-import { bunRun, bunRunAsScript, bunTest, tempDirWithFiles, bunExe, bunEnv, isWindows } from "harness";
+import { beforeAll, describe, expect, test } from "bun:test";
+import { bunEnv, bunExe, bunRun, bunRunAsScript, bunTest, isWindows, tempDirWithFiles } from "harness";
import path from "path";
function bunRunWithoutTrim(file: string, env?: Record) {
diff --git a/test/cli/run/esm-defineProperty.test.ts b/test/cli/run/esm-defineProperty.test.ts
index c6309f7a12..d6289b49cc 100644
--- a/test/cli/run/esm-defineProperty.test.ts
+++ b/test/cli/run/esm-defineProperty.test.ts
@@ -1,6 +1,6 @@
import { expect, test } from "bun:test";
-import * as CJS from "./cjs-defineProperty-fixture.cjs";
import * as CJSArrayLike from "./cjs-defineProperty-arraylike.cjs";
+import * as CJS from "./cjs-defineProperty-fixture.cjs";
// https://github.com/oven-sh/bun/issues/4432
test("defineProperty", () => {
expect(CJS.a).toBe(1);
diff --git a/test/cli/run/filter-workspace.test.ts b/test/cli/run/filter-workspace.test.ts
index 0ba2956191..a6c402c8a6 100644
--- a/test/cli/run/filter-workspace.test.ts
+++ b/test/cli/run/filter-workspace.test.ts
@@ -1,5 +1,5 @@
-import { describe, test, expect, beforeAll } from "bun:test";
import { spawnSync } from "bun";
+import { describe, expect, test } from "bun:test";
import { bunEnv, bunExe, tempDirWithFiles } from "harness";
import { join } from "path";
diff --git a/test/cli/run/fixture-tty.js b/test/cli/run/fixture-tty.js
index 1404b99212..fd9ca62a54 100644
--- a/test/cli/run/fixture-tty.js
+++ b/test/cli/run/fixture-tty.js
@@ -1,5 +1,5 @@
const onlyCheck = process.env.ONLY_CHECK_TTY === "0";
-import { dlopen, ptr } from "bun:ffi";
+import { dlopen } from "bun:ffi";
const suffix = process.platform === "darwin" ? "dylib" : "so.6";
const { tcgetattr, tcsetattr } = dlopen(`libc.${suffix}`, {
diff --git a/test/cli/run/if-present.test.ts b/test/cli/run/if-present.test.ts
index 96e587dc6d..824ee4a239 100644
--- a/test/cli/run/if-present.test.ts
+++ b/test/cli/run/if-present.test.ts
@@ -1,5 +1,5 @@
-import { describe, test, expect, beforeAll } from "bun:test";
import { spawnSync } from "bun";
+import { beforeAll, describe, expect, test } from "bun:test";
import { bunEnv, bunExe, tempDirWithFiles } from "harness";
let cwd: string;
diff --git a/test/cli/run/log-test.test.ts b/test/cli/run/log-test.test.ts
index eb15dd5929..dd684b8e28 100644
--- a/test/cli/run/log-test.test.ts
+++ b/test/cli/run/log-test.test.ts
@@ -1,8 +1,8 @@
-import { it, expect } from "bun:test";
-import { basename, dirname, join } from "path";
+import { spawnSync } from "bun";
+import { expect, it } from "bun:test";
import * as fs from "fs";
-import { readableStreamToText, spawnSync } from "bun";
-import { bunExe, bunEnv } from "harness";
+import { bunEnv, bunExe } from "harness";
+import { dirname, join } from "path";
it("should not log .env when quiet", async () => {
writeDirectoryTree("/tmp/log-test-silent", {
diff --git a/test/cli/run/preload-test.test.js b/test/cli/run/preload-test.test.js
index 3fa73956c9..72f9ddd953 100644
--- a/test/cli/run/preload-test.test.js
+++ b/test/cli/run/preload-test.test.js
@@ -1,9 +1,9 @@
import { spawnSync } from "bun";
import { describe, expect, test } from "bun:test";
import { mkdirSync, realpathSync } from "fs";
+import { bunEnv, bunExe } from "harness";
import { tmpdir } from "os";
import { join } from "path";
-import { bunEnv, bunExe } from "harness";
const preloadModule = `
import {plugin} from 'bun';
diff --git a/test/cli/run/require-and-import-trailing.test.ts b/test/cli/run/require-and-import-trailing.test.ts
index 847756cacc..8b592ee7b1 100644
--- a/test/cli/run/require-and-import-trailing.test.ts
+++ b/test/cli/run/require-and-import-trailing.test.ts
@@ -1,6 +1,5 @@
-import { test, expect, describe } from "bun:test";
-import { bunEnv, bunExe, isWindows, tempDirWithFiles } from "harness";
-import { join } from "path";
+import { expect, test } from "bun:test";
+import { tempDirWithFiles } from "harness";
test("require() with trailing slash", () => {
const requireDir = tempDirWithFiles("require-trailing", {
diff --git a/test/cli/run/require-cache.test.ts b/test/cli/run/require-cache.test.ts
index b897e49832..9de45782b9 100644
--- a/test/cli/run/require-cache.test.ts
+++ b/test/cli/run/require-cache.test.ts
@@ -1,4 +1,4 @@
-import { test, expect, describe } from "bun:test";
+import { describe, expect, test } from "bun:test";
import { bunEnv, bunExe, isWindows, tempDirWithFiles } from "harness";
import { join } from "path";
diff --git a/test/cli/run/run-crash-handler.test.ts b/test/cli/run/run-crash-handler.test.ts
index 3baf18539f..7213cee4cc 100644
--- a/test/cli/run/run-crash-handler.test.ts
+++ b/test/cli/run/run-crash-handler.test.ts
@@ -1,7 +1,6 @@
import { crash_handler } from "bun:internal-for-testing";
-import { test, expect, describe } from "bun:test";
-import { bunExe, bunEnv, tempDirWithFiles, mergeWindowEnvs } from "harness";
-import { existsSync } from "node:fs";
+import { describe, expect, test } from "bun:test";
+import { bunEnv, bunExe, mergeWindowEnvs } from "harness";
import path from "path";
const { getMachOImageZeroOffset } = crash_handler;
diff --git a/test/cli/run/run-eval.test.ts b/test/cli/run/run-eval.test.ts
index b4631edce2..23294d4223 100644
--- a/test/cli/run/run-eval.test.ts
+++ b/test/cli/run/run-eval.test.ts
@@ -1,9 +1,9 @@
-import { SpawnOptions, Subprocess, SyncSubprocess } from "bun";
+import { SyncSubprocess } from "bun";
import { describe, expect, test } from "bun:test";
-import { writeFileSync, rmSync } from "fs";
+import { rmSync, writeFileSync } from "fs";
import { bunEnv, bunExe, tmpdirSync } from "harness";
import { tmpdir } from "os";
-import { join, sep, posix } from "path";
+import { join, sep } from "path";
for (const flag of ["-e", "--print"]) {
describe(`bun ${flag}`, () => {
diff --git a/test/cli/run/run-extensionless.test.ts b/test/cli/run/run-extensionless.test.ts
index 4881a58382..3163c258e4 100644
--- a/test/cli/run/run-extensionless.test.ts
+++ b/test/cli/run/run-extensionless.test.ts
@@ -1,7 +1,6 @@
import { expect, test } from "bun:test";
-import { mkdirSync } from "fs";
+import { mkdirSync, writeFileSync } from "fs";
import { bunEnv, bunExe, isWindows, tmpdirSync } from "harness";
-import { writeFileSync } from "fs";
import { join } from "path";
test("running extensionless file works", async () => {
diff --git a/test/cli/run/run-importmetamain.ts b/test/cli/run/run-importmetamain.ts
index e56414b366..877f4ac56d 100644
--- a/test/cli/run/run-importmetamain.ts
+++ b/test/cli/run/run-importmetamain.ts
@@ -6,39 +6,33 @@ import { join } from "path";
test("import.meta.main", async () => {
const dir = tmpdirSync();
mkdirSync(dir, { recursive: true });
- await Bun.write(join(dir, "index1.js"), `import "fs"; console.log(JSON.stringify([typeof require, import.meta.main, !import.meta.main, require.main === module, require.main !== module]));`);
+ await Bun.write(
+ join(dir, "index1.js"),
+ `import "fs"; console.log(JSON.stringify([typeof require, import.meta.main, !import.meta.main, require.main === module, require.main !== module]));`,
+ );
const { stdout } = Bun.spawnSync({
cmd: [bunExe(), join(dir, "index1.js")],
cwd: dir,
env: bunEnv,
- stderr: 'inherit',
- stdout: 'pipe',
+ stderr: "inherit",
+ stdout: "pipe",
});
- expect(stdout.toString("utf8").trim()).toEqual(JSON.stringify([
- "function",
- true,
- false,
- true,
- false,
- ]));
+ expect(stdout.toString("utf8").trim()).toEqual(JSON.stringify(["function", true, false, true, false]));
});
test("import.meta.main in a common.js file", async () => {
const dir = tmpdirSync();
mkdirSync(dir, { recursive: true });
- await Bun.write(join(dir, "index1.js"), `module.exports = {}; console.log(JSON.stringify([typeof require, import.meta.main, !import.meta.main, require.main === module, require.main !== module]));`);
+ await Bun.write(
+ join(dir, "index1.js"),
+ `module.exports = {}; console.log(JSON.stringify([typeof require, import.meta.main, !import.meta.main, require.main === module, require.main !== module]));`,
+ );
const { stdout } = Bun.spawnSync({
cmd: [bunExe(), join(dir, "index1.js")],
cwd: dir,
env: bunEnv,
- stderr: 'inherit',
- stdout: 'pipe',
+ stderr: "inherit",
+ stdout: "pipe",
});
- expect(stdout.toString("utf8").trim()).toEqual(JSON.stringify([
- "function",
- true,
- false,
- true,
- false,
- ]));
+ expect(stdout.toString("utf8").trim()).toEqual(JSON.stringify(["function", true, false, true, false]));
});
diff --git a/test/cli/run/run_command.test.ts b/test/cli/run/run_command.test.ts
index 7f63e1f47f..2c036b55bb 100644
--- a/test/cli/run/run_command.test.ts
+++ b/test/cli/run/run_command.test.ts
@@ -1,7 +1,7 @@
-import { describe, test, expect } from "bun:test";
import { spawnSync } from "bun";
+import { describe, expect, test } from "bun:test";
+import { rmSync, writeFileSync } from "fs";
import { bunEnv, bunExe, bunRun, isWindows } from "harness";
-import { writeFileSync, rmSync } from "fs";
let cwd: string;
diff --git a/test/cli/run/transpiler-cache.test.ts b/test/cli/run/transpiler-cache.test.ts
index 133946b3ff..9a4d7c6a43 100644
--- a/test/cli/run/transpiler-cache.test.ts
+++ b/test/cli/run/transpiler-cache.test.ts
@@ -1,8 +1,7 @@
import { Subprocess } from "bun";
import { beforeEach, describe, expect, test } from "bun:test";
-import { realpathSync, chmodSync, existsSync, mkdirSync, readdirSync, rmSync, writeFileSync } from "fs";
+import { chmodSync, existsSync, mkdirSync, readdirSync, realpathSync, rmSync, writeFileSync } from "fs";
import { bunEnv, bunExe, bunRun, tmpdirSync } from "harness";
-import { tmpdir } from "os";
import { join } from "path";
function dummyFile(size: number, cache_bust: string, value: string | { code: string }) {
diff --git a/test/cli/test/bun-test.test.ts b/test/cli/test/bun-test.test.ts
index 908da6f667..71400823a9 100644
--- a/test/cli/test/bun-test.test.ts
+++ b/test/cli/test/bun-test.test.ts
@@ -1,9 +1,8 @@
-import { join, resolve, dirname } from "node:path";
-import { tmpdir } from "node:os";
-import { writeFileSync, rmSync, mkdirSync, realpathSync } from "node:fs";
import { spawnSync } from "bun";
-import { describe, test, expect } from "bun:test";
-import { bunExe, bunEnv, tmpdirSync } from "harness";
+import { describe, expect, test } from "bun:test";
+import { bunEnv, bunExe, tmpdirSync } from "harness";
+import { mkdirSync, rmSync, writeFileSync } from "node:fs";
+import { dirname, join, resolve } from "node:path";
describe("bun test", () => {
test("can provide no arguments", () => {
diff --git a/test/cli/test/coverage.test.ts b/test/cli/test/coverage.test.ts
index c598cc7269..40f8db3dc7 100644
--- a/test/cli/test/coverage.test.ts
+++ b/test/cli/test/coverage.test.ts
@@ -1,7 +1,7 @@
-import { test, expect } from "bun:test";
-import { tempDirWithFiles, bunExe, bunEnv } from "harness";
-import path from "path";
+import { expect, test } from "bun:test";
+import { bunEnv, bunExe, tempDirWithFiles } from "harness";
import { readFileSync } from "node:fs";
+import path from "path";
test("coverage crash", () => {
const dir = tempDirWithFiles("cov", {
diff --git a/test/cli/watch/watch.test.ts b/test/cli/watch/watch.test.ts
index b96456883c..01ef6d03dd 100644
--- a/test/cli/watch/watch.test.ts
+++ b/test/cli/watch/watch.test.ts
@@ -1,9 +1,9 @@
-import { it, expect, afterEach } from "bun:test";
import type { Subprocess } from "bun";
import { spawn } from "bun";
+import { afterEach, expect, it } from "bun:test";
+import { bunEnv, bunExe, tmpdirSync } from "harness";
+import { rmSync } from "node:fs";
import { join } from "node:path";
-import { writeFileSync, rmSync } from "node:fs";
-import { bunExe, bunEnv, tmpdirSync } from "harness";
let watchee: Subprocess;
diff --git a/test/harness.ts b/test/harness.ts
index 6049c09441..cf508d431f 100644
--- a/test/harness.ts
+++ b/test/harness.ts
@@ -1,10 +1,10 @@
import { gc as bunGC, spawnSync, unsafe, which } from "bun";
-import { describe, test, expect, afterAll, beforeAll } from "bun:test";
-import { readlink, readFile, writeFile } from "fs/promises";
-import { isAbsolute, join, dirname } from "path";
-import fs, { openSync, closeSync } from "node:fs";
-import os from "node:os";
import { heapStats } from "bun:jsc";
+import { afterAll, beforeAll, describe, expect, test } from "bun:test";
+import { readFile, readlink, writeFile } from "fs/promises";
+import fs, { closeSync, openSync } from "node:fs";
+import os from "node:os";
+import { dirname, isAbsolute, join } from "path";
type Awaitable = T | Promise;
diff --git a/test/integration/esbuild/esbuild.test.ts b/test/integration/esbuild/esbuild.test.ts
index 9c6f172f50..74ce115609 100644
--- a/test/integration/esbuild/esbuild.test.ts
+++ b/test/integration/esbuild/esbuild.test.ts
@@ -1,8 +1,8 @@
-import { describe, expect, test, beforeAll, setDefaultTimeout } from "bun:test";
-import { rm, writeFile, cp } from "fs/promises";
+import { spawn } from "bun";
+import { beforeAll, describe, expect, setDefaultTimeout, test } from "bun:test";
+import { cp, rm, writeFile } from "fs/promises";
import { bunExe, bunEnv as env, tmpdirSync } from "harness";
import { join } from "path";
-import { spawn } from "bun";
beforeAll(() => {
setDefaultTimeout(1000 * 60 * 5);
diff --git a/test/integration/expo-app/app/(tabs)/_layout.tsx b/test/integration/expo-app/app/(tabs)/_layout.tsx
index 147b92e904..b890dd8240 100644
--- a/test/integration/expo-app/app/(tabs)/_layout.tsx
+++ b/test/integration/expo-app/app/(tabs)/_layout.tsx
@@ -1,5 +1,4 @@
import { Tabs } from "expo-router";
-import React from "react";
import { TabBarIcon } from "@/components/navigation/TabBarIcon";
import { Colors } from "@/constants/Colors";
diff --git a/test/integration/expo-app/app/(tabs)/explore.tsx b/test/integration/expo-app/app/(tabs)/explore.tsx
index 4fdec99152..1416505cbb 100644
--- a/test/integration/expo-app/app/(tabs)/explore.tsx
+++ b/test/integration/expo-app/app/(tabs)/explore.tsx
@@ -1,5 +1,5 @@
import Ionicons from "@expo/vector-icons/Ionicons";
-import { StyleSheet, Image, Platform } from "react-native";
+import { Image, Platform, StyleSheet } from "react-native";
import { Collapsible } from "@/components/Collapsible";
import { ExternalLink } from "@/components/ExternalLink";
diff --git a/test/integration/expo-app/app/(tabs)/index.tsx b/test/integration/expo-app/app/(tabs)/index.tsx
index bb95d9a5ea..b32d20fde7 100644
--- a/test/integration/expo-app/app/(tabs)/index.tsx
+++ b/test/integration/expo-app/app/(tabs)/index.tsx
@@ -1,4 +1,4 @@
-import { Image, StyleSheet, Platform } from "react-native";
+import { Image, Platform, StyleSheet } from "react-native";
import { HelloWave } from "@/components/HelloWave";
import ParallaxScrollView from "@/components/ParallaxScrollView";
diff --git a/test/integration/expo-app/components/HelloWave.tsx b/test/integration/expo-app/components/HelloWave.tsx
index e3efecbfbd..318cc2142b 100644
--- a/test/integration/expo-app/components/HelloWave.tsx
+++ b/test/integration/expo-app/components/HelloWave.tsx
@@ -1,10 +1,10 @@
import { StyleSheet } from "react-native";
import Animated, {
- useSharedValue,
useAnimatedStyle,
- withTiming,
+ useSharedValue,
withRepeat,
withSequence,
+ withTiming,
} from "react-native-reanimated";
import { ThemedText } from "@/components/ThemedText";
diff --git a/test/integration/expo-app/components/ThemedText.tsx b/test/integration/expo-app/components/ThemedText.tsx
index 201eeef3cb..11f2a5beda 100644
--- a/test/integration/expo-app/components/ThemedText.tsx
+++ b/test/integration/expo-app/components/ThemedText.tsx
@@ -1,4 +1,4 @@
-import { Text, type TextProps, StyleSheet } from "react-native";
+import { StyleSheet, Text, type TextProps } from "react-native";
import { useThemeColor } from "@/hooks/useThemeColor";
diff --git a/test/integration/expo-app/expo.test.ts b/test/integration/expo-app/expo.test.ts
index 64a9956093..656e5cd51b 100644
--- a/test/integration/expo-app/expo.test.ts
+++ b/test/integration/expo-app/expo.test.ts
@@ -1,6 +1,6 @@
-import { test, beforeAll, expect, setDefaultTimeout } from "bun:test";
+import { beforeAll, expect, setDefaultTimeout, test } from "bun:test";
import fs from "fs/promises";
-import { bunExe, bunEnv, tmpdirSync } from "../../harness";
+import { bunEnv, bunExe, tmpdirSync } from "../../harness";
const tmpdir = tmpdirSync();
diff --git a/test/integration/mysql2/mysql2.test.ts b/test/integration/mysql2/mysql2.test.ts
index cb0ef919f6..9c8c383612 100644
--- a/test/integration/mysql2/mysql2.test.ts
+++ b/test/integration/mysql2/mysql2.test.ts
@@ -1,4 +1,4 @@
-import { test, expect } from "bun:test";
+import { expect, test } from "bun:test";
import { describeWithContainer } from "harness";
import type { Connection, ConnectionOptions } from "mysql2/promise";
import { createConnection } from "mysql2/promise";
diff --git a/test/integration/next-pages/src/pages/_document.tsx b/test/integration/next-pages/src/pages/_document.tsx
index b2fff8b426..ffc3f3cccf 100644
--- a/test/integration/next-pages/src/pages/_document.tsx
+++ b/test/integration/next-pages/src/pages/_document.tsx
@@ -1,4 +1,4 @@
-import { Html, Head, Main, NextScript } from "next/document";
+import { Head, Html, Main, NextScript } from "next/document";
export default function Document() {
return (
diff --git a/test/integration/next-pages/src/pages/index.tsx b/test/integration/next-pages/src/pages/index.tsx
index b87da9145d..0bda34977a 100644
--- a/test/integration/next-pages/src/pages/index.tsx
+++ b/test/integration/next-pages/src/pages/index.tsx
@@ -1,7 +1,7 @@
-import Image from "next/image";
+import { Counter } from "@/Counter";
import { Inter } from "next/font/google";
import Head from "next/head";
-import { Counter } from "@/Counter";
+import Image from "next/image";
const inter = Inter({ subsets: ["latin"] });
diff --git a/test/integration/next-pages/test/dev-server-puppeteer.ts b/test/integration/next-pages/test/dev-server-puppeteer.ts
index dbba82224a..8fbe192450 100644
--- a/test/integration/next-pages/test/dev-server-puppeteer.ts
+++ b/test/integration/next-pages/test/dev-server-puppeteer.ts
@@ -1,7 +1,7 @@
-import { ConsoleMessage, Page, launch } from "puppeteer";
import assert from "assert";
import { copyFileSync } from "fs";
import { join } from "path";
+import { ConsoleMessage, Page, launch } from "puppeteer";
const root = join(import.meta.dir, "../");
diff --git a/test/integration/next-pages/test/dev-server-ssr-100.test.ts b/test/integration/next-pages/test/dev-server-ssr-100.test.ts
index cd204005da..269b88867d 100644
--- a/test/integration/next-pages/test/dev-server-ssr-100.test.ts
+++ b/test/integration/next-pages/test/dev-server-ssr-100.test.ts
@@ -1,11 +1,11 @@
-import { afterAll, beforeAll, describe, expect, test } from "bun:test";
-import { bunEnv, bunExe, tmpdirSync, toMatchNodeModulesAt } from "../../../harness";
import { Subprocess } from "bun";
-import { copyFileSync, rmSync } from "fs";
+import { install_test_helpers } from "bun:internal-for-testing";
+import { afterAll, beforeAll, expect, test } from "bun:test";
+import { copyFileSync } from "fs";
+import { cp, rm } from "fs/promises";
import { join } from "path";
import { StringDecoder } from "string_decoder";
-import { cp, rm } from "fs/promises";
-import { install_test_helpers } from "bun:internal-for-testing";
+import { bunEnv, bunExe, tmpdirSync, toMatchNodeModulesAt } from "../../../harness";
const { parseLockfile } = install_test_helpers;
expect.extend({ toMatchNodeModulesAt });
diff --git a/test/integration/next-pages/test/dev-server.test.ts b/test/integration/next-pages/test/dev-server.test.ts
index a0c669f1ef..ae7fadb38d 100644
--- a/test/integration/next-pages/test/dev-server.test.ts
+++ b/test/integration/next-pages/test/dev-server.test.ts
@@ -1,11 +1,11 @@
-import { afterAll, beforeAll, expect, test } from "bun:test";
-import { bunEnv, bunExe, isCI, isWindows, tmpdirSync, toMatchNodeModulesAt } from "../../../harness";
import { Subprocess } from "bun";
+import { install_test_helpers } from "bun:internal-for-testing";
+import { afterAll, beforeAll, expect, test } from "bun:test";
import { copyFileSync } from "fs";
+import { cp, rm } from "fs/promises";
import { join } from "path";
import { StringDecoder } from "string_decoder";
-import { cp, rm } from "fs/promises";
-import { install_test_helpers } from "bun:internal-for-testing";
+import { bunEnv, bunExe, isCI, isWindows, tmpdirSync, toMatchNodeModulesAt } from "../../../harness";
const { parseLockfile } = install_test_helpers;
expect.extend({ toMatchNodeModulesAt });
diff --git a/test/integration/next-pages/test/next-build.test.ts b/test/integration/next-pages/test/next-build.test.ts
index 901bf8d47f..a94e50dc5c 100644
--- a/test/integration/next-pages/test/next-build.test.ts
+++ b/test/integration/next-pages/test/next-build.test.ts
@@ -1,9 +1,9 @@
-import { expect, test } from "bun:test";
-import { bunEnv, bunExe, tmpdirSync, toMatchNodeModulesAt, isDebug } from "../../../harness";
-import { copyFileSync, cpSync, readFileSync, rmSync, promises as fs } from "fs";
-import { join } from "path";
-import { cp } from "fs/promises";
import { install_test_helpers } from "bun:internal-for-testing";
+import { expect, test } from "bun:test";
+import { copyFileSync, cpSync, promises as fs, readFileSync, rmSync } from "fs";
+import { cp } from "fs/promises";
+import { join } from "path";
+import { bunEnv, bunExe, isDebug, tmpdirSync, toMatchNodeModulesAt } from "../../../harness";
const { parseLockfile } = install_test_helpers;
expect.extend({ toMatchNodeModulesAt });
diff --git a/test/internal/highlighter.test.ts b/test/internal/highlighter.test.ts
index c2ae8201a0..e45e73ca9f 100644
--- a/test/internal/highlighter.test.ts
+++ b/test/internal/highlighter.test.ts
@@ -1,5 +1,5 @@
-import { test, expect } from "bun:test";
import { quickAndDirtyJavaScriptSyntaxHighlighter as highlighter } from "bun:internal-for-testing";
+import { expect, test } from "bun:test";
test("highlighter", () => {
expect(highlighter("`can do ${123} ${'123'} ${`123`}`").length).toBeLessThan(150);
diff --git a/test/internal/powershell-escape.test.ts b/test/internal/powershell-escape.test.ts
index 00657b0d50..e81c02ed3e 100644
--- a/test/internal/powershell-escape.test.ts
+++ b/test/internal/powershell-escape.test.ts
@@ -1,11 +1,10 @@
-
import { escapePowershell } from "bun:internal-for-testing";
it("powershell escaping rules", () => {
// This formatter does not include quotes around the string intentionally
expect(escapePowershell("foo")).toBe("foo");
expect(escapePowershell("foo bar")).toBe("foo bar");
- expect(escapePowershell("foo\" bar")).toBe("foo`\" bar");
- expect(escapePowershell("foo\" `bar")).toBe("foo`\" ``bar");
- expect(escapePowershell("foo\" ``\"bar")).toBe("foo`\" `````\"bar");
+ expect(escapePowershell('foo" bar')).toBe('foo`" bar');
+ expect(escapePowershell('foo" `bar')).toBe('foo`" ``bar');
+ expect(escapePowershell('foo" ``"bar')).toBe('foo`" `````"bar');
});
diff --git a/test/js/bun/console/console-iterator.test.ts b/test/js/bun/console/console-iterator.test.ts
index 48c8c418f1..5b93b8c202 100644
--- a/test/js/bun/console/console-iterator.test.ts
+++ b/test/js/bun/console/console-iterator.test.ts
@@ -1,4 +1,4 @@
-import { spawnSync, spawn } from "bun";
+import { spawn, spawnSync } from "bun";
import { describe, expect, it } from "bun:test";
import { bunEnv, bunExe } from "harness";
diff --git a/test/js/bun/console/console-table.test.ts b/test/js/bun/console/console-table.test.ts
index ca251c0024..22d780ac82 100644
--- a/test/js/bun/console/console-table.test.ts
+++ b/test/js/bun/console/console-table.test.ts
@@ -1,6 +1,6 @@
-import { describe, expect, test } from "bun:test";
import { spawnSync } from "bun";
-import { bunExe, bunEnv } from "harness";
+import { describe, expect, test } from "bun:test";
+import { bunEnv, bunExe } from "harness";
describe("console.table", () => {
test("throws when second arg is invalid", () => {
diff --git a/test/js/bun/crypto/cipheriv-decipheriv.test.ts b/test/js/bun/crypto/cipheriv-decipheriv.test.ts
index 0c220730c7..01d94a7b0b 100644
--- a/test/js/bun/crypto/cipheriv-decipheriv.test.ts
+++ b/test/js/bun/crypto/cipheriv-decipheriv.test.ts
@@ -1,5 +1,5 @@
-import { BinaryLike, DecipherGCM, CipherGCM, createCipheriv, createDecipheriv, randomBytes } from "crypto";
-import { it, expect } from "bun:test";
+import { expect, it } from "bun:test";
+import { BinaryLike, CipherGCM, createCipheriv, createDecipheriv, DecipherGCM, randomBytes } from "crypto";
/**
* Perform a sample encryption and decryption
diff --git a/test/js/bun/dns/resolve-dns.test.ts b/test/js/bun/dns/resolve-dns.test.ts
index 747a2aa3a2..85edc37130 100644
--- a/test/js/bun/dns/resolve-dns.test.ts
+++ b/test/js/bun/dns/resolve-dns.test.ts
@@ -1,5 +1,5 @@
import { SystemError, dns } from "bun";
-import { describe, expect, it, test } from "bun:test";
+import { describe, expect, test } from "bun:test";
import { withoutAggressiveGC } from "harness";
import { isIP, isIPv4, isIPv6 } from "node:net";
diff --git a/test/js/bun/ffi/ffi.test.js b/test/js/bun/ffi/ffi.test.js
index 459663804e..39782240bf 100644
--- a/test/js/bun/ffi/ffi.test.js
+++ b/test/js/bun/ffi/ffi.test.js
@@ -1,19 +1,19 @@
import { afterAll, describe, expect, it } from "bun:test";
import { existsSync } from "fs";
-import { platform } from "os";
import { isGlibcVersionAtLeast } from "harness";
+import { platform } from "os";
import {
+ dlopen as _dlopen,
CFunction,
CString,
- dlopen as _dlopen,
JSCallback,
ptr,
read,
+ suffix,
toArrayBuffer,
toBuffer,
viewSource,
- suffix,
} from "bun:ffi";
const dlopen = (...args) => {
diff --git a/test/js/bun/glob/leak.test.ts b/test/js/bun/glob/leak.test.ts
index 96db6523ee..7296e6f357 100644
--- a/test/js/bun/glob/leak.test.ts
+++ b/test/js/bun/glob/leak.test.ts
@@ -1,5 +1,4 @@
-import { expect, test, describe, beforeAll, afterAll } from "bun:test";
-import { Glob, GlobScanOptions } from "bun";
+import { describe, expect, test } from "bun:test";
describe("leaks", () => {
const bun = process.argv[0];
diff --git a/test/js/bun/glob/match.test.ts b/test/js/bun/glob/match.test.ts
index d3925990b2..c09f8b7cd0 100644
--- a/test/js/bun/glob/match.test.ts
+++ b/test/js/bun/glob/match.test.ts
@@ -22,8 +22,8 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
-import { expect, test, describe } from "bun:test";
import { Glob } from "bun";
+import { describe, expect, test } from "bun:test";
describe("Glob.match", () => {
test("single wildcard", () => {
diff --git a/test/js/bun/glob/scan.test.ts b/test/js/bun/glob/scan.test.ts
index 66f41b8e67..db92acf36b 100644
--- a/test/js/bun/glob/scan.test.ts
+++ b/test/js/bun/glob/scan.test.ts
@@ -23,11 +23,10 @@
import { Glob, GlobScanOptions } from "bun";
import { afterAll, beforeAll, describe, expect, test } from "bun:test";
import fg from "fast-glob";
-import * as path from "path";
-import { tempFixturesDir, createTempDirectoryWithBrokenSymlinks, prepareEntries } from "./util";
import { tempDirWithFiles, tmpdirSync } from "harness";
-import * as os from "node:os";
import * as fs from "node:fs";
+import * as path from "path";
+import { createTempDirectoryWithBrokenSymlinks, prepareEntries, tempFixturesDir } from "./util";
let origAggressiveGC = Bun.unsafe.gcAggressionLevel();
let tempBrokenSymlinksDir: string;
diff --git a/test/js/bun/glob/stress.test.ts b/test/js/bun/glob/stress.test.ts
index 43be74444f..7fdde0819a 100644
--- a/test/js/bun/glob/stress.test.ts
+++ b/test/js/bun/glob/stress.test.ts
@@ -1,7 +1,7 @@
-import { expect, test, describe, beforeAll } from "bun:test";
import { Glob } from "bun";
-import { tempFixturesDir } from "./util";
+import { beforeAll, test } from "bun:test";
import path from "path";
+import { tempFixturesDir } from "./util";
const paths = [
path.join(import.meta.dir, "fixtures/file.md"),
path.join(import.meta.dir, "fixtures/second/file.md"),
diff --git a/test/js/bun/glob/util.ts b/test/js/bun/glob/util.ts
index 3fac0f7b06..48ae7d4789 100644
--- a/test/js/bun/glob/util.ts
+++ b/test/js/bun/glob/util.ts
@@ -1,6 +1,6 @@
import { symlinkSync } from "fs";
-import path from "path";
import { tmpdirSync } from "harness";
+import path from "path";
export function createTempDirectoryWithBrokenSymlinks() {
// Create a temporary directory
diff --git a/test/js/bun/globals.test.js b/test/js/bun/globals.test.js
index 616842c147..554f9d7b42 100644
--- a/test/js/bun/globals.test.js
+++ b/test/js/bun/globals.test.js
@@ -1,4 +1,4 @@
-import { expect, it, describe } from "bun:test";
+import { describe, expect, it } from "bun:test";
import { bunEnv, bunExe } from "harness";
import path from "path";
diff --git a/test/js/bun/http/async-iterator-stream.test.ts b/test/js/bun/http/async-iterator-stream.test.ts
index e2784d8eb6..c247055f50 100644
--- a/test/js/bun/http/async-iterator-stream.test.ts
+++ b/test/js/bun/http/async-iterator-stream.test.ts
@@ -1,6 +1,6 @@
-import { describe, expect, test, afterAll, mock } from "bun:test";
import { spawn } from "bun";
-import { bunExe, bunEnv } from "harness";
+import { afterAll, describe, expect, mock, test } from "bun:test";
+import { bunEnv, bunExe } from "harness";
describe("Streaming body via", () => {
test("async generator function", async () => {
diff --git a/test/js/bun/http/bun-serve-body-json-async.test.ts b/test/js/bun/http/bun-serve-body-json-async.test.ts
index feef851d69..4bdccc906e 100644
--- a/test/js/bun/http/bun-serve-body-json-async.test.ts
+++ b/test/js/bun/http/bun-serve-body-json-async.test.ts
@@ -1,5 +1,4 @@
-import { serve, sleep, $ } from "bun";
-import { test, expect } from "bun:test";
+import { expect, test } from "bun:test";
import { bunEnv, bunExe } from "harness";
import { join } from "path";
diff --git a/test/js/bun/http/bun-serve-headers.test.ts b/test/js/bun/http/bun-serve-headers.test.ts
index e5b340cab2..9fa8902d86 100644
--- a/test/js/bun/http/bun-serve-headers.test.ts
+++ b/test/js/bun/http/bun-serve-headers.test.ts
@@ -1,4 +1,4 @@
-import { test, expect } from "bun:test";
+import { expect, test } from "bun:test";
// https://github.com/oven-sh/bun/issues/9180
test("weird headers", async () => {
diff --git a/test/js/bun/http/bun-serve-propagate-errors.test.ts b/test/js/bun/http/bun-serve-propagate-errors.test.ts
index e64d8da94e..88b6ef5ecc 100644
--- a/test/js/bun/http/bun-serve-propagate-errors.test.ts
+++ b/test/js/bun/http/bun-serve-propagate-errors.test.ts
@@ -1,5 +1,5 @@
import { spawnSync } from "bun";
-import { test, expect } from "bun:test";
+import { expect, test } from "bun:test";
import { bunEnv, bunExe, tempDirWithFiles } from "harness";
test("Bun.serve() propagates errors to the parent fixture", async () => {
diff --git a/test/js/bun/http/bun-serve-static.test.ts b/test/js/bun/http/bun-serve-static.test.ts
index 9ad9a2ca8a..012baef2a5 100644
--- a/test/js/bun/http/bun-serve-static.test.ts
+++ b/test/js/bun/http/bun-serve-static.test.ts
@@ -1,5 +1,4 @@
-import { test, expect, mock, beforeAll, describe, afterAll, it } from "bun:test";
-import { server } from "bun";
+import { afterAll, beforeAll, describe, expect, it, mock } from "bun:test";
import { fillRepeating, isWindows } from "harness";
const routes = {
diff --git a/test/js/bun/http/bun-server.test.ts b/test/js/bun/http/bun-server.test.ts
index 2f9b2e64a5..90b6968985 100644
--- a/test/js/bun/http/bun-server.test.ts
+++ b/test/js/bun/http/bun-server.test.ts
@@ -1,6 +1,6 @@
-import type { ServerWebSocket, Server, Socket } from "bun";
+import type { Server, ServerWebSocket, Socket } from "bun";
import { describe, expect, test } from "bun:test";
-import { bunExe, bunEnv, rejectUnauthorizedScope } from "harness";
+import { bunEnv, bunExe, rejectUnauthorizedScope } from "harness";
import path from "path";
describe("Server", () => {
diff --git a/test/js/bun/http/js-sink-sourmap-fixture/chunks/stream.mjs b/test/js/bun/http/js-sink-sourmap-fixture/chunks/stream.mjs
index 9b2d87af4e..063f4ab469 100644
--- a/test/js/bun/http/js-sink-sourmap-fixture/chunks/stream.mjs
+++ b/test/js/bun/http/js-sink-sourmap-fixture/chunks/stream.mjs
@@ -1,9 +1,9 @@
-import { e as eventHandler } from "../index.mjs";
import "fs";
-import "path";
import "node:async_hooks";
import "node:fs";
import "node:url";
+import "path";
+import { e as eventHandler } from "../index.mjs";
const stream = eventHandler(() => {
const encoder = new TextEncoder();
diff --git a/test/js/bun/http/js-sink-sourmap-fixture/index.mjs b/test/js/bun/http/js-sink-sourmap-fixture/index.mjs
index 66a1f66267..11d5025db0 100644
--- a/test/js/bun/http/js-sink-sourmap-fixture/index.mjs
+++ b/test/js/bun/http/js-sink-sourmap-fixture/index.mjs
@@ -1,9 +1,9 @@
globalThis._importMeta_ = { url: import.meta.url, env: process.env };
-import { promises, existsSync } from "fs";
-import { dirname as dirname$1, resolve as resolve$1, join } from "path";
+import { existsSync, promises } from "fs";
import { AsyncLocalStorage } from "node:async_hooks";
import { promises as promises$1 } from "node:fs";
import { fileURLToPath } from "node:url";
+import { dirname as dirname$1, join, resolve as resolve$1 } from "path";
const HASH_RE = /#/g;
const AMPERSAND_RE = /&/g;
diff --git a/test/js/bun/http/leaks-test.test.ts b/test/js/bun/http/leaks-test.test.ts
index dc70bf978b..ac0a9fc664 100644
--- a/test/js/bun/http/leaks-test.test.ts
+++ b/test/js/bun/http/leaks-test.test.ts
@@ -1,4 +1,4 @@
-import { test, expect } from "bun:test";
+import { expect, test } from "bun:test";
import "harness";
import { join } from "path";
diff --git a/test/js/bun/http/proxy.test.js b/test/js/bun/http/proxy.test.js
index bcfe99508e..6faa0f4f07 100644
--- a/test/js/bun/http/proxy.test.js
+++ b/test/js/bun/http/proxy.test.js
@@ -1,9 +1,8 @@
-import { afterAll, beforeAll, describe, expect, it } from "bun:test";
-import { gc } from "harness";
+import { afterAll, beforeAll, expect, it } from "bun:test";
import fs from "fs";
+import { bunExe, gc } from "harness";
import { tmpdir } from "os";
import path from "path";
-import { bunExe } from "harness";
let proxy, auth_proxy, server;
beforeAll(() => {
diff --git a/test/js/bun/http/proxy.test.ts b/test/js/bun/http/proxy.test.ts
index c86cc804b4..4099f2d288 100644
--- a/test/js/bun/http/proxy.test.ts
+++ b/test/js/bun/http/proxy.test.ts
@@ -1,9 +1,9 @@
-import { describe, expect, test, beforeAll, afterAll } from "bun:test";
-import { once } from "node:events";
-import tls from "node:tls";
-import net from "node:net";
-import { tls as tlsCert } from "harness";
import type { Server } from "bun";
+import { afterAll, beforeAll, expect, test } from "bun:test";
+import { tls as tlsCert } from "harness";
+import { once } from "node:events";
+import net from "node:net";
+import tls from "node:tls";
async function createProxyServer(is_tls: boolean) {
const serverArgs = [];
if (is_tls) {
diff --git a/test/js/bun/http/serve-body-leak.test.ts b/test/js/bun/http/serve-body-leak.test.ts
index 9ef163aafb..64eab0bfb9 100644
--- a/test/js/bun/http/serve-body-leak.test.ts
+++ b/test/js/bun/http/serve-body-leak.test.ts
@@ -1,7 +1,7 @@
-import { join } from "path";
-import { it, expect, beforeAll, afterAll } from "bun:test";
-import { bunExe, bunEnv, isDebug } from "harness";
import type { Subprocess } from "bun";
+import { afterAll, beforeAll, expect, it } from "bun:test";
+import { bunEnv, bunExe, isDebug } from "harness";
+import { join } from "path";
const payload = Buffer.alloc(512 * 1024, "1").toString("utf-8"); // decent size payload to test memory leak
const batchSize = 40;
diff --git a/test/js/bun/http/serve-listen.test.ts b/test/js/bun/http/serve-listen.test.ts
index 031496710d..6402b78a0c 100644
--- a/test/js/bun/http/serve-listen.test.ts
+++ b/test/js/bun/http/serve-listen.test.ts
@@ -1,9 +1,9 @@
-import { describe, test, expect } from "bun:test";
import { file, serve } from "bun";
+import { describe, expect, test } from "bun:test";
+import { isWindows, tmpdirSync } from "harness";
import type { NetworkInterfaceInfo } from "node:os";
import { networkInterfaces } from "node:os";
import { join } from "node:path";
-import { isWindows, tmpdirSync } from "harness";
const networks = Object.values(networkInterfaces()).flat() as NetworkInterfaceInfo[];
const hasIPv4 = networks.some(({ family }) => family === "IPv4");
diff --git a/test/js/bun/http/serve.test.ts b/test/js/bun/http/serve.test.ts
index 807f3a2d62..8da36c9277 100644
--- a/test/js/bun/http/serve.test.ts
+++ b/test/js/bun/http/serve.test.ts
@@ -1,25 +1,14 @@
import { file, gc, Serve, serve, Server } from "bun";
-import { afterEach, describe, it, expect, afterAll, mock } from "bun:test";
+import { afterAll, afterEach, describe, expect, it, mock } from "bun:test";
import { readFileSync, writeFileSync } from "fs";
+import { bunEnv, bunExe, dumpStats, isIPv4, isIPv6, isPosix, tls, tmpdirSync } from "harness";
import { join, resolve } from "path";
-import {
- bunExe,
- bunEnv,
- dumpStats,
- isPosix,
- isIPv6,
- tmpdirSync,
- isIPv4,
- rejectUnauthorizedScope,
- tls,
- isWindows,
-} from "harness";
// import { renderToReadableStream } from "react-dom/server";
// import app_jsx from "./app.jsx";
-import { spawn } from "child_process";
-import { tmpdir } from "os";
import { heapStats } from "bun:jsc";
+import { spawn } from "child_process";
import net from "node:net";
+import { tmpdir } from "os";
let renderToReadableStream: any = null;
let app_jsx: any = null;
diff --git a/test/js/bun/http/server-bigfile-send.fixture.js b/test/js/bun/http/server-bigfile-send.fixture.js
index c1217c0a4f..265ab4a32d 100644
--- a/test/js/bun/http/server-bigfile-send.fixture.js
+++ b/test/js/bun/http/server-bigfile-send.fixture.js
@@ -1,4 +1,4 @@
-import { serve, file } from "bun";
+import { file, serve } from "bun";
import { join } from "node:path";
const bigfile = join(import.meta.dir, "../../web/encoding/utf8-encoding-fixture.bin");
const server = serve({
diff --git a/test/js/bun/ini/ini.test.ts b/test/js/bun/ini/ini.test.ts
index ed3f5b7197..7cb732829c 100644
--- a/test/js/bun/ini/ini.test.ts
+++ b/test/js/bun/ini/ini.test.ts
@@ -1,8 +1,7 @@
const { iniInternals } = require("bun:internal-for-testing");
const { parse } = iniInternals;
-import { join } from "path";
-import { expect, test, describe, it } from "bun:test";
-import { bunEnv, bunExe, isWindows, runWithErrorPromise, tempDirWithFiles, tmpdirSync } from "harness";
+import { describe, expect, it, test } from "bun:test";
+import { bunEnv, bunExe, tempDirWithFiles } from "harness";
describe("parse ini", () => {
test("weird section", () => {
diff --git a/test/js/bun/io/bun-write-leak.test.ts b/test/js/bun/io/bun-write-leak.test.ts
index f12c25c158..f0b3b5551a 100644
--- a/test/js/bun/io/bun-write-leak.test.ts
+++ b/test/js/bun/io/bun-write-leak.test.ts
@@ -1,4 +1,4 @@
-import { test, expect, describe } from "bun:test";
+import { expect, test } from "bun:test";
import path from "node:path";
import "harness";
diff --git a/test/js/bun/io/bun-write.test.js b/test/js/bun/io/bun-write.test.js
index 80c54d1867..18a744c336 100644
--- a/test/js/bun/io/bun-write.test.js
+++ b/test/js/bun/io/bun-write.test.js
@@ -1,8 +1,8 @@
+import { describe, expect, it, test } from "bun:test";
import fs, { mkdirSync } from "fs";
-import { it, expect, describe, test } from "bun:test";
-import path, { join } from "path";
-import { gcTick, withoutAggressiveGC, bunExe, bunEnv, isWindows } from "harness";
+import { bunEnv, bunExe, gcTick, isWindows, withoutAggressiveGC } from "harness";
import { tmpdir } from "os";
+import path, { join } from "path";
const tmpbase = tmpdir() + path.sep;
const IS_UV_FS_COPYFILE_DISABLED =
diff --git a/test/js/bun/jsc/bun-jsc.test.ts b/test/js/bun/jsc/bun-jsc.test.ts
index 4d6a72e7fd..f43aca7404 100644
--- a/test/js/bun/jsc/bun-jsc.test.ts
+++ b/test/js/bun/jsc/bun-jsc.test.ts
@@ -1,32 +1,29 @@
-import { describe, expect, it } from "bun:test";
import {
- describe as jscDescribe,
+ callerSourceOrigin,
describeArray,
- serialize,
deserialize,
- gcAndSweep,
- fullGC,
+ drainMicrotasks,
edenGC,
+ fullGC,
+ gcAndSweep,
+ getProtectedObjects,
+ getRandomSeed,
heapSize,
heapStats,
- memoryUsage,
- getRandomSeed,
- setRandomSeed,
isRope,
- callerSourceOrigin,
- noFTL,
- noOSRExitFuzzing,
- optimizeNextInvocation,
+ describe as jscDescribe,
+ memoryUsage,
numberOfDFGCompiles,
- releaseWeakRefs,
- totalCompileTime,
- getProtectedObjects,
- reoptimizationRetryCount,
- drainMicrotasks,
- startRemoteDebugger,
- setTimeZone,
+ optimizeNextInvocation,
profile,
+ releaseWeakRefs,
+ reoptimizationRetryCount,
+ serialize,
+ setRandomSeed,
+ setTimeZone,
+ totalCompileTime,
} from "bun:jsc";
+import { describe, expect, it } from "bun:test";
import { isBuildKite, isWindows } from "harness";
describe("bun:jsc", () => {
diff --git a/test/js/bun/jsc/domjit.test.ts b/test/js/bun/jsc/domjit.test.ts
index 6e396f0b89..f26cd5ec87 100644
--- a/test/js/bun/jsc/domjit.test.ts
+++ b/test/js/bun/jsc/domjit.test.ts
@@ -1,10 +1,10 @@
// test functions that use DOMJIT
-import { describe, test, expect } from "bun:test";
+import { describe, expect, test } from "bun:test";
+import { ptr, read } from "bun:ffi";
import crypto from "crypto";
import { statSync } from "fs";
-import { read, ptr } from "bun:ffi";
import vm from "node:vm";
const dirStats = statSync(import.meta.dir);
diff --git a/test/js/bun/jsc/shadow.test.js b/test/js/bun/jsc/shadow.test.js
index 3fffcac902..3fdca53914 100644
--- a/test/js/bun/jsc/shadow.test.js
+++ b/test/js/bun/jsc/shadow.test.js
@@ -1,4 +1,4 @@
-import { describe, it, expect } from "bun:test";
+import { expect, it } from "bun:test";
it("shadow realm works", () => {
const red = new ShadowRealm();
diff --git a/test/js/bun/net/connect-returns-socket-unix.js b/test/js/bun/net/connect-returns-socket-unix.js
index 1c6c805458..6b1e431907 100644
--- a/test/js/bun/net/connect-returns-socket-unix.js
+++ b/test/js/bun/net/connect-returns-socket-unix.js
@@ -1,4 +1,3 @@
-import fs from "fs";
import os from "os";
let resolve;
diff --git a/test/js/bun/net/socket-leak-fixture.js b/test/js/bun/net/socket-leak-fixture.js
index 1a83cb2810..5182771c05 100644
--- a/test/js/bun/net/socket-leak-fixture.js
+++ b/test/js/bun/net/socket-leak-fixture.js
@@ -1,5 +1,5 @@
-import { openSync, closeSync } from "node:fs";
import { expect } from "bun:test";
+import { closeSync, openSync } from "node:fs";
const server = Bun.listen({
port: 0,
diff --git a/test/js/bun/net/socket.test.ts b/test/js/bun/net/socket.test.ts
index c1b42a7f4c..abe30419a1 100644
--- a/test/js/bun/net/socket.test.ts
+++ b/test/js/bun/net/socket.test.ts
@@ -1,7 +1,7 @@
+import type { Socket } from "bun";
+import { connect, fileURLToPath, SocketHandler, spawn } from "bun";
import { expect, it } from "bun:test";
import { bunEnv, bunExe, expectMaxObjectTypeCount, isWindows, tls } from "harness";
-import { connect, fileURLToPath, SocketHandler, spawn } from "bun";
-import type { Socket } from "bun";
it("should coerce '0' to 0", async () => {
const listener = Bun.listen({
// @ts-expect-error
diff --git a/test/js/bun/net/tcp-server.test.ts b/test/js/bun/net/tcp-server.test.ts
index 4af228559f..c5a2edf5da 100644
--- a/test/js/bun/net/tcp-server.test.ts
+++ b/test/js/bun/net/tcp-server.test.ts
@@ -1,4 +1,4 @@
-import { listen, connect, TCPSocketListener, SocketHandler } from "bun";
+import { connect, listen, SocketHandler, TCPSocketListener } from "bun";
import { describe, expect, it } from "bun:test";
import { expectMaxObjectTypeCount } from "harness";
diff --git a/test/js/bun/patch/patch.test.ts b/test/js/bun/patch/patch.test.ts
index e11c1f076e..2a0afdbca3 100644
--- a/test/js/bun/patch/patch.test.ts
+++ b/test/js/bun/patch/patch.test.ts
@@ -1,9 +1,9 @@
import { $ } from "bun";
-import { describe, test, expect, it } from "bun:test";
import { patchInternals } from "bun:internal-for-testing";
+import { describe, expect, test } from "bun:test";
+import fs from "fs/promises";
import { tempDirWithFiles as __tempDirWithFiles } from "harness";
import { join as __join } from "node:path";
-import fs from "fs/promises";
const { parse, apply, makeDiff } = patchInternals;
const makeDiffJs = async (aFolder: string, bFolder: string, cwd: string): Promise => {
diff --git a/test/js/bun/plugin/plugins.test.ts b/test/js/bun/plugin/plugins.test.ts
index 50da7df730..1b2013c534 100644
--- a/test/js/bun/plugin/plugins.test.ts
+++ b/test/js/bun/plugin/plugins.test.ts
@@ -1,7 +1,7 @@
///
import { plugin } from "bun";
import { describe, expect, it } from "bun:test";
-import { resolve, dirname } from "path";
+import { resolve } from "path";
declare global {
var failingObject: any;
diff --git a/test/js/bun/resolve/esModule-annotation.test.js b/test/js/bun/resolve/esModule-annotation.test.js
index 33c84be5d5..bb7b8a6861 100644
--- a/test/js/bun/resolve/esModule-annotation.test.js
+++ b/test/js/bun/resolve/esModule-annotation.test.js
@@ -1,4 +1,4 @@
-import { test, expect, describe } from "bun:test";
+import { describe, expect, test } from "bun:test";
import * as WithTypeModuleExportEsModuleAnnotationMissingDefault from "./with-type-module/export-esModule-annotation-empty.cjs";
import * as WithTypeModuleExportEsModuleAnnotationNoDefault from "./with-type-module/export-esModule-annotation-no-default.cjs";
import * as WithTypeModuleExportEsModuleAnnotation from "./with-type-module/export-esModule-annotation.cjs";
diff --git a/test/js/bun/resolve/import-custom-condition.test.ts b/test/js/bun/resolve/import-custom-condition.test.ts
index 77b4110980..350f0665ec 100644
--- a/test/js/bun/resolve/import-custom-condition.test.ts
+++ b/test/js/bun/resolve/import-custom-condition.test.ts
@@ -1,6 +1,6 @@
-import { it, expect, beforeAll } from "bun:test";
+import { beforeAll, expect, it } from "bun:test";
import { writeFileSync } from "fs";
-import { bunExe, bunEnv, tempDirWithFiles } from "harness";
+import { bunEnv, bunExe, tempDirWithFiles } from "harness";
let dir: string;
diff --git a/test/js/bun/resolve/import-meta.test.js b/test/js/bun/resolve/import-meta.test.js
index bbd4e7dca9..668e3ca8e9 100644
--- a/test/js/bun/resolve/import-meta.test.js
+++ b/test/js/bun/resolve/import-meta.test.js
@@ -1,11 +1,11 @@
import { spawnSync } from "bun";
-import { describe, expect, it } from "bun:test";
+import { expect, it } from "bun:test";
import { bunEnv, bunExe, ospath } from "harness";
import { mkdirSync, rmSync, writeFileSync } from "node:fs";
import * as Module from "node:module";
+import { tmpdir } from "node:os";
import { join, sep } from "node:path";
import sync from "./require-json.json";
-import { tmpdir } from "node:os";
const { path, dir, dirname, filename } = import.meta;
diff --git a/test/js/bun/resolve/import-require-tla.js b/test/js/bun/resolve/import-require-tla.js
index 732fc34dd6..55cad59d22 100644
--- a/test/js/bun/resolve/import-require-tla.js
+++ b/test/js/bun/resolve/import-require-tla.js
@@ -1,3 +1,4 @@
+// organize-imports-ignore
const Fs = require("fs");
const DirEnt = Fs.Dirent;
diff --git a/test/js/bun/resolve/import.live.rexport-require.js b/test/js/bun/resolve/import.live.rexport-require.js
index 10c993e089..fbef4687db 100644
--- a/test/js/bun/resolve/import.live.rexport-require.js
+++ b/test/js/bun/resolve/import.live.rexport-require.js
@@ -1 +1,2 @@
+// organize-imports-ignore
export const Namespace = import.meta.require("./import.live.decl.js");
diff --git a/test/js/bun/resolve/import.live.rexport.js b/test/js/bun/resolve/import.live.rexport.js
index 6709c34660..0ad3868c36 100644
--- a/test/js/bun/resolve/import.live.rexport.js
+++ b/test/js/bun/resolve/import.live.rexport.js
@@ -1,2 +1,3 @@
+// organize-imports-ignore
export { foo, setFoo } from "./import.live.decl.js";
import { foo as bar } from "./import.live.decl.js";
diff --git a/test/js/bun/resolve/jsonc.test.ts b/test/js/bun/resolve/jsonc.test.ts
index 0004ec9755..d2571644c8 100644
--- a/test/js/bun/resolve/jsonc.test.ts
+++ b/test/js/bun/resolve/jsonc.test.ts
@@ -1,6 +1,6 @@
-import { test, expect } from "bun:test";
-import { join } from "path";
+import { expect, test } from "bun:test";
import { tempDirWithFiles } from "harness";
+import { join } from "path";
test("empty jsonc - package.json", async () => {
const dir = tempDirWithFiles("jsonc", {
"package.json": ``,
diff --git a/test/js/bun/resolve/load-file-loader-a-lot.test.ts b/test/js/bun/resolve/load-file-loader-a-lot.test.ts
index a640f34166..55beab120b 100644
--- a/test/js/bun/resolve/load-file-loader-a-lot.test.ts
+++ b/test/js/bun/resolve/load-file-loader-a-lot.test.ts
@@ -1,4 +1,4 @@
-import { test, expect } from "bun:test";
+import { test } from "bun:test";
test("a file: loader file can be imported 10,000 times", async () => {
const prev = Bun.unsafe.gcAggressionLevel();
diff --git a/test/js/bun/resolve/load-same-js-file-a-lot.test.ts b/test/js/bun/resolve/load-same-js-file-a-lot.test.ts
index 9f9d864373..face20c5c0 100644
--- a/test/js/bun/resolve/load-same-js-file-a-lot.test.ts
+++ b/test/js/bun/resolve/load-same-js-file-a-lot.test.ts
@@ -1,5 +1,4 @@
-import { test, expect } from "bun:test";
-import { withoutAggressiveGC } from "harness";
+import { expect, test } from "bun:test";
test("load the same file 10,000 times", async () => {
const meta = {
diff --git a/test/js/bun/resolve/non-english-import.test.js b/test/js/bun/resolve/non-english-import.test.js
index 9e58869bcf..cbe01da23a 100644
--- a/test/js/bun/resolve/non-english-import.test.js
+++ b/test/js/bun/resolve/non-english-import.test.js
@@ -1,6 +1,6 @@
// We do not make these files imports in the codebase because non-ascii file paths can cause issues with git
// Instead, we put them into a temporary directory and run them from there
-import { test, expect } from "bun:test";
+import { expect, test } from "bun:test";
import { bunEnv, bunExe } from "harness";
import { mkdirSync } from "node:fs";
import { tmpdir } from "node:os";
diff --git a/test/js/bun/resolve/resolve-error.test.ts b/test/js/bun/resolve/resolve-error.test.ts
index 124546a30c..513269e67f 100644
--- a/test/js/bun/resolve/resolve-error.test.ts
+++ b/test/js/bun/resolve/resolve-error.test.ts
@@ -1,4 +1,4 @@
-import { expect, it, describe } from "bun:test";
+import { describe, expect, it } from "bun:test";
describe("ResolveMessage", () => {
it("position object does not segfault", async () => {
diff --git a/test/js/bun/resolve/resolve-test.js b/test/js/bun/resolve/resolve-test.js
index 4bc86c1786..a5a8f94a17 100644
--- a/test/js/bun/resolve/resolve-test.js
+++ b/test/js/bun/resolve/resolve-test.js
@@ -1,5 +1,4 @@
-import { it, expect } from "bun:test";
-import { ospath } from "harness";
+import { expect, it } from "bun:test";
import { join, resolve } from "path";
function resolveFrom(from) {
diff --git a/test/js/bun/resolve/resolve-ts.test.ts b/test/js/bun/resolve/resolve-ts.test.ts
index 6c130a59eb..f0e121307b 100644
--- a/test/js/bun/resolve/resolve-ts.test.ts
+++ b/test/js/bun/resolve/resolve-ts.test.ts
@@ -1,4 +1,4 @@
-import { test, expect, describe } from "bun:test";
+import { describe, expect, test } from "bun:test";
import { bunEnv, bunExe, tempDirWithFiles } from "harness";
import * as Chooses from "./chooses-ts";
diff --git a/test/js/bun/resolve/resolve.test.ts b/test/js/bun/resolve/resolve.test.ts
index 1a46b049cd..6491d75c2a 100644
--- a/test/js/bun/resolve/resolve.test.ts
+++ b/test/js/bun/resolve/resolve.test.ts
@@ -1,9 +1,8 @@
-import { it, expect } from "bun:test";
-import { mkdirSync, writeFileSync } from "fs";
-import { join } from "path";
-import { bunExe, bunEnv, tempDirWithFiles } from "harness";
import { pathToFileURL } from "bun";
-import { sep } from "path";
+import { expect, it } from "bun:test";
+import { mkdirSync, writeFileSync } from "fs";
+import { bunEnv, bunExe, tempDirWithFiles } from "harness";
+import { join, sep } from "path";
it("spawn test file", () => {
writePackageJSONImportsFixture();
diff --git a/test/js/bun/resolve/second-child.mjs b/test/js/bun/resolve/second-child.mjs
index 5fb06ed452..6f99ac5fb1 100644
--- a/test/js/bun/resolve/second-child.mjs
+++ b/test/js/bun/resolve/second-child.mjs
@@ -1,4 +1,4 @@
-import { start, end } from "./startEnd.mjs";
+import { end, start } from "./startEnd.mjs";
start("Second (nested import)");
diff --git a/test/js/bun/resolve/second.mjs b/test/js/bun/resolve/second.mjs
index 888eb11b9f..479d652d14 100644
--- a/test/js/bun/resolve/second.mjs
+++ b/test/js/bun/resolve/second.mjs
@@ -1,4 +1,4 @@
-import { start, end } from "./startEnd.mjs";
+import { end, start } from "./startEnd.mjs";
start("Second");
diff --git a/test/js/bun/resolve/toml/toml.test.js b/test/js/bun/resolve/toml/toml.test.js
index feadea2078..d9fcaaaaf0 100644
--- a/test/js/bun/resolve/toml/toml.test.js
+++ b/test/js/bun/resolve/toml/toml.test.js
@@ -1,6 +1,6 @@
import { expect, it } from "bun:test";
-import tomlFromCustomTypeAttribute from "./toml-fixture.toml.txt" with { type: "toml" };
import emptyToml from "./toml-empty.toml";
+import tomlFromCustomTypeAttribute from "./toml-fixture.toml.txt" with { type: "toml" };
function checkToml(toml) {
expect(toml.framework).toBe("next");
diff --git a/test/js/bun/shell/brace.test.ts b/test/js/bun/shell/brace.test.ts
index 97a1c6429e..93788ba800 100644
--- a/test/js/bun/shell/brace.test.ts
+++ b/test/js/bun/shell/brace.test.ts
@@ -1,5 +1,5 @@
import { $ } from "bun";
-import { test, expect, describe } from "bun:test";
+import { describe, expect, test } from "bun:test";
describe("$.braces", () => {
test("no-op", () => {
diff --git a/test/js/bun/shell/bunshell-default.test.ts b/test/js/bun/shell/bunshell-default.test.ts
index 6266b603e8..6c5b6b9ce9 100644
--- a/test/js/bun/shell/bunshell-default.test.ts
+++ b/test/js/bun/shell/bunshell-default.test.ts
@@ -1,6 +1,5 @@
-import { $ } from "bun";
-import { bunExe, createTestBuilder } from "./test_builder";
import { bunEnv } from "harness";
+import { bunExe, createTestBuilder } from "./test_builder";
const TestBuilder = createTestBuilder(import.meta.path);
test("default throw on command failure", async () => {
diff --git a/test/js/bun/shell/bunshell-file.test.ts b/test/js/bun/shell/bunshell-file.test.ts
index 294259298b..0a0c264e09 100644
--- a/test/js/bun/shell/bunshell-file.test.ts
+++ b/test/js/bun/shell/bunshell-file.test.ts
@@ -1,5 +1,5 @@
import { $ } from "bun";
-import { test, expect } from "bun:test";
+import { expect, test } from "bun:test";
test("$ with Bun.file prints the path", async () => {
expect(await $`echo ${Bun.file(import.meta.path)}`.text()).toBe(`${import.meta.path}\n`);
diff --git a/test/js/bun/shell/bunshell-instance.test.ts b/test/js/bun/shell/bunshell-instance.test.ts
index 12f7ee2f76..553e7d86db 100644
--- a/test/js/bun/shell/bunshell-instance.test.ts
+++ b/test/js/bun/shell/bunshell-instance.test.ts
@@ -1,4 +1,4 @@
-import { test, expect, describe } from "bun:test";
+import { describe, expect, test } from "bun:test";
import { $ } from "bun";
diff --git a/test/js/bun/shell/bunshell.test.ts b/test/js/bun/shell/bunshell.test.ts
index bd9e174f27..31b59ffa41 100644
--- a/test/js/bun/shell/bunshell.test.ts
+++ b/test/js/bun/shell/bunshell.test.ts
@@ -7,7 +7,7 @@
import { $ } from "bun";
import { afterAll, beforeAll, describe, expect, test } from "bun:test";
import { mkdir, rm, stat } from "fs/promises";
-import { bunEnv as __bunEnv, bunExe, isWindows, runWithErrorPromise, tempDirWithFiles, tmpdirSync } from "harness";
+import { bunExe, isWindows, runWithErrorPromise, tempDirWithFiles, tmpdirSync } from "harness";
import { join, sep } from "path";
import { createTestBuilder, sortedShellOutput } from "./util";
const TestBuilder = createTestBuilder(import.meta.path);
diff --git a/test/js/bun/shell/commands/basename.test.ts b/test/js/bun/shell/commands/basename.test.ts
index 5ffe4f3ec7..3f4b95e507 100644
--- a/test/js/bun/shell/commands/basename.test.ts
+++ b/test/js/bun/shell/commands/basename.test.ts
@@ -1,5 +1,4 @@
-import { $ } from "bun";
-import { describe, test, expect } from "bun:test";
+import { describe } from "bun:test";
import { createTestBuilder } from "../test_builder";
const TestBuilder = createTestBuilder(import.meta.path);
diff --git a/test/js/bun/shell/commands/cp.test.ts b/test/js/bun/shell/commands/cp.test.ts
index 2c4a3e8429..500eb11bc7 100644
--- a/test/js/bun/shell/commands/cp.test.ts
+++ b/test/js/bun/shell/commands/cp.test.ts
@@ -1,10 +1,9 @@
import { $ } from "bun";
-import { bunExe, createTestBuilder } from "../test_builder";
-import { beforeAll, describe, test, expect, beforeEach } from "bun:test";
-import { sortedShellOutput } from "../util";
-import { tempDirWithFiles } from "harness";
-import fs from "fs";
import { shellInternals } from "bun:internal-for-testing";
+import { describe, expect } from "bun:test";
+import { tempDirWithFiles } from "harness";
+import { bunExe, createTestBuilder } from "../test_builder";
+import { sortedShellOutput } from "../util";
const { builtinDisabled } = shellInternals;
const TestBuilder = createTestBuilder(import.meta.path);
diff --git a/test/js/bun/shell/commands/dirname.test.ts b/test/js/bun/shell/commands/dirname.test.ts
index 4a2fe0d321..e10293795a 100644
--- a/test/js/bun/shell/commands/dirname.test.ts
+++ b/test/js/bun/shell/commands/dirname.test.ts
@@ -1,5 +1,4 @@
-import { $ } from "bun";
-import { describe, test, expect } from "bun:test";
+import { describe } from "bun:test";
import { createTestBuilder } from "../test_builder";
const TestBuilder = createTestBuilder(import.meta.path);
diff --git a/test/js/bun/shell/commands/exit.test.ts b/test/js/bun/shell/commands/exit.test.ts
index 5e757a9c80..5a3239d0f4 100644
--- a/test/js/bun/shell/commands/exit.test.ts
+++ b/test/js/bun/shell/commands/exit.test.ts
@@ -1,9 +1,6 @@
-import { $ } from "bun";
-import { describe, test, expect } from "bun:test";
+import { describe } from "bun:test";
import { createTestBuilder } from "../test_builder";
const TestBuilder = createTestBuilder(import.meta.path);
-import { sortedShellOutput } from "../util";
-import { join } from "path";
describe("exit", async () => {
TestBuilder.command`exit`.exitCode(0).runAsTest("works");
diff --git a/test/js/bun/shell/commands/false.test.ts b/test/js/bun/shell/commands/false.test.ts
index 785a495ee9..8513fb044d 100644
--- a/test/js/bun/shell/commands/false.test.ts
+++ b/test/js/bun/shell/commands/false.test.ts
@@ -1,5 +1,4 @@
-import { $ } from "bun";
-import { describe, test, expect } from "bun:test";
+import { describe } from "bun:test";
import { createTestBuilder } from "../test_builder";
const TestBuilder = createTestBuilder(import.meta.path);
diff --git a/test/js/bun/shell/commands/mv.test.ts b/test/js/bun/shell/commands/mv.test.ts
index 0a4fdec520..1a7236788f 100644
--- a/test/js/bun/shell/commands/mv.test.ts
+++ b/test/js/bun/shell/commands/mv.test.ts
@@ -1,9 +1,9 @@
import { $ } from "bun";
-import { describe, test, expect } from "bun:test";
-import { createTestBuilder } from "../test_builder";
-const TestBuilder = createTestBuilder(import.meta.path);
-import { sortedShellOutput } from "../util";
+import { describe, expect } from "bun:test";
import { join } from "path";
+import { createTestBuilder } from "../test_builder";
+import { sortedShellOutput } from "../util";
+const TestBuilder = createTestBuilder(import.meta.path);
$.nothrow();
diff --git a/test/js/bun/shell/commands/rm.test.ts b/test/js/bun/shell/commands/rm.test.ts
index df63993969..114b4a9ece 100644
--- a/test/js/bun/shell/commands/rm.test.ts
+++ b/test/js/bun/shell/commands/rm.test.ts
@@ -4,12 +4,11 @@
*
* This code is licensed under the MIT License: https://opensource.org/licenses/MIT
*/
-import { tempDirWithFiles } from "harness";
-import { describe, test, afterAll, beforeAll, expect, setDefaultTimeout } from "bun:test";
import { $ } from "bun";
-import path from "path";
+import { beforeAll, describe, expect, setDefaultTimeout, test } from "bun:test";
+import { tempDirWithFiles } from "harness";
import { mkdirSync, writeFileSync } from "node:fs";
-import { ShellOutput } from "bun";
+import path from "path";
import { createTestBuilder, sortedShellOutput } from "../util";
const TestBuilder = createTestBuilder(import.meta.path);
diff --git a/test/js/bun/shell/commands/seq.test.ts b/test/js/bun/shell/commands/seq.test.ts
index f728425123..87f11b15e5 100644
--- a/test/js/bun/shell/commands/seq.test.ts
+++ b/test/js/bun/shell/commands/seq.test.ts
@@ -1,4 +1,3 @@
-import { $ } from "bun";
import { describe } from "bun:test";
import { createTestBuilder } from "../test_builder";
const TestBuilder = createTestBuilder(import.meta.path);
diff --git a/test/js/bun/shell/commands/true.test.ts b/test/js/bun/shell/commands/true.test.ts
index 4dc491713e..a66fa9b27d 100644
--- a/test/js/bun/shell/commands/true.test.ts
+++ b/test/js/bun/shell/commands/true.test.ts
@@ -1,5 +1,4 @@
-import { $ } from "bun";
-import { describe, test, expect } from "bun:test";
+import { describe } from "bun:test";
import { createTestBuilder } from "../test_builder";
const TestBuilder = createTestBuilder(import.meta.path);
diff --git a/test/js/bun/shell/commands/which.test.ts b/test/js/bun/shell/commands/which.test.ts
index c613573a7b..7204936852 100644
--- a/test/js/bun/shell/commands/which.test.ts
+++ b/test/js/bun/shell/commands/which.test.ts
@@ -1,5 +1,5 @@
import { $ } from "bun";
-import { test, expect } from "bun:test";
+import { expect, test } from "bun:test";
test("which rlly long", async () => {
const longstr = "a".repeat(100000);
diff --git a/test/js/bun/shell/commands/yes.test.ts b/test/js/bun/shell/commands/yes.test.ts
index 69e31889d9..fb301a5b37 100644
--- a/test/js/bun/shell/commands/yes.test.ts
+++ b/test/js/bun/shell/commands/yes.test.ts
@@ -1,5 +1,5 @@
-import { $, ShellOutput } from "bun";
-import { describe, test, expect, beforeEach } from "bun:test";
+import { $ } from "bun";
+import { describe, expect, test } from "bun:test";
$.throws(false);
diff --git a/test/js/bun/shell/env.positionals.test.ts b/test/js/bun/shell/env.positionals.test.ts
index 93846badab..f122aa3415 100644
--- a/test/js/bun/shell/env.positionals.test.ts
+++ b/test/js/bun/shell/env.positionals.test.ts
@@ -1,9 +1,9 @@
import { $, spawn } from "bun";
-import { describe, test, expect } from "bun:test";
-import { createTestBuilder } from "./test_builder";
-const TestBuilder = createTestBuilder(import.meta.path);
+import { describe, expect, test } from "bun:test";
import { bunEnv, bunExe } from "harness";
import * as path from "node:path";
+import { createTestBuilder } from "./test_builder";
+const TestBuilder = createTestBuilder(import.meta.path);
$.nothrow();
describe("$ argv", async () => {
diff --git a/test/js/bun/shell/exec.test.ts b/test/js/bun/shell/exec.test.ts
index 6b71208b2f..be3a333c31 100644
--- a/test/js/bun/shell/exec.test.ts
+++ b/test/js/bun/shell/exec.test.ts
@@ -1,9 +1,9 @@
import { $ } from "bun";
-import { describe, test, expect } from "bun:test";
-import { createTestBuilder } from "./test_builder";
-const TestBuilder = createTestBuilder(import.meta.path);
+import { describe, expect, test } from "bun:test";
import { bunEnv, tmpdirSync } from "harness";
import { join } from "path";
+import { createTestBuilder } from "./test_builder";
+const TestBuilder = createTestBuilder(import.meta.path);
const BUN = process.argv0;
diff --git a/test/js/bun/shell/lazy.test.ts b/test/js/bun/shell/lazy.test.ts
index 20dd17382e..03dc9e3ce6 100644
--- a/test/js/bun/shell/lazy.test.ts
+++ b/test/js/bun/shell/lazy.test.ts
@@ -1,5 +1,5 @@
import { $ } from "bun";
-import { test, expect } from "bun:test";
+import { expect, test } from "bun:test";
import { tempDirWithFiles } from "harness";
import { rmSync } from "node:fs";
import { join } from "path";
diff --git a/test/js/bun/shell/leak.test.ts b/test/js/bun/shell/leak.test.ts
index 5d758eec7c..b63c3822eb 100644
--- a/test/js/bun/shell/leak.test.ts
+++ b/test/js/bun/shell/leak.test.ts
@@ -3,10 +3,10 @@ import { heapStats } from "bun:jsc";
import { describe, expect, test } from "bun:test";
import { bunEnv, tempDirWithFiles } from "harness";
import { appendFileSync, closeSync, openSync, writeFileSync } from "node:fs";
-import { tmpdir, devNull } from "os";
+import { devNull, tmpdir } from "os";
import { join } from "path";
-import { createTestBuilder } from "./util";
import { bunExe } from "./test_builder";
+import { createTestBuilder } from "./util";
const TestBuilder = createTestBuilder(import.meta.path);
type TestBuilder = InstanceType;
diff --git a/test/js/bun/shell/lex.test.ts b/test/js/bun/shell/lex.test.ts
index 3105139975..9fb79d60bc 100644
--- a/test/js/bun/shell/lex.test.ts
+++ b/test/js/bun/shell/lex.test.ts
@@ -1,6 +1,6 @@
import { $ } from "bun";
-import { createTestBuilder, redirect } from "./util";
import { shellInternals } from "bun:internal-for-testing";
+import { createTestBuilder, redirect } from "./util";
const { lex } = shellInternals;
const TestBuilder = createTestBuilder(import.meta.path);
diff --git a/test/js/bun/shell/parse.test.ts b/test/js/bun/shell/parse.test.ts
index 0f42686f68..a091858e9d 100644
--- a/test/js/bun/shell/parse.test.ts
+++ b/test/js/bun/shell/parse.test.ts
@@ -1,5 +1,5 @@
-import { createTestBuilder, redirect } from "./util";
import { shellInternals } from "bun:internal-for-testing";
+import { createTestBuilder, redirect } from "./util";
const { parse } = shellInternals;
const TestBuilder = createTestBuilder(import.meta.path);
diff --git a/test/js/bun/shell/shelloutput.test.ts b/test/js/bun/shell/shelloutput.test.ts
index 604be9b79b..29be7a8808 100644
--- a/test/js/bun/shell/shelloutput.test.ts
+++ b/test/js/bun/shell/shelloutput.test.ts
@@ -1,6 +1,5 @@
import { $, ShellError, ShellPromise } from "bun";
-import { beforeAll, describe, test, expect } from "bun:test";
-import { runWithErrorPromise } from "harness";
+import { describe, expect, test } from "bun:test";
describe("ShellOutput + ShellError", () => {
test("output", async () => {
diff --git a/test/js/bun/shell/test_builder.ts b/test/js/bun/shell/test_builder.ts
index 0b5d1ec93e..1efefa45d8 100644
--- a/test/js/bun/shell/test_builder.ts
+++ b/test/js/bun/shell/test_builder.ts
@@ -1,9 +1,8 @@
-import { ShellError, ShellOutput } from "bun";
-import { ShellPromise, ShellExpression } from "bun";
+import { ShellError, ShellExpression } from "bun";
// import { tempDirWithFiles } from "harness";
-import { join } from "node:path";
-import * as os from "node:os";
import * as fs from "node:fs";
+import * as os from "node:os";
+import { join } from "node:path";
// import { bunExe } from "harness";
export function createTestBuilder(path: string) {
diff --git a/test/js/bun/shell/throw.test.ts b/test/js/bun/shell/throw.test.ts
index e00351d39a..7e7461dcc6 100644
--- a/test/js/bun/shell/throw.test.ts
+++ b/test/js/bun/shell/throw.test.ts
@@ -1,5 +1,5 @@
import { $ } from "bun";
-import { beforeAll, describe, test, expect } from "bun:test";
+import { beforeAll, describe, expect, test } from "bun:test";
beforeAll(() => {
$.nothrow();
diff --git a/test/js/bun/shell/util.ts b/test/js/bun/shell/util.ts
index 08a632d9b2..b3fbf9ead4 100644
--- a/test/js/bun/shell/util.ts
+++ b/test/js/bun/shell/util.ts
@@ -1,9 +1,4 @@
-import { describe, test, afterAll, beforeAll, expect } from "bun:test";
-import { ShellOutput } from "bun";
-import { ShellPromise } from "bun";
-import { tempDirWithFiles } from "harness";
-import { join } from "node:path";
-import * as fs from "node:fs";
+import { ShellOutput, ShellPromise } from "bun";
import { createTestBuilder } from "./test_builder";
export { createTestBuilder };
diff --git a/test/js/bun/spawn/job-object-bug.test.ts b/test/js/bun/spawn/job-object-bug.test.ts
index 60ca62f938..1af00b501b 100644
--- a/test/js/bun/spawn/job-object-bug.test.ts
+++ b/test/js/bun/spawn/job-object-bug.test.ts
@@ -1,5 +1,5 @@
import { spawn } from "bun";
-import { it, expect } from "bun:test";
+import { expect, it } from "bun:test";
import { bunEnv, bunExe } from "harness";
import { join } from "node:path";
diff --git a/test/js/bun/spawn/spawn-empty-arrayBufferOrBlob.test.ts b/test/js/bun/spawn/spawn-empty-arrayBufferOrBlob.test.ts
index b7f8a45be4..831e871d5c 100644
--- a/test/js/bun/spawn/spawn-empty-arrayBufferOrBlob.test.ts
+++ b/test/js/bun/spawn/spawn-empty-arrayBufferOrBlob.test.ts
@@ -1,4 +1,4 @@
-import { describe, test, expect } from "bun:test";
+import { describe, expect, test } from "bun:test";
import { bunEnv, bunExe } from "harness";
describe("spawn with empty", () => {
diff --git a/test/js/bun/spawn/spawn-kill-signal.test.ts b/test/js/bun/spawn/spawn-kill-signal.test.ts
index 83f3ce7172..ba1bbcca02 100644
--- a/test/js/bun/spawn/spawn-kill-signal.test.ts
+++ b/test/js/bun/spawn/spawn-kill-signal.test.ts
@@ -1,4 +1,4 @@
-import { test, expect, describe } from "bun:test";
+import { describe, expect, test } from "bun:test";
import { shellExe } from "harness";
import { constants } from "os";
diff --git a/test/js/bun/spawn/spawn-stream-http-fixture.js b/test/js/bun/spawn/spawn-stream-http-fixture.js
index ba5d9b9359..6b0d893b16 100644
--- a/test/js/bun/spawn/spawn-stream-http-fixture.js
+++ b/test/js/bun/spawn/spawn-stream-http-fixture.js
@@ -1,4 +1,4 @@
-import { spawn, serve } from "bun";
+import { serve, spawn } from "bun";
const server = serve({
port: 0,
diff --git a/test/js/bun/spawn/spawn-stream-serve.test.ts b/test/js/bun/spawn/spawn-stream-serve.test.ts
index 897637c03e..cf98f7f627 100644
--- a/test/js/bun/spawn/spawn-stream-serve.test.ts
+++ b/test/js/bun/spawn/spawn-stream-serve.test.ts
@@ -1,4 +1,4 @@
-import { test, expect } from "bun:test";
+import { expect, test } from "bun:test";
import "harness";
import { fileURLToPath } from "url";
diff --git a/test/js/bun/spawn/spawn-streaming-stdout.test.ts b/test/js/bun/spawn/spawn-streaming-stdout.test.ts
index 4da432e78f..61994d98cf 100644
--- a/test/js/bun/spawn/spawn-streaming-stdout.test.ts
+++ b/test/js/bun/spawn/spawn-streaming-stdout.test.ts
@@ -1,8 +1,6 @@
import { spawn } from "bun";
import { expect, test } from "bun:test";
-import { closeSync, openSync } from "fs";
import { bunEnv, bunExe, dumpStats, expectMaxObjectTypeCount, gcTick, getMaxFD } from "harness";
-import { devNull } from "os";
test("spawn can read from stdout multiple chunks", async () => {
gcTick(true);
diff --git a/test/js/bun/spawn/spawn.ipc.test.ts b/test/js/bun/spawn/spawn.ipc.test.ts
index dc734eb881..b53d53b094 100644
--- a/test/js/bun/spawn/spawn.ipc.test.ts
+++ b/test/js/bun/spawn/spawn.ipc.test.ts
@@ -1,6 +1,6 @@
import { spawn } from "bun";
import { describe, expect, it } from "bun:test";
-import { gcTick, bunExe } from "harness";
+import { bunExe, gcTick } from "harness";
import path from "path";
describe.each(["advanced", "json"])("ipc mode %s", mode => {
diff --git a/test/js/bun/spawn/spawn.test.ts b/test/js/bun/spawn/spawn.test.ts
index 82f09dfd77..345e458e22 100644
--- a/test/js/bun/spawn/spawn.test.ts
+++ b/test/js/bun/spawn/spawn.test.ts
@@ -1,6 +1,5 @@
-import { ArrayBufferSink, readableStreamToText, spawn, spawnSync, write } from "bun";
+import { ArrayBufferSink, readableStreamToText, spawn, spawnSync } from "bun";
import { beforeAll, describe, expect, it } from "bun:test";
-import { closeSync, fstatSync, openSync, readFileSync, rmSync, writeFileSync } from "node:fs";
import {
gcTick as _gcTick,
bunEnv,
@@ -13,6 +12,7 @@ import {
tmpdirSync,
withoutAggressiveGC,
} from "harness";
+import { closeSync, fstatSync, openSync, readFileSync, rmSync, writeFileSync } from "node:fs";
import path, { join } from "path";
let tmp: string;
diff --git a/test/js/bun/spawn/spawn_waiter_thread.test.ts b/test/js/bun/spawn/spawn_waiter_thread.test.ts
index 160d814fc2..37173ae724 100644
--- a/test/js/bun/spawn/spawn_waiter_thread.test.ts
+++ b/test/js/bun/spawn/spawn_waiter_thread.test.ts
@@ -1,5 +1,5 @@
-import { test, expect } from "bun:test";
import { spawn } from "bun";
+import { expect, test } from "bun:test";
import { bunEnv, bunExe, isWindows } from "harness";
import { join } from "path";
diff --git a/test/js/bun/sqlite/sql-timezone.test.js b/test/js/bun/sqlite/sql-timezone.test.js
index c39eafd1f2..b3eb47aba1 100644
--- a/test/js/bun/sqlite/sql-timezone.test.js
+++ b/test/js/bun/sqlite/sql-timezone.test.js
@@ -1,5 +1,5 @@
-import { expect, it } from "bun:test";
import { Database } from "bun:sqlite";
+import { expect, it } from "bun:test";
const dbPath = import.meta.dir + "/northwind.testdb";
diff --git a/test/js/bun/sqlite/sqlite.test.js b/test/js/bun/sqlite/sqlite.test.js
index fdac0b6af0..2836efcd1b 100644
--- a/test/js/bun/sqlite/sqlite.test.js
+++ b/test/js/bun/sqlite/sqlite.test.js
@@ -1,8 +1,8 @@
-import { expect, it, describe } from "bun:test";
-import { Database, constants, SQLiteError } from "bun:sqlite";
-import { existsSync, fstat, readdirSync, realpathSync, rmSync, writeFileSync } from "fs";
-import { $, spawnSync } from "bun";
-import { BREAKING_CHANGES_BUN_1_2, bunExe, isMacOS, isMacOSVersionAtLeast, isWindows, tempDirWithFiles } from "harness";
+import { spawnSync } from "bun";
+import { constants, Database, SQLiteError } from "bun:sqlite";
+import { describe, expect, it } from "bun:test";
+import { existsSync, readdirSync, realpathSync, writeFileSync } from "fs";
+import { bunExe, isMacOS, isMacOSVersionAtLeast, isWindows, tempDirWithFiles } from "harness";
import { tmpdir } from "os";
import path from "path";
diff --git a/test/js/bun/stream/direct-readable-stream.test.tsx b/test/js/bun/stream/direct-readable-stream.test.tsx
index 7f695ee5c5..4d4e6f20a0 100644
--- a/test/js/bun/stream/direct-readable-stream.test.tsx
+++ b/test/js/bun/stream/direct-readable-stream.test.tsx
@@ -1,9 +1,9 @@
import {
concatArrayBuffers,
readableStreamToArray,
- readableStreamToBytes,
readableStreamToArrayBuffer,
readableStreamToBlob,
+ readableStreamToBytes,
readableStreamToText,
serve,
Server,
@@ -11,9 +11,9 @@ import {
import { describe, expect, it } from "bun:test";
import { expectMaxObjectTypeCount, gc } from "harness";
// @ts-ignore
-import { renderToReadableStream as renderToReadableStreamBrowser } from "react-dom/server.browser";
-import * as ReactDOM from "react-dom/server";
import * as React from "react";
+import * as ReactDOM from "react-dom/server";
+import { renderToReadableStream as renderToReadableStreamBrowser } from "react-dom/server.browser";
Object.defineProperty(renderToReadableStreamBrowser, "name", {
value: "server.browser",
diff --git a/test/js/bun/test/custom-matcher-preload-test-fixture-2.ts b/test/js/bun/test/custom-matcher-preload-test-fixture-2.ts
index c1892d0b83..2376edcc25 100644
--- a/test/js/bun/test/custom-matcher-preload-test-fixture-2.ts
+++ b/test/js/bun/test/custom-matcher-preload-test-fixture-2.ts
@@ -1,4 +1,4 @@
-import { test, expect } from "bun:test";
+import { expect, test } from "bun:test";
test("custom matcher", () => {
// @ts-expect-error
diff --git a/test/js/bun/test/done-async.test.ts b/test/js/bun/test/done-async.test.ts
index 8f8d995746..2b6dff806b 100644
--- a/test/js/bun/test/done-async.test.ts
+++ b/test/js/bun/test/done-async.test.ts
@@ -1,6 +1,6 @@
-import { test, expect } from "bun:test";
+import { expect, test } from "bun:test";
-import { tempDirWithFiles, bunEnv, bunExe } from "harness";
+import { bunEnv, bunExe, tempDirWithFiles } from "harness";
import path from "path";
test("done() causes the test to fail when it should", async () => {
diff --git a/test/js/bun/test/done-infinity.fixture.ts b/test/js/bun/test/done-infinity.fixture.ts
index a58e002569..350a0b1f03 100644
--- a/test/js/bun/test/done-infinity.fixture.ts
+++ b/test/js/bun/test/done-infinity.fixture.ts
@@ -1,4 +1,4 @@
-import { test, expect } from "bun:test";
+import { expect, test } from "bun:test";
test("asynchronously failing test with a done callback does not hang", async done => {
await Bun.sleep(42);
diff --git a/test/js/bun/test/expect-assertions.test.ts b/test/js/bun/test/expect-assertions.test.ts
index 94908de0e6..827f5a3a90 100644
--- a/test/js/bun/test/expect-assertions.test.ts
+++ b/test/js/bun/test/expect-assertions.test.ts
@@ -1,6 +1,6 @@
-import { test, expect } from "bun:test";
+import { expect, test } from "bun:test";
-import { tempDirWithFiles, bunEnv, bunExe } from "harness";
+import { bunEnv, bunExe, tempDirWithFiles } from "harness";
import path from "path";
test("expect.assertions causes the test to fail when it should", async () => {
diff --git a/test/js/bun/test/expect-extend-preload.test.ts b/test/js/bun/test/expect-extend-preload.test.ts
index 8818f9b433..4d9084addf 100644
--- a/test/js/bun/test/expect-extend-preload.test.ts
+++ b/test/js/bun/test/expect-extend-preload.test.ts
@@ -1,5 +1,5 @@
import { file } from "bun";
-import { test, expect } from "bun:test";
+import { expect, test } from "bun:test";
import { bunEnv, bunExe, tempDirWithFiles } from "harness";
import { join } from "path";
diff --git a/test/js/bun/test/expect-label.test.ts b/test/js/bun/test/expect-label.test.ts
index e8742e98c6..d90a25779f 100644
--- a/test/js/bun/test/expect-label.test.ts
+++ b/test/js/bun/test/expect-label.test.ts
@@ -1,4 +1,4 @@
-import { test, expect } from "bun:test";
+import { expect, test } from "bun:test";
import stripAnsiColors from "strip-ansi";
test("expect-label", () => {
diff --git a/test/js/bun/test/expect-unreaachable.test.ts b/test/js/bun/test/expect-unreaachable.test.ts
index 12cfe511db..cf94589b92 100644
--- a/test/js/bun/test/expect-unreaachable.test.ts
+++ b/test/js/bun/test/expect-unreaachable.test.ts
@@ -1,4 +1,4 @@
-import { test, expect } from "bun:test";
+import { expect, test } from "bun:test";
test("expect.unreachable()", () => {
expect(expect.unreachable).toBeTypeOf("function");
diff --git a/test/js/bun/test/mock/6874/A.test.ts b/test/js/bun/test/mock/6874/A.test.ts
index b2f3ab5f82..5cc41be1f5 100644
--- a/test/js/bun/test/mock/6874/A.test.ts
+++ b/test/js/bun/test/mock/6874/A.test.ts
@@ -1,4 +1,4 @@
-import { expect, it, mock, describe } from "bun:test";
+import { describe, expect, it, mock } from "bun:test";
import { a } from "./A.ts";
mock.module(require.resolve("lodash"), () => ({ trim: () => "mocked" }));
diff --git a/test/js/bun/test/mock/6874/B.test.ts b/test/js/bun/test/mock/6874/B.test.ts
index cd386824b7..3800ae6ef2 100644
--- a/test/js/bun/test/mock/6874/B.test.ts
+++ b/test/js/bun/test/mock/6874/B.test.ts
@@ -1,4 +1,4 @@
-import { expect, it, mock, describe } from "bun:test";
+import { describe, expect, it, mock } from "bun:test";
import { b } from "./B.ts";
mock.module(require.resolve("lodash"), () => ({ trim: () => "mocked" }));
diff --git a/test/js/bun/test/mock/mock-module.test.ts b/test/js/bun/test/mock/mock-module.test.ts
index a45d4858e2..ac7f43daed 100644
--- a/test/js/bun/test/mock/mock-module.test.ts
+++ b/test/js/bun/test/mock/mock-module.test.ts
@@ -7,8 +7,8 @@
// - Write test for export {foo} from "./foo"
// - Write test for import {foo} from "./foo"; export {foo}
-import { expect, mock, spyOn, test, describe } from "bun:test";
-import { fn, iCallFn, variable, default as defaultValue, rexported, rexportedAs } from "./mock-module-fixture";
+import { expect, mock, spyOn, test } from "bun:test";
+import { default as defaultValue, fn, iCallFn, rexported, rexportedAs, variable } from "./mock-module-fixture";
import * as spyFixture from "./spymodule-fixture";
test("mock.module async", async () => {
diff --git a/test/js/bun/test/preload-test.test.js b/test/js/bun/test/preload-test.test.js
index edcc738886..9191ec2016 100644
--- a/test/js/bun/test/preload-test.test.js
+++ b/test/js/bun/test/preload-test.test.js
@@ -1,9 +1,9 @@
import { spawnSync } from "bun";
import { describe, expect, test } from "bun:test";
import { mkdirSync, realpathSync } from "fs";
+import { bunEnv, bunExe } from "harness";
import { tmpdir } from "os";
import { join } from "path";
-import { bunEnv, bunExe } from "harness";
const preloadModule = `
import {plugin} from 'bun';
diff --git a/test/js/bun/test/setTimeout-test-fixture.js b/test/js/bun/test/setTimeout-test-fixture.js
index 342a02cd34..7b9589e247 100644
--- a/test/js/bun/test/setTimeout-test-fixture.js
+++ b/test/js/bun/test/setTimeout-test-fixture.js
@@ -1,4 +1,4 @@
-import { setDefaultTimeout, test, expect, beforeAll } from "bun:test";
+import { beforeAll, expect, setDefaultTimeout, test } from "bun:test";
beforeAll(() => {
setDefaultTimeout(100);
diff --git a/test/js/bun/test/skip-test-fixture.js b/test/js/bun/test/skip-test-fixture.js
index acb5f0748a..1f2b1f4c7f 100644
--- a/test/js/bun/test/skip-test-fixture.js
+++ b/test/js/bun/test/skip-test-fixture.js
@@ -1,4 +1,4 @@
-import { test, describe } from "bun:test";
+import { describe, test } from "bun:test";
test.skip("test #1", () => {
console.log("unreachable");
diff --git a/test/js/bun/test/snapshot-tests/bun-snapshots.test.ts b/test/js/bun/test/snapshot-tests/bun-snapshots.test.ts
index a601ca5560..e670e34392 100644
--- a/test/js/bun/test/snapshot-tests/bun-snapshots.test.ts
+++ b/test/js/bun/test/snapshot-tests/bun-snapshots.test.ts
@@ -1,4 +1,4 @@
-import { it, test, expect, describe } from "bun:test";
+import { describe, expect, it, test } from "bun:test";
test("it will create a snapshot file if it doesn't exist", () => {
expect({ a: { b: { c: false } }, c: 2, jkfje: 99238 }).toMatchSnapshot({ a: { b: { c: expect.any(Boolean) } } });
diff --git a/test/js/bun/test/snapshot-tests/existing-snapshots.test.ts b/test/js/bun/test/snapshot-tests/existing-snapshots.test.ts
index e09bee6595..48b09e9d55 100644
--- a/test/js/bun/test/snapshot-tests/existing-snapshots.test.ts
+++ b/test/js/bun/test/snapshot-tests/existing-snapshots.test.ts
@@ -1,4 +1,4 @@
-import { it, test, expect, describe } from "bun:test";
+import { expect, test } from "bun:test";
test("it will work with an existing snapshot file made with bun", () => {
expect({ a: { b: { c: false } }, c: 2, jkfje: 99238 }).toMatchSnapshot({ a: { b: { c: expect.any(Boolean) } } });
diff --git a/test/js/bun/test/snapshot-tests/new-snapshot.test.ts b/test/js/bun/test/snapshot-tests/new-snapshot.test.ts
index 1a9fd5cf7a..9ab1fcae8e 100644
--- a/test/js/bun/test/snapshot-tests/new-snapshot.test.ts
+++ b/test/js/bun/test/snapshot-tests/new-snapshot.test.ts
@@ -1,6 +1,6 @@
+import { expect, test } from "bun:test";
import fs from "fs";
import { bunExe, tmpdirSync } from "harness";
-import { it, test, expect, describe } from "bun:test";
test("it will create a snapshot file and directory if they don't exist", () => {
const tempDir = tmpdirSync();
diff --git a/test/js/bun/test/snapshot-tests/new-snapshot.ts b/test/js/bun/test/snapshot-tests/new-snapshot.ts
index d7f55597d1..fd2800eb47 100644
--- a/test/js/bun/test/snapshot-tests/new-snapshot.ts
+++ b/test/js/bun/test/snapshot-tests/new-snapshot.ts
@@ -1,4 +1,4 @@
-import { it, test, expect, describe } from "bun:test";
+import { expect, test } from "bun:test";
test("new snapshot", () => {
expect({ b: 2 }).toMatchSnapshot();
});
diff --git a/test/js/bun/test/snapshot-tests/snapshots/more-snapshots/different-directory.test.ts b/test/js/bun/test/snapshot-tests/snapshots/more-snapshots/different-directory.test.ts
index 3717fb442d..760311d46a 100644
--- a/test/js/bun/test/snapshot-tests/snapshots/more-snapshots/different-directory.test.ts
+++ b/test/js/bun/test/snapshot-tests/snapshots/more-snapshots/different-directory.test.ts
@@ -1,4 +1,4 @@
-import { it, test, expect, describe } from "bun:test";
+import { expect, test } from "bun:test";
test.todo("snapshots in different directory", () => {
expect("1\b2\n3\r4").toMatchSnapshot();
diff --git a/test/js/bun/test/snapshot-tests/snapshots/more.test.ts b/test/js/bun/test/snapshot-tests/snapshots/more.test.ts
index bf98cddf16..38214d3199 100644
--- a/test/js/bun/test/snapshot-tests/snapshots/more.test.ts
+++ b/test/js/bun/test/snapshot-tests/snapshots/more.test.ts
@@ -1,4 +1,4 @@
-import { it, test, expect, describe } from "bun:test";
+import { describe, expect, test } from "bun:test";
describe("d0", () => {
test.todo("snapshot serialize edgecases", () => {
diff --git a/test/js/bun/test/snapshot-tests/snapshots/moremore.test.ts b/test/js/bun/test/snapshot-tests/snapshots/moremore.test.ts
index d54dcc6f7c..6e2a53d009 100644
--- a/test/js/bun/test/snapshot-tests/snapshots/moremore.test.ts
+++ b/test/js/bun/test/snapshot-tests/snapshots/moremore.test.ts
@@ -1,4 +1,4 @@
-import { it, test, expect, describe } from "bun:test";
+import { expect, test } from "bun:test";
class Number2 extends Number {
constructor(value: number) {
diff --git a/test/js/bun/test/snapshot-tests/snapshots/snapshot.test.ts b/test/js/bun/test/snapshot-tests/snapshots/snapshot.test.ts
index 519a0169f2..5b68833f7d 100644
--- a/test/js/bun/test/snapshot-tests/snapshots/snapshot.test.ts
+++ b/test/js/bun/test/snapshot-tests/snapshots/snapshot.test.ts
@@ -1,4 +1,4 @@
-import { it, test, expect, describe } from "bun:test";
+import { expect, it, test } from "bun:test";
function test1000000(arg1: any, arg218718132: any) {}
diff --git a/test/js/bun/test/stack.test.ts b/test/js/bun/test/stack.test.ts
index 230992c15f..ac3fde49c0 100644
--- a/test/js/bun/test/stack.test.ts
+++ b/test/js/bun/test/stack.test.ts
@@ -1,8 +1,8 @@
-import { test, expect, beforeEach, afterEach } from "bun:test";
-import { join } from "node:path";
-import "harness";
import { $ } from "bun";
+import { expect, test } from "bun:test";
+import "harness";
import { bunEnv, bunExe } from "harness";
+import { join } from "node:path";
test("name property is used for function calls in Error.stack", () => {
function WRONG() {
diff --git a/test/js/bun/test/test-fixture-diff-indexed-properties.js b/test/js/bun/test/test-fixture-diff-indexed-properties.js
index b7a1acb233..a2163079a9 100644
--- a/test/js/bun/test/test-fixture-diff-indexed-properties.js
+++ b/test/js/bun/test/test-fixture-diff-indexed-properties.js
@@ -1,4 +1,4 @@
-import { test, expect } from "bun:test";
+import { expect, test } from "bun:test";
test("indexed property diff", () => {
var obj = {};
diff --git a/test/js/bun/test/test-fixture-preload-global-lifecycle-hook-preloaded.js b/test/js/bun/test/test-fixture-preload-global-lifecycle-hook-preloaded.js
index fbe926f2a2..5416c9d914 100644
--- a/test/js/bun/test/test-fixture-preload-global-lifecycle-hook-preloaded.js
+++ b/test/js/bun/test/test-fixture-preload-global-lifecycle-hook-preloaded.js
@@ -1,4 +1,4 @@
-import { beforeAll, afterAll, afterEach, beforeEach } from "bun:test";
+import { afterAll, afterEach, beforeAll, beforeEach } from "bun:test";
for (let suffix of ["#1", "#2"]) {
for (let fn of [
diff --git a/test/js/bun/test/test-fixture-preload-global-lifecycle-hook-test.js b/test/js/bun/test/test-fixture-preload-global-lifecycle-hook-test.js
index 7bea99d79b..575dd1f87d 100644
--- a/test/js/bun/test/test-fixture-preload-global-lifecycle-hook-test.js
+++ b/test/js/bun/test/test-fixture-preload-global-lifecycle-hook-test.js
@@ -1,4 +1,4 @@
-import { beforeAll, afterAll, afterEach, beforeEach, test, describe } from "bun:test";
+import { afterAll, afterEach, beforeAll, beforeEach, describe, test } from "bun:test";
for (let suffix of ["TEST-FILE"]) {
for (let fn of [
diff --git a/test/js/bun/test/test-only.test.ts b/test/js/bun/test/test-only.test.ts
index a360c82db7..5a45cc484a 100644
--- a/test/js/bun/test/test-only.test.ts
+++ b/test/js/bun/test/test-only.test.ts
@@ -1,6 +1,5 @@
-import { describe, expect, test, beforeAll, afterAll } from "bun:test";
import { $ } from "bun";
-import path from "path";
+import { expect, test } from "bun:test";
import { bunExe } from "harness";
test.each(["./only-fixture-1.ts", "./only-fixture-2.ts", "./only-fixture-3.ts"])(
diff --git a/test/js/bun/test/test-test.test.ts b/test/js/bun/test/test-test.test.ts
index 38f915df0e..a6fce244ee 100644
--- a/test/js/bun/test/test-test.test.ts
+++ b/test/js/bun/test/test-test.test.ts
@@ -1,11 +1,11 @@
// @ts-nocheck
import { spawn, spawnSync } from "bun";
import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it, test } from "bun:test";
-import { mkdirSync, realpathSync, rmSync, writeFileSync, copyFileSync } from "fs";
+import { copyFileSync, mkdirSync, realpathSync, rmSync, writeFileSync } from "fs";
import { rm, writeFile } from "fs/promises";
import { bunEnv, bunExe, tempDirWithFiles, tmpdirSync } from "harness";
import { tmpdir } from "os";
-import { join, dirname } from "path";
+import { dirname, join } from "path";
const tmp = realpathSync(tmpdir());
diff --git a/test/js/bun/test/todo-test-fixture.js b/test/js/bun/test/todo-test-fixture.js
index e5768700d1..b2b7ed306e 100644
--- a/test/js/bun/test/todo-test-fixture.js
+++ b/test/js/bun/test/todo-test-fixture.js
@@ -1,4 +1,4 @@
-import { test, describe } from "bun:test";
+import { describe, test } from "bun:test";
test.todo("todo 1");
test.todo("todo 2", () => {
diff --git a/test/js/bun/udp/dgram.test.ts b/test/js/bun/udp/dgram.test.ts
index 5a9301322a..5728226d55 100644
--- a/test/js/bun/udp/dgram.test.ts
+++ b/test/js/bun/udp/dgram.test.ts
@@ -1,9 +1,9 @@
+import { describe, expect, test } from "bun:test";
import { createSocket } from "dgram";
-import { describe, test, expect, it } from "bun:test";
-import { nodeDataCases } from "./testdata";
import { disableAggressiveGCScope } from "harness";
import path from "path";
+import { nodeDataCases } from "./testdata";
describe("createSocket()", () => {
test("connect", done => {
diff --git a/test/js/bun/util/__snapshots__/inspect-error.test.js.snap b/test/js/bun/util/__snapshots__/inspect-error.test.js.snap
index e550b8ca0a..a6a949433d 100644
--- a/test/js/bun/util/__snapshots__/inspect-error.test.js.snap
+++ b/test/js/bun/util/__snapshots__/inspect-error.test.js.snap
@@ -1,7 +1,7 @@
// Bun Snapshot v1, https://goo.gl/fbAQLP
exports[`error.cause 1`] = `
-"1 | import { test, expect } from "bun:test";
+"1 | import { expect, test } from "bun:test";
2 |
3 | test("error.cause", () => {
4 | const err = new Error("error 1");
@@ -10,7 +10,7 @@ exports[`error.cause 1`] = `
error: error 2
at [dir]/inspect-error.test.js:5:16
-1 | import { test, expect } from "bun:test";
+1 | import { expect, test } from "bun:test";
2 |
3 | test("error.cause", () => {
4 | const err = new Error("error 1");
diff --git a/test/js/bun/util/bun-cryptohasher.test.ts b/test/js/bun/util/bun-cryptohasher.test.ts
index 28af94e035..499328208f 100644
--- a/test/js/bun/util/bun-cryptohasher.test.ts
+++ b/test/js/bun/util/bun-cryptohasher.test.ts
@@ -1,4 +1,4 @@
-import { test, expect, describe } from "bun:test";
+import { describe, expect, test } from "bun:test";
test("Bun.file in CryptoHasher is not supported yet", () => {
expect(() => Bun.SHA1.hash(Bun.file(import.meta.path))).toThrow();
diff --git a/test/js/bun/util/bun-file-exists.test.js b/test/js/bun/util/bun-file-exists.test.js
index cca28e3599..dc1a810c49 100644
--- a/test/js/bun/util/bun-file-exists.test.js
+++ b/test/js/bun/util/bun-file-exists.test.js
@@ -1,8 +1,8 @@
-import { test, expect } from "bun:test";
-import { join } from "path";
-import { tmpdir } from "os";
import { write } from "bun";
+import { expect, test } from "bun:test";
import { unlinkSync } from "fs";
+import { tmpdir } from "os";
+import { join } from "path";
test("bun-file-exists", async () => {
expect(await Bun.file(import.meta.path).exists()).toBeTrue();
expect(await Bun.file(import.meta.path + "boop").exists()).toBeFalse();
diff --git a/test/js/bun/util/bun-file-read.test.ts b/test/js/bun/util/bun-file-read.test.ts
index 196c81a3b4..fd8bca82ac 100644
--- a/test/js/bun/util/bun-file-read.test.ts
+++ b/test/js/bun/util/bun-file-read.test.ts
@@ -1,4 +1,4 @@
-import { it, expect } from "bun:test";
+import { expect, it } from "bun:test";
import { tmpdir } from "node:os";
it("offset should work in Bun.file() #4963", async () => {
diff --git a/test/js/bun/util/bun-file-windows.test.ts b/test/js/bun/util/bun-file-windows.test.ts
index cdbf5ab71a..cdbb2cca86 100644
--- a/test/js/bun/util/bun-file-windows.test.ts
+++ b/test/js/bun/util/bun-file-windows.test.ts
@@ -1,4 +1,4 @@
-import { openSync, closeSync } from "fs";
+import { closeSync, openSync } from "fs";
import { open } from "fs/promises";
test('Bun.file("/dev/null") works on windows', async () => {
diff --git a/test/js/bun/util/bun-isMainThread.test.js b/test/js/bun/util/bun-isMainThread.test.js
index 87f74d136c..6921c0586f 100644
--- a/test/js/bun/util/bun-isMainThread.test.js
+++ b/test/js/bun/util/bun-isMainThread.test.js
@@ -1,4 +1,4 @@
-import { test, expect } from "bun:test";
+import { expect, test } from "bun:test";
import { bunEnv, bunExe } from "harness";
test("Bun.isMainThread", () => {
diff --git a/test/js/bun/util/concat.test.js b/test/js/bun/util/concat.test.js
index 0a5bc23edf..1f41b433e9 100644
--- a/test/js/bun/util/concat.test.js
+++ b/test/js/bun/util/concat.test.js
@@ -1,5 +1,5 @@
-import { describe, it, expect } from "bun:test";
import { concatArrayBuffers } from "bun";
+import { describe, expect, it } from "bun:test";
describe("concat", () => {
function polyfill(chunks) {
diff --git a/test/js/bun/util/error-gc-test.test.js b/test/js/bun/util/error-gc-test.test.js
index 60dc97befb..da1cfecb02 100644
--- a/test/js/bun/util/error-gc-test.test.js
+++ b/test/js/bun/util/error-gc-test.test.js
@@ -1,4 +1,4 @@
-import { test, expect } from "bun:test";
+import { expect, test } from "bun:test";
import { readFileSync } from "fs";
import { tmpdirSync } from "harness";
import { join } from "path";
diff --git a/test/js/bun/util/escapeHTML.test.js b/test/js/bun/util/escapeHTML.test.js
index 78d5b96656..d944e44419 100644
--- a/test/js/bun/util/escapeHTML.test.js
+++ b/test/js/bun/util/escapeHTML.test.js
@@ -1,5 +1,5 @@
-import { describe, it, expect } from "bun:test";
import { escapeHTML } from "bun";
+import { describe, expect, it } from "bun:test";
describe("escapeHTML", () => {
// The matrix of cases we need to test for:
diff --git a/test/js/bun/util/exotic-global-mutable-prototype.test.ts b/test/js/bun/util/exotic-global-mutable-prototype.test.ts
index f51ad39b51..82df9c97c6 100644
--- a/test/js/bun/util/exotic-global-mutable-prototype.test.ts
+++ b/test/js/bun/util/exotic-global-mutable-prototype.test.ts
@@ -1,4 +1,4 @@
-import { test, expect } from "bun:test";
+import { expect, test } from "bun:test";
// StructureFlag: ~IsImmutablePrototypeExoticObject
//
diff --git a/test/js/bun/util/file-type.test.ts b/test/js/bun/util/file-type.test.ts
index d4d926b0c2..abbc755acf 100644
--- a/test/js/bun/util/file-type.test.ts
+++ b/test/js/bun/util/file-type.test.ts
@@ -1,4 +1,4 @@
-import { test, expect, describe } from "bun:test";
+import { describe, expect, test } from "bun:test";
describe("util file tests", () => {
test("custom set mime-type respected (#6507)", () => {
const file = Bun.file("test", {
diff --git a/test/js/bun/util/fileUrl.test.js b/test/js/bun/util/fileUrl.test.js
index 06c239c164..ecd6ad9c6f 100644
--- a/test/js/bun/util/fileUrl.test.js
+++ b/test/js/bun/util/fileUrl.test.js
@@ -1,5 +1,5 @@
-import { expect, it, describe } from "bun:test";
-import { pathToFileURL, fileURLToPath } from "bun";
+import { fileURLToPath, pathToFileURL } from "bun";
+import { describe, expect, it } from "bun:test";
import { isWindows } from "harness";
describe("pathToFileURL", () => {
diff --git a/test/js/bun/util/filesink.test.ts b/test/js/bun/util/filesink.test.ts
index 37d1c8b9d8..62b87db12e 100644
--- a/test/js/bun/util/filesink.test.ts
+++ b/test/js/bun/util/filesink.test.ts
@@ -167,8 +167,8 @@ describe("FileSink", () => {
});
import fs from "node:fs";
-import util from "node:util";
import path from "node:path";
+import util from "node:util";
it("end doesn't close when backed by a file descriptor", async () => {
using _ = fileDescriptorLeakChecker();
diff --git a/test/js/bun/util/filesystem_router.test.ts b/test/js/bun/util/filesystem_router.test.ts
index bd0074fbd3..e297a57be6 100644
--- a/test/js/bun/util/filesystem_router.test.ts
+++ b/test/js/bun/util/filesystem_router.test.ts
@@ -1,8 +1,8 @@
import { FileSystemRouter } from "bun";
-import { it, expect } from "bun:test";
-import path, { dirname } from "path";
+import { expect, it } from "bun:test";
import fs, { mkdirSync, rmSync } from "fs";
import { tmpdirSync } from "harness";
+import path, { dirname } from "path";
function createTree(basedir: string, paths: string[]) {
for (const end of paths) {
diff --git a/test/js/bun/util/fuzzy-wuzzy.test.ts b/test/js/bun/util/fuzzy-wuzzy.test.ts
index 1af4e30697..d5a3888af0 100644
--- a/test/js/bun/util/fuzzy-wuzzy.test.ts
+++ b/test/js/bun/util/fuzzy-wuzzy.test.ts
@@ -19,7 +19,7 @@
const ENABLE_LOGGING = false;
-import { describe, expect, test } from "bun:test";
+import { describe, test } from "bun:test";
import { isWindows } from "harness";
const Promise = globalThis.Promise;
diff --git a/test/js/bun/util/hash.test.js b/test/js/bun/util/hash.test.js
index 29c683801b..8401c665ce 100644
--- a/test/js/bun/util/hash.test.js
+++ b/test/js/bun/util/hash.test.js
@@ -1,4 +1,4 @@
-import { it, expect } from "bun:test";
+import { expect, it } from "bun:test";
import { gcTick } from "harness";
it(`Bun.hash()`, () => {
diff --git a/test/js/bun/util/highlighter.test.ts b/test/js/bun/util/highlighter.test.ts
index c2ae8201a0..e45e73ca9f 100644
--- a/test/js/bun/util/highlighter.test.ts
+++ b/test/js/bun/util/highlighter.test.ts
@@ -1,5 +1,5 @@
-import { test, expect } from "bun:test";
import { quickAndDirtyJavaScriptSyntaxHighlighter as highlighter } from "bun:internal-for-testing";
+import { expect, test } from "bun:test";
test("highlighter", () => {
expect(highlighter("`can do ${123} ${'123'} ${`123`}`").length).toBeLessThan(150);
diff --git a/test/js/bun/util/index-of-line.test.ts b/test/js/bun/util/index-of-line.test.ts
index 1c6cbaea20..148a808851 100644
--- a/test/js/bun/util/index-of-line.test.ts
+++ b/test/js/bun/util/index-of-line.test.ts
@@ -1,5 +1,5 @@
-import { expect, test } from "bun:test";
import { indexOfLine } from "bun";
+import { expect, test } from "bun:test";
test("indexOfLine", () => {
const source = `
diff --git a/test/js/bun/util/inspect-error-leak.test.js b/test/js/bun/util/inspect-error-leak.test.js
index 49df1a3315..11a63b26de 100644
--- a/test/js/bun/util/inspect-error-leak.test.js
+++ b/test/js/bun/util/inspect-error-leak.test.js
@@ -1,4 +1,4 @@
-import { test, expect } from "bun:test";
+import { expect, test } from "bun:test";
const perBatch = 2000;
const repeat = 50;
diff --git a/test/js/bun/util/inspect-error.test.js b/test/js/bun/util/inspect-error.test.js
index cb02fe1feb..a65edd62b3 100644
--- a/test/js/bun/util/inspect-error.test.js
+++ b/test/js/bun/util/inspect-error.test.js
@@ -1,4 +1,4 @@
-import { test, expect } from "bun:test";
+import { expect, test } from "bun:test";
test("error.cause", () => {
const err = new Error("error 1");
diff --git a/test/js/bun/util/inspect.test.js b/test/js/bun/util/inspect.test.js
index c1a8fd3482..15ad2702c9 100644
--- a/test/js/bun/util/inspect.test.js
+++ b/test/js/bun/util/inspect.test.js
@@ -1,4 +1,4 @@
-import { it, expect, describe } from "bun:test";
+import { describe, expect, it } from "bun:test";
import { tmpdirSync } from "harness";
import { join } from "path";
import util from "util";
diff --git a/test/js/bun/util/mmap.test.js b/test/js/bun/util/mmap.test.js
index 8af4289a9a..57a3f43e64 100644
--- a/test/js/bun/util/mmap.test.js
+++ b/test/js/bun/util/mmap.test.js
@@ -1,4 +1,4 @@
-import { describe, it, expect } from "bun:test";
+import { describe, expect, it } from "bun:test";
import { gcTick, isWindows, tmpdirSync } from "harness";
import { join } from "path";
diff --git a/test/js/bun/util/password.test.ts b/test/js/bun/util/password.test.ts
index 632fa334e8..f838ad3a48 100644
--- a/test/js/bun/util/password.test.ts
+++ b/test/js/bun/util/password.test.ts
@@ -1,6 +1,6 @@
-import { test, expect, describe } from "bun:test";
+import { describe, expect, test } from "bun:test";
-import { Password, password } from "bun";
+import { password } from "bun";
const placeholder = "hey";
diff --git a/test/js/bun/util/readablestreamtoarraybuffer.test.ts b/test/js/bun/util/readablestreamtoarraybuffer.test.ts
index 132e5f18a7..7b15222bc3 100644
--- a/test/js/bun/util/readablestreamtoarraybuffer.test.ts
+++ b/test/js/bun/util/readablestreamtoarraybuffer.test.ts
@@ -1,4 +1,4 @@
-import { test, expect } from "bun:test";
+import { expect, test } from "bun:test";
test("readableStreamToArrayBuffer works", async () => {
// the test calls InternalPromise.then. this test ensures that such function is not user-overridable.
diff --git a/test/js/bun/util/reportError.test.ts b/test/js/bun/util/reportError.test.ts
index 73a96aebc9..14f0466af3 100644
--- a/test/js/bun/util/reportError.test.ts
+++ b/test/js/bun/util/reportError.test.ts
@@ -1,7 +1,7 @@
-import { test, expect } from "bun:test";
import { spawnSync } from "bun";
-import { join } from "path";
+import { expect, test } from "bun:test";
import { bunEnv, bunExe } from "harness";
+import { join } from "path";
test("reportError", () => {
const cwd = import.meta.dir;
diff --git a/test/js/bun/util/sleep.test.ts b/test/js/bun/util/sleep.test.ts
index 85a66b09ce..e1adee7cab 100644
--- a/test/js/bun/util/sleep.test.ts
+++ b/test/js/bun/util/sleep.test.ts
@@ -1,4 +1,4 @@
-import { test, expect } from "bun:test";
+import { expect, test } from "bun:test";
import { bunEnv, bunExe } from "harness";
test("sleep should saturate timeout values", async () => {
diff --git a/test/js/bun/util/sleepSync.test.ts b/test/js/bun/util/sleepSync.test.ts
index 21052d314f..45361c2b5b 100644
--- a/test/js/bun/util/sleepSync.test.ts
+++ b/test/js/bun/util/sleepSync.test.ts
@@ -1,5 +1,5 @@
-import { it, expect } from "bun:test";
import { sleepSync } from "bun";
+import { expect, it } from "bun:test";
it("sleepSync uses milliseconds", async () => {
const start = performance.now();
diff --git a/test/js/bun/util/stringWidth.test.ts b/test/js/bun/util/stringWidth.test.ts
index 642d32fe98..3df3267eaf 100644
--- a/test/js/bun/util/stringWidth.test.ts
+++ b/test/js/bun/util/stringWidth.test.ts
@@ -1,4 +1,4 @@
-import { test, expect, describe } from "bun:test";
+import { describe, expect, test } from "bun:test";
import npmStringWidth from "string-width";
expect.extend({
diff --git a/test/js/bun/util/text-loader.test.ts b/test/js/bun/util/text-loader.test.ts
index 604620e735..b46d63e31b 100644
--- a/test/js/bun/util/text-loader.test.ts
+++ b/test/js/bun/util/text-loader.test.ts
@@ -1,8 +1,8 @@
import { spawnSync } from "bun";
import { describe, expect, it } from "bun:test";
+import { readFileSync } from "fs";
import { bunEnv, bunExe } from "harness";
import { join } from "path";
-import { readFileSync } from "fs";
describe("text-loader", () => {
const fixtures = [
diff --git a/test/js/bun/util/unsafe.test.js b/test/js/bun/util/unsafe.test.js
index 38830fa36d..767446cc24 100644
--- a/test/js/bun/util/unsafe.test.js
+++ b/test/js/bun/util/unsafe.test.js
@@ -1,4 +1,4 @@
-import { test, expect, it, describe } from "bun:test";
+import { expect, it } from "bun:test";
import { gc } from "harness";
it("arrayBufferToString u8", async () => {
diff --git a/test/js/bun/util/which.test.ts b/test/js/bun/util/which.test.ts
index 902efdf0b9..db3d5a0c6a 100644
--- a/test/js/bun/util/which.test.ts
+++ b/test/js/bun/util/which.test.ts
@@ -1,9 +1,9 @@
-import { test, expect } from "bun:test";
import { $, which } from "bun";
-import { rmSync, chmodSync, mkdirSync, realpathSync, rmdirSync } from "node:fs";
-import { join, basename } from "node:path";
-import { tmpdir } from "node:os";
+import { expect, test } from "bun:test";
import { isIntelMacOS, isWindows, tempDirWithFiles, tmpdirSync } from "harness";
+import { chmodSync, mkdirSync, realpathSync, rmdirSync, rmSync } from "node:fs";
+import { tmpdir } from "node:os";
+import { basename, join } from "node:path";
$.nothrow();
diff --git a/test/js/bun/wasm/wasi.test.js b/test/js/bun/wasm/wasi.test.js
index ac1d986d46..9b02de881b 100644
--- a/test/js/bun/wasm/wasi.test.js
+++ b/test/js/bun/wasm/wasi.test.js
@@ -1,6 +1,6 @@
import { spawnSync } from "bun";
import { expect, it } from "bun:test";
-import { bunExe, bunEnv } from "harness";
+import { bunEnv, bunExe } from "harness";
it("Should support printing 'hello world'", () => {
const { stdout, exitCode } = spawnSync({
diff --git a/test/js/bun/wasm/wasm.js b/test/js/bun/wasm/wasm.js
index a4daaaffee..e69de29bb2 100644
--- a/test/js/bun/wasm/wasm.js
+++ b/test/js/bun/wasm/wasm.js
@@ -1 +0,0 @@
-import * as wasm from "./wasm-return-1-test.wasm";
diff --git a/test/js/bun/websocket/websocket-server.test.ts b/test/js/bun/websocket/websocket-server.test.ts
index ce95f27e71..6bcb231747 100644
--- a/test/js/bun/websocket/websocket-server.test.ts
+++ b/test/js/bun/websocket/websocket-server.test.ts
@@ -1,7 +1,7 @@
-import { describe, it, expect, afterEach } from "bun:test";
import type { Server, Subprocess, WebSocketHandler } from "bun";
import { serve, spawn } from "bun";
-import { bunEnv, bunExe, forceGuardMalloc, nodeExe } from "harness";
+import { afterEach, describe, expect, it } from "bun:test";
+import { bunEnv, bunExe, forceGuardMalloc } from "harness";
import { isIP } from "node:net";
import path from "node:path";
diff --git a/test/js/first_party/undici/undici-primordials.test.ts b/test/js/first_party/undici/undici-primordials.test.ts
index 63c57cf086..326f28a2e0 100644
--- a/test/js/first_party/undici/undici-primordials.test.ts
+++ b/test/js/first_party/undici/undici-primordials.test.ts
@@ -1,4 +1,4 @@
-import { describe, it, expect, beforeAll, afterAll, afterEach } from "bun:test";
+import { afterEach, expect, it } from "bun:test";
const { Response, Request, Headers, FormData, File, URL, AbortSignal, URLSearchParams } = globalThis;
afterEach(() => {
globalThis.Response = Response;
diff --git a/test/js/first_party/undici/undici.test.ts b/test/js/first_party/undici/undici.test.ts
index f7199e9f54..6619c45092 100644
--- a/test/js/first_party/undici/undici.test.ts
+++ b/test/js/first_party/undici/undici.test.ts
@@ -1,4 +1,4 @@
-import { describe, it, expect, beforeAll, afterAll } from "bun:test";
+import { afterAll, beforeAll, describe, expect, it } from "bun:test";
import { request } from "undici";
import { createServer } from "../../../http-test-server";
diff --git a/test/js/first_party/utf-8-validate/utf-8-validate.test.ts b/test/js/first_party/utf-8-validate/utf-8-validate.test.ts
index 781f9df845..fffd72bd36 100644
--- a/test/js/first_party/utf-8-validate/utf-8-validate.test.ts
+++ b/test/js/first_party/utf-8-validate/utf-8-validate.test.ts
@@ -1,4 +1,4 @@
-import { test, expect } from "bun:test";
+import { expect, test } from "bun:test";
import isValidUTF8 from "utf-8-validate";
test("utf-8-validate", () => {
diff --git a/test/js/first_party/ws/ws.test.ts b/test/js/first_party/ws/ws.test.ts
index b79e90879b..a2a06296d2 100644
--- a/test/js/first_party/ws/ws.test.ts
+++ b/test/js/first_party/ws/ws.test.ts
@@ -1,7 +1,7 @@
import type { Subprocess } from "bun";
import { spawn } from "bun";
import { afterEach, beforeEach, describe, expect, it } from "bun:test";
-import { bunEnv, bunExe, nodeExe } from "harness";
+import { bunEnv, bunExe } from "harness";
import path from "node:path";
import { Server, WebSocket, WebSocketServer } from "ws";
diff --git a/test/js/node/async_hooks/AsyncLocalStorage.test.ts b/test/js/node/async_hooks/AsyncLocalStorage.test.ts
index c05538a92d..ffa8856d90 100644
--- a/test/js/node/async_hooks/AsyncLocalStorage.test.ts
+++ b/test/js/node/async_hooks/AsyncLocalStorage.test.ts
@@ -1,6 +1,6 @@
import { AsyncLocalStorage, AsyncResource } from "async_hooks";
import { describe, expect, test } from "bun:test";
-import { bunExe, bunEnv } from "harness";
+import { bunEnv, bunExe } from "harness";
describe("AsyncLocalStorage", () => {
test("throw inside of AsyncLocalStorage.run() will be passed out", () => {
diff --git a/test/js/node/async_hooks/EventEmitterAsyncResource.test.ts b/test/js/node/async_hooks/EventEmitterAsyncResource.test.ts
index bbcadf9bfd..1fcb05c468 100644
--- a/test/js/node/async_hooks/EventEmitterAsyncResource.test.ts
+++ b/test/js/node/async_hooks/EventEmitterAsyncResource.test.ts
@@ -1,6 +1,6 @@
-import EventEmitter, { EventEmitterAsyncResource } from "events";
import { AsyncLocalStorage } from "async_hooks";
-import { describe, test, expect } from "bun:test";
+import { describe, expect, test } from "bun:test";
+import EventEmitter, { EventEmitterAsyncResource } from "events";
describe("EventEmitterAsyncResource", () => {
test("is an EventEmitter", () => {
diff --git a/test/js/node/async_hooks/async-local-storage-thenable.test.ts b/test/js/node/async_hooks/async-local-storage-thenable.test.ts
index b40403d59f..2e76aced80 100644
--- a/test/js/node/async_hooks/async-local-storage-thenable.test.ts
+++ b/test/js/node/async_hooks/async-local-storage-thenable.test.ts
@@ -1,5 +1,4 @@
import { AsyncLocalStorage } from "async_hooks";
-import { hideFromStackTrace } from "harness";
import { createTest } from "node-harness";
const store = new AsyncLocalStorage();
const data = Symbol("verifier");
diff --git a/test/js/node/async_hooks/async_hooks.node.test.ts b/test/js/node/async_hooks/async_hooks.node.test.ts
index d0b227ca67..40a0b8e105 100644
--- a/test/js/node/async_hooks/async_hooks.node.test.ts
+++ b/test/js/node/async_hooks/async_hooks.node.test.ts
@@ -1,5 +1,5 @@
-import { AsyncLocalStorage, AsyncResource } from "async_hooks";
import assert from "assert";
+import { AsyncLocalStorage, AsyncResource } from "async_hooks";
test("node async_hooks.AsyncLocalStorage enable disable", async done => {
const asyncLocalStorage = new AsyncLocalStorage