style(deps): migrated from Prettier to Biome and updated formatting rules

- Removed Prettier configuration files (.prettierignore and .prettierrc) and migrated formatting to Biome.
- Updated Biome configuration from version 2.3.11 to 2.3.12 and changed arrowParentheses rule from 'always' to 'asNeeded'.
- Pinned @biomejs/biome dependency to exact version 2.3.12 in package.json and bun.lock.
- Applied consistent arrow function formatting across 489 files by removing unnecessary parentheses around single parameters.
- Removed blank lines after comment blocks and reorganized imports for consistency across the codebase.
This commit is contained in:
can1357
2026-01-24 04:20:19 +01:00
parent f901befd19
commit 779ca4872b
489 changed files with 1900 additions and 2215 deletions
+8 -9
View File
@@ -6,7 +6,6 @@
* - Unified diff format (@@ -X,Y +A,B @@)
* - Codex-style wrapped patches (*** Begin Patch / *** End Patch)
*/
import type { DiffHunk } from "./types";
import { ApplyPatchError, ParseError } from "./types";
@@ -90,7 +89,7 @@ export function normalizeDiff(diff: string): string {
// Layer 2: Strip Codex-style file operation markers and unified diff metadata
// NOTE: Do NOT strip "*** End of File" - that's a valid marker within hunks, not a wrapper
// IMPORTANT: Only strip actual metadata lines, NOT diff content lines (starting with space, +, or -)
lines = lines.filter((line) => {
lines = lines.filter(line => {
// Preserve diff content lines even if their content looks like metadata
// Note: `--- ` and `+++ ` are metadata, not content lines
if (isDiffContentLine(line)) {
@@ -130,12 +129,12 @@ export function normalizeDiff(diff: string): string {
*/
export function normalizeCreateContent(content: string): string {
const lines = content.split("\n");
const nonEmptyLines = lines.filter((l) => l.length > 0);
const nonEmptyLines = lines.filter(l => l.length > 0);
// Check if all non-empty lines start with "+ " or "+"
if (nonEmptyLines.length > 0 && nonEmptyLines.every((l) => l.startsWith("+ ") || l.startsWith("+"))) {
if (nonEmptyLines.length > 0 && nonEmptyLines.every(l => l.startsWith("+ ") || l.startsWith("+"))) {
return lines
.map((l) => {
.map(l => {
if (l.startsWith("+ ")) return l.slice(2);
if (l.startsWith("+")) return l.slice(1);
return l;
@@ -390,18 +389,18 @@ function parseOneHunk(lines: string[], lineNumber: number, allowMissingContext:
}
function stripLineNumberPrefixes(hunk: DiffHunk): void {
const allLines = [...hunk.oldLines, ...hunk.newLines].filter((line) => line.trim().length > 0);
const allLines = [...hunk.oldLines, ...hunk.newLines].filter(line => line.trim().length > 0);
if (allLines.length < 2) return;
const numberMatches = allLines
.map((line) => line.match(/^\s*(\d{1,6})\s+(.+)$/u))
.map(line => line.match(/^\s*(\d{1,6})\s+(.+)$/u))
.filter((match): match is RegExpMatchArray => match !== null);
if (numberMatches.length < Math.max(2, Math.ceil(allLines.length * 0.6))) {
return;
}
const numbers = numberMatches.map((match) => Number(match[1]));
const numbers = numberMatches.map(match => Number(match[1]));
let sequential = 0;
for (let i = 1; i < numbers.length; i++) {
if (numbers[i] === numbers[i - 1] + 1) {
@@ -515,7 +514,7 @@ export function parseHunks(diff: string): DiffHunk[] {
continue;
}
if (trimmed.startsWith("@@") && lines.slice(i + 1).every((l) => l.trim() === "")) {
if (trimmed.startsWith("@@") && lines.slice(i + 1).every(l => l.trim() === "")) {
break;
}