Skip to content

Commit 5559b54

Browse files
Ian Allowayclaude
andcommitted
fix(lint): use Number.parseInt and Array.from per oxlint rules
Replace global `parseInt` with `Number.parseInt` and `new Array(n)` with `Array.from({ length: n })` to pass the unicorn lint rules. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
1 parent b6c8104 commit 5559b54

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/agents/sessions/tools/edit-diff.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,8 @@ function levenshtein(a: string, b: string): number {
308308
if (n === 0) {
309309
return m;
310310
}
311-
let prev = new Array<number>(n + 1);
312-
let curr = new Array<number>(n + 1);
311+
let prev = Array.from<number>({ length: n + 1 });
312+
let curr = Array.from<number>({ length: n + 1 });
313313
for (let j = 0; j <= n; j++) {
314314
prev[j] = j;
315315
}

src/agents/sessions/tools/edit.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ function pickUnmatchedOldText(error: Error, edits: Edit[]): string {
180180
// Batch errors name the failing edit by index: "Could not find edits[i] in ..."
181181
const batchMatch = error.message.match(/Could not find edits\[(\d+)\]/);
182182
if (batchMatch) {
183-
const idx = parseInt(batchMatch[1], 10);
183+
const idx = Number.parseInt(batchMatch[1], 10);
184184
return edits[idx]?.oldText ?? edits[0]?.oldText ?? "";
185185
}
186186
// Single-edit mismatch: only one candidate.

0 commit comments

Comments
 (0)