chore: more lint cleanup.

This commit is contained in:
cpojer
2026-01-31 16:16:13 +09:00
parent b7e401b6b6
commit 009b16fab8
3 changed files with 15 additions and 18 deletions

View File

@@ -1,28 +1,23 @@
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": [
"unicorn",
"typescript",
"oxc"
],
"plugins": ["unicorn", "typescript", "oxc"],
"categories": {
"correctness": "error",
"perf": "error",
"suspicious": "error",
"suspicious": "error"
},
"rules": {
"eslint-plugin-unicorn/prefer-array-find": "off",
"eslint/no-await-in-loop": "off",
"oxc/no-accumulating-spread": "off",
"oxc/no-map-spread": "off",
"typescript/no-unsafe-type-assertion": "off",
"typescript/no-unnecessary-template-expression": "off",
"unicorn/consistent-function-scoping": "off",
"unicorn/require-post-message-target-origin": "off",
"typescript/no-extraneous-class": "off",
"oxc/no-async-endpoint-handlers": "off",
"eslint/no-new": "off",
"eslint/preserve-caught-error": "off",
"oxc/no-accumulating-spread": "off",
"oxc/no-async-endpoint-handlers": "off",
"oxc/no-map-spread": "off",
"typescript/no-extraneous-class": "off",
"typescript/no-unnecessary-template-expression": "off",
"typescript/no-unsafe-type-assertion": "off",
"unicorn/consistent-function-scoping": "off",
"unicorn/require-post-message-target-origin": "off"
},
"ignorePatterns": ["src/canvas-host/a2ui/a2ui.bundle.js"]
}

View File

@@ -419,8 +419,10 @@ export async function autoMigrateLegacyStateDir(params: {
}
} catch (fallbackErr) {
try {
if (!legacyDir)
throw new Error("Legacy state dir not found", { cause: err }, { cause: fallbackErr });
if (!legacyDir) {
// oxlint-disable-next-line preserve-caught-error
throw new Error("Legacy state dir not found", { cause: fallbackErr });
}
fs.renameSync(targetDir, legacyDir);
warnings.push(
`State dir migration rolled back (failed to link legacy path): ${String(fallbackErr)}`,

View File

@@ -181,9 +181,9 @@ export async function createEmbeddingProvider(
fallbackReason: reason,
};
} catch (fallbackErr) {
// oxlint-disable-next-line preserve-caught-error
throw new Error(
`${reason}\n\nFallback to ${fallback} failed: ${formatError(fallbackErr)}`,
{ cause: primaryErr },
{ cause: fallbackErr },
);
}