-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.mjs
85 lines (82 loc) · 2.26 KB
/
eslint.config.mjs
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
import globals from "globals";
import pluginJs from "@eslint/js";
import tseslint from "typescript-eslint";
export default [
{
files: ["src/**/*.ts", "test/**/*.ts"],
},
{
ignores: [
'build/**',
'dist/**',
'demo/**',
'docs/**',
'tmp/**',
"**/*.mjs",
"index.d.ts",
"jest.config.js",
"rollup.config.js",
],
},
{
languageOptions: { globals: globals.node }
},
pluginJs.configs.recommended,
...tseslint.configs.strictTypeChecked,
...tseslint.configs.recommendedTypeChecked,
{
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
{
rules: {
"block-scoped-var": "error",
"camelcase": "error",
"complexity": ["error", 12],
"eol-last": "error",
"max-depth": ["warn", 3],
"max-nested-callbacks": ["warn", 3],
"max-params": ["warn", 3],
"max-statements": ["warn", 15],
"no-console": "error",
"no-duplicate-imports": "error",
"no-else-return": "error",
"no-extend-native": "error",
"no-invalid-this": "error",
"no-lone-blocks": "error",
"no-return-await": "error",
"no-shadow": "error",
"no-trailing-spaces": "error",
"no-throw-literal": "error",
"no-unused-expressions": "error",
"no-use-before-define": "off",
"no-useless-call": "error",
"prefer-const": "error",
"prefer-rest-params": "error",
"prefer-spread": "error",
"require-await": "error",
"strict": "error",
"@typescript-eslint/await-thenable": "error",
"@typescript-eslint/explicit-function-return-type": "error",
"@typescript-eslint/explicit-module-boundary-types": "error",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/restrict-template-expressions": "off",
"@typescript-eslint/no-non-null-assertion": "off",
},
},
{
files: ["test/**/*.ts"],
rules: {
"max-params": "off",
"max-nested-callbacks": "off",
"@typescript-eslint/no-unsafe-argument": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-non-null-assertion": "off",
},
},
];