Run Biome formatter and add formatting guidance to CLAUDE.md

This commit is contained in:
Mohamed Boudra
2026-04-12 10:40:14 +07:00
parent 40e27f5a00
commit 56512d852b
7 changed files with 60 additions and 55 deletions
@@ -37,18 +37,17 @@ describe("splitMarkdownBlocks", () => {
it("splits mixed paragraph, code fence, and paragraph content into three blocks", () => {
expect(
splitMarkdownBlocks("Intro paragraph\n\n```ts\nconst a = 1;\n\nconst b = 2;\n```\n\nOutro paragraph"),
).toEqual([
"Intro paragraph",
"```ts\nconst a = 1;\n\nconst b = 2;\n```",
"Outro paragraph",
]);
splitMarkdownBlocks(
"Intro paragraph\n\n```ts\nconst a = 1;\n\nconst b = 2;\n```\n\nOutro paragraph",
),
).toEqual(["Intro paragraph", "```ts\nconst a = 1;\n\nconst b = 2;\n```", "Outro paragraph"]);
});
it("keeps everything from an unclosed fence start as one block for streaming content", () => {
expect(
splitMarkdownBlocks("Before fence\n\n```ts\nconst a = 1;\n\nconst b = 2;"),
).toEqual(["Before fence", "```ts\nconst a = 1;\n\nconst b = 2;"]);
expect(splitMarkdownBlocks("Before fence\n\n```ts\nconst a = 1;\n\nconst b = 2;")).toEqual([
"Before fence",
"```ts\nconst a = 1;\n\nconst b = 2;",
]);
});
it("returns an empty array for empty input", () => {
@@ -43,10 +43,7 @@ export function splitMarkdownBlocks(text: string): string[] {
continue;
}
if (
fenceDelimiter[0] === activeFenceCharacter &&
fenceDelimiter.length >= activeFenceLength
) {
if (fenceDelimiter[0] === activeFenceCharacter && fenceDelimiter.length >= activeFenceLength) {
activeFenceCharacter = null;
activeFenceLength = 0;
}