use Biome to format Bun's codebase instead of Prettier (#8494)

* Ignore

* Create biome.json

* Ignore

* biome

* [autofix.ci] apply automated fixes

---------

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
Jarred Sumner
2024-01-25 19:15:26 -08:00
committed by GitHub
parent 045672cf67
commit e3188c918a
65 changed files with 839 additions and 1786 deletions

View File

@@ -19,9 +19,9 @@ export enum Loader {
ts = BunLoader.ts,
}
export interface TestReference {
name: string,
byteOffset: number,
kind: 'test' | 'describe',
name: string;
byteOffset: number;
kind: "test" | "describe";
}
export type { ScanResult, TransformResponse };
@@ -221,7 +221,7 @@ export class Bun {
} else {
const fs = await import("fs");
if (typeof url === 'string' && url.startsWith('file://')) {
if (typeof url === "string" && url.startsWith("file://")) {
url = new URL(url); // fs.readFileSync cannot consume URL strings, only URL objects
}
@@ -300,7 +300,7 @@ export class Bun {
),
),
byteOffset: response.tests[i].byteOffset,
kind: testKindMap[response.tests[i].kind] as 'test' | 'describe',
kind: testKindMap[response.tests[i].kind] as "test" | "describe",
};
}
@@ -309,7 +309,11 @@ export class Bun {
return tests;
}
static transformSync(content: Uint8Array | string, file_name: string, loader?: keyof typeof Loader): TransformResponse {
static transformSync(
content: Uint8Array | string,
file_name: string,
loader?: keyof typeof Loader,
): TransformResponse {
const bb = new ByteBuffer(Bun.scratch);
bb.length = 0;
bb.index = 0;