1 |
// @ts-check |
2 |
|
3 |
import eslint from "@eslint/js"; |
4 |
import globals from "globals"; |
5 |
import tseslint from "typescript-eslint"; |
6 |
|
7 |
export default tseslint.config( |
8 |
{ |
9 |
extends: [eslint.configs.recommended, ...tseslint.configs.recommendedTypeChecked], |
10 |
languageOptions: { |
11 |
ecmaVersion: "latest", |
12 |
sourceType: "module", |
13 |
globals: { |
14 |
...globals.node, |
15 |
...globals.es2021 |
16 |
}, |
17 |
parserOptions: { |
18 |
project: true, |
19 |
tsconfigRootDir: import.meta.dirname, |
20 |
ecmaVersion: "latest", |
21 |
sourceType: "module" |
22 |
} |
23 |
}, |
24 |
rules: { |
25 |
indent: "off", |
26 |
semi: ["warn", "always"], |
27 |
"no-var": "off", |
28 |
"linebreak-style": ["error", "unix"], |
29 |
quotes: [ |
30 |
"warn", |
31 |
"double", |
32 |
{ |
33 |
avoidEscape: true |
34 |
} |
35 |
], |
36 |
"@typescript-eslint/no-var-requires": "off", |
37 |
"@typescript-eslint/consistent-type-imports": [ |
38 |
"error", |
39 |
{ disallowTypeAnnotations: false } |
40 |
], |
41 |
"@typescript-eslint/no-misused-promises": [ |
42 |
"warn", |
43 |
{ |
44 |
checksVoidReturn: false |
45 |
} |
46 |
], |
47 |
"@typescript-eslint/explicit-member-accessibility": [ |
48 |
"error", |
49 |
{ accessibility: "explicit" } |
50 |
], |
51 |
"@typescript-eslint/no-unused-vars": "off", |
52 |
"@typescript-eslint/no-unsafe-member-access": "off", |
53 |
"@typescript-eslint/no-unsafe-call": "off", |
54 |
"@typescript-eslint/no-unsafe-assignment": "off", |
55 |
"@typescript-eslint/no-unsafe-return": "off", |
56 |
"@typescript-eslint/no-unsafe-argument": "off", |
57 |
"@typescript-eslint/restrict-template-expressions": "off" |
58 |
}, |
59 |
files: ["src/**/*.ts"], |
60 |
ignores: [ |
61 |
"**/*.js", |
62 |
"**/node_modules", |
63 |
"**/extensions", |
64 |
"**/docs", |
65 |
"**/*.bak", |
66 |
"**/tests", |
67 |
"*.blaze.ts", |
68 |
"build" |
69 |
] |
70 |
}, |
71 |
{ |
72 |
rules: { |
73 |
"@typescript-eslint/no-unused-vars": [ |
74 |
"warn", |
75 |
{ |
76 |
argsIgnorePattern: "^_", |
77 |
varsIgnorePattern: "^_", |
78 |
caughtErrorsIgnorePattern: "^_" |
79 |
} |
80 |
] |
81 |
}, |
82 |
files: ["src/**/*.ts"], |
83 |
ignores: ["**/*.d.ts"] |
84 |
} |
85 |
); |