From 20ecad55987d034102a38ed2f8256f4fa078fe2a Mon Sep 17 00:00:00 2001 From: asispts <79239132+asispts@users.noreply.github.com> Date: Mon, 13 Apr 2026 11:49:58 +0000 Subject: [PATCH 1/6] Fix import/no-named-as-default issues --- oxlint/baseline.config.json | 19 ++++++++++++++++++- src/backend/gitClient.ts | 2 +- src/backend/utils/git.ts | 2 +- tests/backend/actions/branch/checkout.test.ts | 2 +- tests/backend/actions/branch/create.test.ts | 2 +- tests/backend/actions/branch/delete.test.ts | 2 +- tests/backend/actions/branch/rename.test.ts | 2 +- tests/backend/actions/commit/checkout.test.ts | 2 +- .../backend/actions/commit/cherrypick.test.ts | 2 +- tests/backend/actions/commit/reset.test.ts | 2 +- tests/backend/actions/commit/revert.test.ts | 2 +- .../backend/actions/merge/mergeBranch.test.ts | 2 +- .../backend/actions/merge/mergeCommit.test.ts | 2 +- tests/backend/actions/tag/add.test.ts | 2 +- tests/backend/actions/tag/delete.test.ts | 2 +- tests/backend/actions/tag/push.test.ts | 2 +- .../backend/queries/commitDetails/get.test.ts | 2 +- .../backend/queries/loadBranches/list.test.ts | 2 +- .../backend/queries/loadCommits/list.test.ts | 2 +- 19 files changed, 36 insertions(+), 19 deletions(-) diff --git a/oxlint/baseline.config.json b/oxlint/baseline.config.json index a641091f..582b129f 100644 --- a/oxlint/baseline.config.json +++ b/oxlint/baseline.config.json @@ -4,7 +4,6 @@ // perf "eslint/no-await-in-loop": "off", // suspicious - "import/no-named-as-default": "off", "eslint/no-shadow": "off", "unicorn/require-post-message-target-origin": "off", "unicorn/no-array-sort": "off" @@ -21,6 +20,24 @@ "rules": { "eslint/no-undef": "off" } + }, + + // new directory should be strict by default + { + "files": [ + "src/backend/**/*.ts", + "src/extension/**/*.ts", + "src/webview/**/*.ts", + "tests/**/*.ts" + ], + "rules": { + // perf + // "eslint/no-await-in-loop": "error", + // suspicious + // "eslint/no-shadow": "error", + // "unicorn/require-post-message-target-origin": "error", + // "unicorn/no-array-sort": "error" + } } ] } diff --git a/src/backend/gitClient.ts b/src/backend/gitClient.ts index a7a14fcc..871cef8b 100644 --- a/src/backend/gitClient.ts +++ b/src/backend/gitClient.ts @@ -1,5 +1,5 @@ import type { SimpleGit } from "simple-git"; -import simpleGit from "simple-git"; +import { simpleGit } from "simple-git"; export type GitClient = ReturnType; export type GitInstance = GitClient["getInstance"]; diff --git a/src/backend/utils/git.ts b/src/backend/utils/git.ts index 0703053b..52b7ce48 100644 --- a/src/backend/utils/git.ts +++ b/src/backend/utils/git.ts @@ -1,4 +1,4 @@ -import simpleGit from "simple-git"; +import { simpleGit } from "simple-git"; export async function isGitRepository(repoPath: string, gitPath: string): Promise { try { diff --git a/tests/backend/actions/branch/checkout.test.ts b/tests/backend/actions/branch/checkout.test.ts index 569c0fdf..487c55e5 100644 --- a/tests/backend/actions/branch/checkout.test.ts +++ b/tests/backend/actions/branch/checkout.test.ts @@ -1,7 +1,7 @@ import * as cp from "node:child_process"; import * as fs from "node:fs"; -import simpleGit from "simple-git"; +import { simpleGit } from "simple-git"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; import { checkoutBranch } from "@/backend/actions/branch"; diff --git a/tests/backend/actions/branch/create.test.ts b/tests/backend/actions/branch/create.test.ts index 2c560830..44acee46 100644 --- a/tests/backend/actions/branch/create.test.ts +++ b/tests/backend/actions/branch/create.test.ts @@ -1,7 +1,7 @@ import * as cp from "node:child_process"; import * as fs from "node:fs"; -import simpleGit from "simple-git"; +import { simpleGit } from "simple-git"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; import { createBranch } from "@/backend/actions/branch"; diff --git a/tests/backend/actions/branch/delete.test.ts b/tests/backend/actions/branch/delete.test.ts index 7db642c2..0a9544d7 100644 --- a/tests/backend/actions/branch/delete.test.ts +++ b/tests/backend/actions/branch/delete.test.ts @@ -2,7 +2,7 @@ import * as cp from "node:child_process"; import * as fs from "node:fs"; import * as path from "node:path"; -import simpleGit from "simple-git"; +import { simpleGit } from "simple-git"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; import { deleteBranch } from "@/backend/actions/branch"; diff --git a/tests/backend/actions/branch/rename.test.ts b/tests/backend/actions/branch/rename.test.ts index c951db1d..3b23c825 100644 --- a/tests/backend/actions/branch/rename.test.ts +++ b/tests/backend/actions/branch/rename.test.ts @@ -1,7 +1,7 @@ import * as cp from "node:child_process"; import * as fs from "node:fs"; -import simpleGit from "simple-git"; +import { simpleGit } from "simple-git"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; import { renameBranch } from "@/backend/actions/branch"; diff --git a/tests/backend/actions/commit/checkout.test.ts b/tests/backend/actions/commit/checkout.test.ts index e6106a24..630c5ccb 100644 --- a/tests/backend/actions/commit/checkout.test.ts +++ b/tests/backend/actions/commit/checkout.test.ts @@ -1,7 +1,7 @@ import * as cp from "node:child_process"; import * as fs from "node:fs"; -import simpleGit from "simple-git"; +import { simpleGit } from "simple-git"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; import { checkoutCommit } from "@/backend/actions/commit"; diff --git a/tests/backend/actions/commit/cherrypick.test.ts b/tests/backend/actions/commit/cherrypick.test.ts index 448ad0d2..dcbd4f1b 100644 --- a/tests/backend/actions/commit/cherrypick.test.ts +++ b/tests/backend/actions/commit/cherrypick.test.ts @@ -2,7 +2,7 @@ import * as cp from "node:child_process"; import * as fs from "node:fs"; import * as path from "node:path"; -import simpleGit from "simple-git"; +import { simpleGit } from "simple-git"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; import { cherrypickCommit } from "@/backend/actions/commit"; diff --git a/tests/backend/actions/commit/reset.test.ts b/tests/backend/actions/commit/reset.test.ts index 368841e7..656693b5 100644 --- a/tests/backend/actions/commit/reset.test.ts +++ b/tests/backend/actions/commit/reset.test.ts @@ -2,7 +2,7 @@ import * as cp from "node:child_process"; import * as fs from "node:fs"; import * as path from "node:path"; -import simpleGit from "simple-git"; +import { simpleGit } from "simple-git"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; import { resetToCommit } from "@/backend/actions/commit"; diff --git a/tests/backend/actions/commit/revert.test.ts b/tests/backend/actions/commit/revert.test.ts index 82dc7f31..adcb507b 100644 --- a/tests/backend/actions/commit/revert.test.ts +++ b/tests/backend/actions/commit/revert.test.ts @@ -2,7 +2,7 @@ import * as cp from "node:child_process"; import * as fs from "node:fs"; import * as path from "node:path"; -import simpleGit from "simple-git"; +import { simpleGit } from "simple-git"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; import { revertCommit } from "@/backend/actions/commit"; diff --git a/tests/backend/actions/merge/mergeBranch.test.ts b/tests/backend/actions/merge/mergeBranch.test.ts index ce5a53f4..6d568deb 100644 --- a/tests/backend/actions/merge/mergeBranch.test.ts +++ b/tests/backend/actions/merge/mergeBranch.test.ts @@ -2,7 +2,7 @@ import * as cp from "node:child_process"; import * as fs from "node:fs"; import * as path from "node:path"; -import simpleGit from "simple-git"; +import { simpleGit } from "simple-git"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; import { mergeBranch } from "@/backend/actions/merge"; diff --git a/tests/backend/actions/merge/mergeCommit.test.ts b/tests/backend/actions/merge/mergeCommit.test.ts index 5323b92d..1d06f074 100644 --- a/tests/backend/actions/merge/mergeCommit.test.ts +++ b/tests/backend/actions/merge/mergeCommit.test.ts @@ -2,7 +2,7 @@ import * as cp from "node:child_process"; import * as fs from "node:fs"; import * as path from "node:path"; -import simpleGit from "simple-git"; +import { simpleGit } from "simple-git"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; import { mergeCommit } from "@/backend/actions/merge"; diff --git a/tests/backend/actions/tag/add.test.ts b/tests/backend/actions/tag/add.test.ts index 69d03628..b6c08743 100644 --- a/tests/backend/actions/tag/add.test.ts +++ b/tests/backend/actions/tag/add.test.ts @@ -1,7 +1,7 @@ import * as cp from "node:child_process"; import * as fs from "node:fs"; -import simpleGit from "simple-git"; +import { simpleGit } from "simple-git"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; import { addTag } from "@/backend/actions/tag"; diff --git a/tests/backend/actions/tag/delete.test.ts b/tests/backend/actions/tag/delete.test.ts index 7bce8226..71d070ee 100644 --- a/tests/backend/actions/tag/delete.test.ts +++ b/tests/backend/actions/tag/delete.test.ts @@ -1,7 +1,7 @@ import * as cp from "node:child_process"; import * as fs from "node:fs"; -import simpleGit from "simple-git"; +import { simpleGit } from "simple-git"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; import { deleteTag } from "@/backend/actions/tag"; diff --git a/tests/backend/actions/tag/push.test.ts b/tests/backend/actions/tag/push.test.ts index 0fcfeb93..57872535 100644 --- a/tests/backend/actions/tag/push.test.ts +++ b/tests/backend/actions/tag/push.test.ts @@ -3,7 +3,7 @@ import * as fs from "node:fs"; import * as os from "node:os"; import * as path from "node:path"; -import simpleGit from "simple-git"; +import { simpleGit } from "simple-git"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; import { pushTag } from "@/backend/actions/tag"; diff --git a/tests/backend/queries/commitDetails/get.test.ts b/tests/backend/queries/commitDetails/get.test.ts index 896fce95..758a39e1 100644 --- a/tests/backend/queries/commitDetails/get.test.ts +++ b/tests/backend/queries/commitDetails/get.test.ts @@ -2,7 +2,7 @@ import * as cp from "node:child_process"; import * as fs from "node:fs"; import * as path from "node:path"; -import simpleGit from "simple-git"; +import { simpleGit } from "simple-git"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; import { commitDetails } from "@/backend/queries/commitDetails"; diff --git a/tests/backend/queries/loadBranches/list.test.ts b/tests/backend/queries/loadBranches/list.test.ts index c2aee292..e8a9f5b5 100644 --- a/tests/backend/queries/loadBranches/list.test.ts +++ b/tests/backend/queries/loadBranches/list.test.ts @@ -2,7 +2,7 @@ import * as cp from "node:child_process"; import * as fs from "node:fs"; import * as os from "node:os"; -import simpleGit from "simple-git"; +import { simpleGit } from "simple-git"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; import { loadBranches } from "@/backend/queries/loadBranches"; diff --git a/tests/backend/queries/loadCommits/list.test.ts b/tests/backend/queries/loadCommits/list.test.ts index fccd1a80..d0eb1186 100644 --- a/tests/backend/queries/loadCommits/list.test.ts +++ b/tests/backend/queries/loadCommits/list.test.ts @@ -1,7 +1,7 @@ import * as fs from "node:fs"; import * as path from "node:path"; -import simpleGit from "simple-git"; +import { simpleGit } from "simple-git"; import { afterAll, beforeAll, describe, expect, it } from "vitest"; import { loadCommits } from "@/backend/queries/loadCommits"; From 94fffe468174df978478ca2780eb5097dd0eb4cb Mon Sep 17 00:00:00 2001 From: asispts <79239132+asispts@users.noreply.github.com> Date: Mon, 13 Apr 2026 12:13:23 +0000 Subject: [PATCH 2/6] Fix no-shadow issues --- oxlint/baseline.config.json | 2 +- src/backend/utils/path.ts | 8 ++++---- src/webview/main.ts | 26 ++++++++++++------------ tests/extension/workspaceWatcher.test.ts | 1 - 4 files changed, 18 insertions(+), 19 deletions(-) diff --git a/oxlint/baseline.config.json b/oxlint/baseline.config.json index 582b129f..46a07fcb 100644 --- a/oxlint/baseline.config.json +++ b/oxlint/baseline.config.json @@ -34,7 +34,7 @@ // perf // "eslint/no-await-in-loop": "error", // suspicious - // "eslint/no-shadow": "error", + "eslint/no-shadow": "error" // "unicorn/require-post-message-target-origin": "error", // "unicorn/no-array-sort": "error" } diff --git a/src/backend/utils/path.ts b/src/backend/utils/path.ts index b8d916cb..e524555a 100644 --- a/src/backend/utils/path.ts +++ b/src/backend/utils/path.ts @@ -5,17 +5,17 @@ import * as vscode from "vscode"; const FS_REGEX = /\\/g; -export function isDirectory(path: string) { +export function isDirectory(filePath: string) { return new Promise((resolve) => { - fs.stat(path, (err, stats) => { + fs.stat(filePath, (err, stats) => { resolve(err ? false : stats.isDirectory()); }); }); } -export function doesPathExist(path: string) { +export function doesPathExist(filePath: string) { return new Promise((resolve) => { - fs.stat(path, (err) => resolve(!err)); + fs.stat(filePath, (err) => resolve(!err)); }); } diff --git a/src/webview/main.ts b/src/webview/main.ts index 9609360d..f48b4c50 100644 --- a/src/webview/main.ts +++ b/src/webview/main.ts @@ -218,8 +218,8 @@ class GitGraphView { commits, (a, b) => a.hash === b.hash && - arraysEqual(a.refs, b.refs, (a, b) => a.name === b.name && a.type === b.type) && - arraysEqual(a.parentHashes, b.parentHashes, (a, b) => a === b) + arraysEqual(a.refs, b.refs, (ra, rb) => ra.name === rb.name && ra.type === rb.type) && + arraysEqual(a.parentHashes, b.parentHashes, (pa, pb) => pa === pb) ) ) { if (this.commits.length > 0 && this.commits[0].hash === "*") { @@ -612,11 +612,11 @@ class GitGraphView { ); } else { let options = this.commits[this.commitLookup[hash]].parentHashes.map( - (hash, index) => ({ + (parentHash, index) => ({ name: - abbrevCommit(hash) + - (typeof this.commitLookup[hash] === "number" - ? ": " + this.commits[this.commitLookup[hash]].message + abbrevCommit(parentHash) + + (typeof this.commitLookup[parentHash] === "number" + ? ": " + this.commits[this.commitLookup[parentHash]].message : ""), value: (index + 1).toString() }) @@ -663,11 +663,11 @@ class GitGraphView { ); } else { let options = this.commits[this.commitLookup[hash]].parentHashes.map( - (hash, index) => ({ + (parentHash, index) => ({ name: - abbrevCommit(hash) + - (typeof this.commitLookup[hash] === "number" - ? ": " + this.commits[this.commitLookup[hash]].message + abbrevCommit(parentHash) + + (typeof this.commitLookup[parentHash] === "number" + ? ": " + this.commits[this.commitLookup[parentHash]].message : ""), value: (index + 1).toString() }) @@ -1567,10 +1567,10 @@ function showContextMenu(e: MouseEvent, items: ContextMenuElement[], sourceElem: : event.pageY - bounds.height + 2) + "px"; contextMenu.style.opacity = "1"; - addListenerToClass("contextMenuItem", "click", (e) => { - e.stopPropagation(); + addListenerToClass("contextMenuItem", "click", (ev) => { + ev.stopPropagation(); hideContextMenu(); - items[parseInt((e.target).dataset.index!)]!.onClick(); + items[parseInt((ev.target).dataset.index!)]!.onClick(); }); contextMenuSource = sourceElem; diff --git a/tests/extension/workspaceWatcher.test.ts b/tests/extension/workspaceWatcher.test.ts index 28cd623e..cde64ae9 100644 --- a/tests/extension/workspaceWatcher.test.ts +++ b/tests/extension/workspaceWatcher.test.ts @@ -47,7 +47,6 @@ function makeStubs(initialFolders: string[] = []) { const config = { maxDepthOfRepoSearch: () => 2 }; // Capture watcher handles and folder-change handler so tests can fire events - type StubUri = { fsPath: string }; type WatcherHandle = { pattern: string; fireCreate: (uri: StubUri) => void; From 05df18c35cae726ca48661b04253379444572973 Mon Sep 17 00:00:00 2001 From: asispts <79239132+asispts@users.noreply.github.com> Date: Mon, 13 Apr 2026 12:17:45 +0000 Subject: [PATCH 3/6] Fix no-array-sort issues --- oxlint/baseline.config.json | 6 ++---- scripts/check-l10n.js | 8 ++++---- src/extension/repoManager.ts | 2 +- src/tsconfig.json | 2 +- tests/backend/utils/repoSearch.test.ts | 2 +- tests/tsconfig.json | 2 +- 6 files changed, 10 insertions(+), 12 deletions(-) diff --git a/oxlint/baseline.config.json b/oxlint/baseline.config.json index 46a07fcb..453c8e40 100644 --- a/oxlint/baseline.config.json +++ b/oxlint/baseline.config.json @@ -5,8 +5,7 @@ "eslint/no-await-in-loop": "off", // suspicious "eslint/no-shadow": "off", - "unicorn/require-post-message-target-origin": "off", - "unicorn/no-array-sort": "off" + "unicorn/require-post-message-target-origin": "off" }, "overrides": [ { @@ -35,8 +34,7 @@ // "eslint/no-await-in-loop": "error", // suspicious "eslint/no-shadow": "error" - // "unicorn/require-post-message-target-origin": "error", - // "unicorn/no-array-sort": "error" + // "unicorn/require-post-message-target-origin": "error" } } ] diff --git a/scripts/check-l10n.js b/scripts/check-l10n.js index dba2dee3..7c93d0a4 100755 --- a/scripts/check-l10n.js +++ b/scripts/check-l10n.js @@ -40,7 +40,7 @@ function extractPlaceholders(text) { } // Return sorted array for consistent comparison - return placeholders.sort(); + return placeholders.toSorted(); } /** @@ -84,13 +84,13 @@ function checkFileSet(baseDir, baseFileName, filePattern, sectionTitle) { files = fs .readdirSync(baseDir) .filter((file) => file.startsWith(filePattern) && file !== baseFileName) - .sort(); + .toSorted(); } else { // For bundle.l10n files, look in l10n directory files = fs .readdirSync(baseDir) .filter((file) => file.startsWith(filePattern) && file !== baseFileName) - .sort(); + .toSorted(); } if (files.length === 0) { @@ -208,7 +208,7 @@ function printCoverageSummary(allStats) { }); Object.keys(localeMap) - .sort() + .toSorted() .forEach((locale) => { const bundleCov = localeMap[locale]["bundle"] !== undefined ? `${localeMap[locale]["bundle"]}%` : "N/A"; diff --git a/src/extension/repoManager.ts b/src/extension/repoManager.ts index 4b842aff..005cc615 100644 --- a/src/extension/repoManager.ts +++ b/src/extension/repoManager.ts @@ -9,7 +9,7 @@ import { StatusBarItem } from "@/statusBarItem"; import { GitRepoSet, GitRepoState } from "@/types"; function sortRepos(repos: GitRepoSet) { - const repoPaths = Object.keys(repos).sort(); + const repoPaths = Object.keys(repos).toSorted(); const sorted: GitRepoSet = {}; for (let i = 0; i < repoPaths.length; i++) { sorted[repoPaths[i]] = repos[repoPaths[i]]; diff --git a/src/tsconfig.json b/src/tsconfig.json index 6db408dd..45fe5a1b 100644 --- a/src/tsconfig.json +++ b/src/tsconfig.json @@ -4,7 +4,7 @@ "paths": { "@/*": ["./*"] }, - "lib": ["es2020"], + "lib": ["es2023"], "module": "commonjs", "outDir": "../out", "noFallthroughCasesInSwitch": true, diff --git a/tests/backend/utils/repoSearch.test.ts b/tests/backend/utils/repoSearch.test.ts index d1ee8a55..8fe90f89 100644 --- a/tests/backend/utils/repoSearch.test.ts +++ b/tests/backend/utils/repoSearch.test.ts @@ -96,7 +96,7 @@ describe("searchDirectoryForRepos", () => { it("finds nested repos when depth allows", async () => { const result = await searchDirectoryForRepos(tmpDir, 2, "git", []); - expect(result.sort()).toEqual([repoA, repoB].sort()); + expect(result.toSorted()).toEqual([repoA, repoB].toSorted()); }); it("does not return .git subdirectory as a repo", async () => { diff --git a/tests/tsconfig.json b/tests/tsconfig.json index c257d812..8755ae71 100644 --- a/tests/tsconfig.json +++ b/tests/tsconfig.json @@ -7,7 +7,7 @@ }, "module": "commonjs", "target": "es6", - "lib": ["es2020", "dom"], + "lib": ["es2023", "dom"], "strict": true, "noImplicitAny": true, "skipLibCheck": true From b4692aac2da8d1cc7c98438a537731fa23d441df Mon Sep 17 00:00:00 2001 From: asispts <79239132+asispts@users.noreply.github.com> Date: Mon, 13 Apr 2026 12:25:10 +0000 Subject: [PATCH 4/6] unicorn/require-post-message-target-origin is a false-positive --- .oxlintrc.json | 3 ++- oxlint/baseline.config.json | 4 +--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.oxlintrc.json b/.oxlintrc.json index 3e59483c..73faff3b 100644 --- a/.oxlintrc.json +++ b/.oxlintrc.json @@ -56,7 +56,8 @@ "variables": "suggestion" } } - ] + ], + "unicorn/require-post-message-target-origin": "allow" // false-positive }, "overrides": [ { diff --git a/oxlint/baseline.config.json b/oxlint/baseline.config.json index 453c8e40..7d8a2a1b 100644 --- a/oxlint/baseline.config.json +++ b/oxlint/baseline.config.json @@ -4,8 +4,7 @@ // perf "eslint/no-await-in-loop": "off", // suspicious - "eslint/no-shadow": "off", - "unicorn/require-post-message-target-origin": "off" + "eslint/no-shadow": "off" }, "overrides": [ { @@ -34,7 +33,6 @@ // "eslint/no-await-in-loop": "error", // suspicious "eslint/no-shadow": "error" - // "unicorn/require-post-message-target-origin": "error" } } ] From 14d76d396ae9ef828c33f818107ca2c90bfd8d04 Mon Sep 17 00:00:00 2001 From: asispts <79239132+asispts@users.noreply.github.com> Date: Mon, 13 Apr 2026 12:44:58 +0000 Subject: [PATCH 5/6] Enable no-await-in-loop --- oxlint/baseline.config.json | 18 ++++++++++++++---- tests/extension/extension.test.ts | 2 +- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/oxlint/baseline.config.json b/oxlint/baseline.config.json index 7d8a2a1b..16f7c49e 100644 --- a/oxlint/baseline.config.json +++ b/oxlint/baseline.config.json @@ -1,8 +1,6 @@ { "$schema": "../node_modules/oxlint/configuration_schema.json", "rules": { - // perf - "eslint/no-await-in-loop": "off", // suspicious "eslint/no-shadow": "off" }, @@ -29,11 +27,23 @@ "tests/**/*.ts" ], "rules": { - // perf - // "eslint/no-await-in-loop": "error", // suspicious "eslint/no-shadow": "error" } + }, + + // needs refactor + { + "files": [ + "src/extension/workspaceSearch.ts", + "src/backend/queries/loadCommits.ts", + "src/backend/utils/repoSearch.ts", + "src/extension/workspaceWatcher.ts" + ], + "rules": { + // perf + "eslint/no-await-in-loop": "allow" + } } ] } diff --git a/tests/extension/extension.test.ts b/tests/extension/extension.test.ts index e9ae70e0..1d3f76d9 100644 --- a/tests/extension/extension.test.ts +++ b/tests/extension/extension.test.ts @@ -27,7 +27,7 @@ suite("GitGraphPanel", () => { await vscode.commands.executeCommand("neo-git-graph.view"); const deadline = Date.now() + 2000; while (!isPanelOpen() && Date.now() < deadline) { - await new Promise((r) => setTimeout(r, 50)); + await new Promise((r) => setTimeout(r, 50)); // eslint-disable-line no-await-in-loop } } From be4a00c1e3c8a39e5f7374c2d40b0cfa7bc24c59 Mon Sep 17 00:00:00 2001 From: asispts <79239132+asispts@users.noreply.github.com> Date: Mon, 13 Apr 2026 12:46:38 +0000 Subject: [PATCH 6/6] Enable no-shadow rule --- oxlint/baseline.config.json | 19 +------------------ src/diffDocProvider.ts | 6 +++--- src/extensionState.ts | 4 ++-- 3 files changed, 6 insertions(+), 23 deletions(-) diff --git a/oxlint/baseline.config.json b/oxlint/baseline.config.json index 16f7c49e..85e8b743 100644 --- a/oxlint/baseline.config.json +++ b/oxlint/baseline.config.json @@ -1,9 +1,6 @@ { "$schema": "../node_modules/oxlint/configuration_schema.json", - "rules": { - // suspicious - "eslint/no-shadow": "off" - }, + "rules": {}, "overrides": [ { "files": ["src/webview/**/*.ts"], @@ -18,20 +15,6 @@ } }, - // new directory should be strict by default - { - "files": [ - "src/backend/**/*.ts", - "src/extension/**/*.ts", - "src/webview/**/*.ts", - "tests/**/*.ts" - ], - "rules": { - // suspicious - "eslint/no-shadow": "error" - } - }, - // needs refactor { "files": [ diff --git a/src/diffDocProvider.ts b/src/diffDocProvider.ts index 083d0a8f..4bddc0b4 100644 --- a/src/diffDocProvider.ts +++ b/src/diffDocProvider.ts @@ -37,9 +37,9 @@ export class DiffDocProvider implements vscode.TextDocumentContentProvider { .show([`${request.commit}:${request.filePath}`]) .catch(() => "") .then((data) => { - let document = new DiffDocument(data); - this.docs.set(uri.toString(), document); - return document.value; + let doc = new DiffDocument(data); + this.docs.set(uri.toString(), doc); + return doc.value; }); } } diff --git a/src/extensionState.ts b/src/extensionState.ts index 5a73609f..d77b990a 100644 --- a/src/extensionState.ts +++ b/src/extensionState.ts @@ -26,8 +26,8 @@ export class ExtensionState { this.avatarStorageAvailable = true; } else { fs.mkdir(this.globalStoragePath, () => { - fs.mkdir(this.globalStoragePath + AVATAR_STORAGE_FOLDER, (err) => { - if (!err) this.avatarStorageAvailable = true; + fs.mkdir(this.globalStoragePath + AVATAR_STORAGE_FOLDER, (mkdirErr) => { + if (!mkdirErr) this.avatarStorageAvailable = true; }); }); }