From 009b16fab82e14dcecfbef2dac5582505e30b730 Mon Sep 17 00:00:00 2001 From: cpojer Date: Sat, 31 Jan 2026 16:16:13 +0900 Subject: [PATCH] chore: more lint cleanup. --- .oxlintrc.json | 25 ++++++++++--------------- src/infra/state-migrations.ts | 6 ++++-- src/memory/embeddings.ts | 2 +- 3 files changed, 15 insertions(+), 18 deletions(-) diff --git a/.oxlintrc.json b/.oxlintrc.json index 3771300077..0347622a24 100644 --- a/.oxlintrc.json +++ b/.oxlintrc.json @@ -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"] } diff --git a/src/infra/state-migrations.ts b/src/infra/state-migrations.ts index 59f18971c6..df247902c8 100644 --- a/src/infra/state-migrations.ts +++ b/src/infra/state-migrations.ts @@ -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)}`, diff --git a/src/memory/embeddings.ts b/src/memory/embeddings.ts index 20f35c6482..6e923cb383 100644 --- a/src/memory/embeddings.ts +++ b/src/memory/embeddings.ts @@ -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 }, ); }