Switch to double quotes and reformat codebase with Biome

This commit is contained in:
Mohamed Boudra
2026-03-21 20:22:15 +07:00
parent ab40786882
commit f6579dbeb4
805 changed files with 38132 additions and 40175 deletions
+17 -35
View File
@@ -306,17 +306,13 @@ describe("highlightDiffFile", () => {
const hunk = highlighted.hunks[0];
// Removed line: "const bar = 2;"
const removedLine = hunk.lines.find(
(l) => l.type === "remove" && l.content.includes("bar")
);
const removedLine = hunk.lines.find((l) => l.type === "remove" && l.content.includes("bar"));
expect(removedLine?.tokens).toBeDefined();
const removedNumber = removedLine!.tokens!.find((t) => t.text === "2");
expect(removedNumber?.style).toBe("number");
// Added line: "const bar = 3;"
const addedLine = hunk.lines.find(
(l) => l.type === "add" && l.content.includes("bar")
);
const addedLine = hunk.lines.find((l) => l.type === "add" && l.content.includes("bar"));
expect(addedLine?.tokens).toBeDefined();
const addedNumber = addedLine!.tokens!.find((t) => t.text === "3");
expect(addedNumber?.style).toBe("number");
@@ -361,12 +357,10 @@ describe("highlightDiffFile", () => {
expect(fnLine.tokens!.some((t) => t.text === "fn" && t.style === "keyword")).toBe(true);
const addedLine = hunk.lines.find(
(line) => line.type === "add" && line.content.includes("version")
(line) => line.type === "add" && line.content.includes("version"),
);
expect(addedLine?.tokens).toBeDefined();
expect(
addedLine!.tokens!.some((t) => t.text === "2" && t.style === "number")
).toBe(true);
expect(addedLine!.tokens!.some((t) => t.text === "2" && t.style === "number")).toBe(true);
});
it("adds syntax highlighting tokens to C code", () => {
@@ -379,12 +373,10 @@ describe("highlightDiffFile", () => {
expect(mainLine.tokens!.length).toBeGreaterThan(0);
const addedLine = hunk.lines.find(
(line) => line.type === "add" && line.content.includes("version")
(line) => line.type === "add" && line.content.includes("version"),
);
expect(addedLine?.tokens).toBeDefined();
expect(
addedLine!.tokens!.some((t) => t.text === "2" && t.style === "number")
).toBe(true);
expect(addedLine!.tokens!.some((t) => t.text === "2" && t.style === "number")).toBe(true);
});
it("adds syntax highlighting tokens to Java code", () => {
@@ -394,17 +386,13 @@ describe("highlightDiffFile", () => {
const classLine = hunk.lines[1];
expect(classLine.tokens).toBeDefined();
expect(
classLine.tokens!.some((t) => t.text === "public" && t.style === "keyword")
).toBe(true);
expect(classLine.tokens!.some((t) => t.text === "public" && t.style === "keyword")).toBe(true);
const addedLine = hunk.lines.find(
(line) => line.type === "add" && line.content.includes("version")
(line) => line.type === "add" && line.content.includes("version"),
);
expect(addedLine?.tokens).toBeDefined();
expect(
addedLine!.tokens!.some((t) => t.text === "2" && t.style === "number")
).toBe(true);
expect(addedLine!.tokens!.some((t) => t.text === "2" && t.style === "number")).toBe(true);
});
it("adds syntax highlighting tokens to Objective-C file extensions", () => {
@@ -413,45 +401,39 @@ describe("highlightDiffFile", () => {
const hunk = highlighted.hunks[0];
const addedLine = hunk.lines.find(
(line) => line.type === "add" && line.content.includes("version")
(line) => line.type === "add" && line.content.includes("version"),
);
expect(addedLine?.tokens).toBeDefined();
expect(
addedLine!.tokens!.some((t) => t.text === "2" && t.style === "number")
).toBe(true);
expect(addedLine!.tokens!.some((t) => t.text === "2" && t.style === "number")).toBe(true);
});
it("adds syntax highlighting tokens to Go code", () => {
const files = parseDiff(GO_DIFF);
const highlighted = highlightDiffFile(files[0]);
const addedLine = highlighted.hunks[0].lines.find(
(line) => line.type === "add" && line.content.includes("version")
(line) => line.type === "add" && line.content.includes("version"),
);
expect(addedLine?.tokens).toBeDefined();
expect(
addedLine!.tokens!.some((t) => t.text === "2" && t.style === "number")
).toBe(true);
expect(addedLine!.tokens!.some((t) => t.text === "2" && t.style === "number")).toBe(true);
});
it("adds syntax highlighting tokens to PHP code", () => {
const files = parseDiff(PHP_DIFF);
const highlighted = highlightDiffFile(files[0]);
const addedLine = highlighted.hunks[0].lines.find(
(line) => line.type === "add" && line.content.includes("$version")
(line) => line.type === "add" && line.content.includes("$version"),
);
expect(addedLine?.tokens).toBeDefined();
expect(
addedLine!.tokens!.some((t) => t.text === "2" && t.style === "number")
).toBe(true);
expect(addedLine!.tokens!.some((t) => t.text === "2" && t.style === "number")).toBe(true);
});
it("adds syntax highlighting tokens to YAML code", () => {
const files = parseDiff(YAML_DIFF);
const highlighted = highlightDiffFile(files[0]);
const addedLine = highlighted.hunks[0].lines.find(
(line) => line.type === "add" && line.content.includes("count")
(line) => line.type === "add" && line.content.includes("count"),
);
expect(addedLine?.tokens).toBeDefined();
@@ -462,7 +444,7 @@ describe("highlightDiffFile", () => {
const files = parseDiff(XML_DIFF);
const highlighted = highlightDiffFile(files[0]);
const addedLine = highlighted.hunks[0].lines.find(
(line) => line.type === "add" && line.content.includes("<count>")
(line) => line.type === "add" && line.content.includes("<count>"),
);
expect(addedLine?.tokens).toBeDefined();