Skip to content

Commit 171badb

Browse files
committed
fix: ban ts comment
1 parent 873c31d commit 171badb

3 files changed

Lines changed: 13 additions & 6 deletions

File tree

eslint.config.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,8 @@ export default antfu({
99
quotes: "double",
1010
},
1111
formatters: true,
12-
ignores: ["src/typegen.ts"],
12+
ignores: ["src/typegen.ts", "playground/**/*"],
1313
});
14+
15+
// import zotero from "@zotero-plugin/eslint-config";
16+
// export default zotero();

src/configs/typescript.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import type { Rules } from "../typegen.js";
12
import type { Config } from "../types.js";
23
import tseslint from "typescript-eslint";
34
import { GLOB_DTS, GLOB_TS, GLOB_TSX } from "../globs.js";
@@ -7,16 +8,20 @@ export const typescriptCore = tseslint.config({
78
files: [GLOB_TS, GLOB_TSX],
89
name: "zotero-plugin/typescript",
910
rules: {
10-
"@typescript-eslint/ban-ts-comment": "off",
11+
"@typescript-eslint/ban-ts-comment": ["error", {
12+
"minimumDescriptionLength": 3,
13+
"ts-expect-error": "allow-with-description",
14+
}],
1115
"@typescript-eslint/no-explicit-any": "off",
1216
"@typescript-eslint/no-non-null-assertion": "off",
1317
"@typescript-eslint/no-unsafe-function-type": "off",
1418
"@typescript-eslint/no-unused-vars": ["error", {
1519
argsIgnorePattern: "^_",
1620
varsIgnorePattern: "^_",
1721
}],
18-
},
19-
}) as Config[];
22+
} satisfies Rules,
23+
},
24+
) as Config[];
2025

2126
export const typescript: Config[] = [
2227
...typescriptCore,

tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22
"compilerOptions": {
33
"module": "ESNext",
44
"moduleResolution": "bundler",
5-
"types": ["node"],
65
"strict": true,
76
"declaration": true,
87
"noEmit": true,
98
"esModuleInterop": true,
109
"skipLibCheck": true
1110
},
12-
"include": ["src"]
11+
"include": ["**/*.ts"]
1312
}

0 commit comments

Comments
 (0)