From 99701380090476d6f0cc7a58189e5b5249ca65bc Mon Sep 17 00:00:00 2001 From: Don Isaac Date: Mon, 14 Oct 2024 23:20:21 -0400 Subject: [PATCH] chore(oxlint): configure rule categories in oxlint.json (#8494) Co-authored-by: LongYinan --- oxlint.json | 4 ++++ package.json | 2 +- .../core/src/blocksuite/presets/ai/chat-panel/chat-cards.ts | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/oxlint.json b/oxlint.json index 5576db37da..c845c7ced8 100644 --- a/oxlint.json +++ b/oxlint.json @@ -1,4 +1,8 @@ { + "categories": { + "correctness": "error", + "perf": "error" + }, "rules": { // allow "import/named": "allow", diff --git a/package.json b/package.json index a49de1f566..52761a7d10 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,7 @@ "lint:eslint:fix": "yarn lint:eslint --fix", "lint:prettier": "prettier --ignore-unknown --cache --check .", "lint:prettier:fix": "prettier --ignore-unknown --cache --write .", - "lint:ox": "oxlint -c oxlint.json --deny-warnings --import-plugin -D correctness -D perf", + "lint:ox": "oxlint -c oxlint.json --deny-warnings --import-plugin", "lint": "yarn lint:eslint && yarn lint:prettier", "lint:fix": "yarn lint:eslint:fix && yarn lint:prettier:fix", "test": "vitest --run", diff --git a/packages/frontend/core/src/blocksuite/presets/ai/chat-panel/chat-cards.ts b/packages/frontend/core/src/blocksuite/presets/ai/chat-panel/chat-cards.ts index 41f2343c80..938f4b8fa6 100644 --- a/packages/frontend/core/src/blocksuite/presets/ai/chat-panel/chat-cards.ts +++ b/packages/frontend/core/src/blocksuite/presets/ai/chat-panel/chat-cards.ts @@ -359,7 +359,7 @@ export class ChatCards extends WithDisposable(LitElement) { ( this.host.doc.getBlock(data.currentImageSelections[0].blockId) ?.model as ImageBlockModel - ).caption ?? ''; + )?.caption ?? ''; } this._updateCards({