Repository navigation
Expand file tree
/
Copy patheslint.config.js
More file actions
64 lines (63 loc) 路 1.71 KB
/
Copy patheslint.config.js
File metadata and controls
64 lines (63 loc) 路 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import js from "@eslint/js";
import tseslint from "typescript-eslint";
export default [
{
ignores: ["dist/**"],
},
js.configs.recommended,
{
files: ["**/*.{js,mjs,cjs,ts}"],
rules: {
curly: ["error", "all"],
"no-restricted-syntax": [
"error",
{
selector: "CallExpression[callee.name='Boolean']",
message:
"Avoid truthiness coercion. Use an explicit condition or comparison instead.",
},
{
selector:
"UnaryExpression[operator='!'] > BinaryExpression[operator='!=']",
message:
"Avoid negating comparisons. Use the inverse operator directly.",
},
{
selector:
"UnaryExpression[operator='!'] > BinaryExpression[operator='!==']",
message:
"Avoid negating comparisons. Use the inverse operator directly.",
},
],
},
},
...[
...tseslint.configs.strictTypeChecked,
...tseslint.configs.stylisticTypeChecked,
].map((config) => ({
...config,
files: ["**/*.ts"],
})),
{
files: ["**/*.ts"],
languageOptions: {
parserOptions: {
project: "./tsconfig.eslint.json",
tsconfigRootDir: import.meta.dirname,
},
},
rules: {
"@typescript-eslint/consistent-type-assertions": [
"error",
{
assertionStyle: "never",
},
],
"@typescript-eslint/consistent-type-definitions": ["error", "type"],
"@typescript-eslint/prefer-readonly": "error",
"@typescript-eslint/strict-boolean-expressions": "error",
"@typescript-eslint/strict-void-return": "error",
"@typescript-eslint/switch-exhaustiveness-check": "error",
},
},
];