-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
64 lines (61 loc) · 1.8 KB
/
eslint.config.mjs
File metadata and controls
64 lines (61 loc) · 1.8 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
/* eslint-disable no-magic-numbers */
import globals from "globals";
import tseslint from "@typescript-eslint/eslint-plugin";
import tsparser from "@typescript-eslint/parser";
export default [
{
files: ["**/*.{js,mjs,cjs,ts}"],
languageOptions: {
globals: {
...globals.node,
},
parser: tsparser,
parserOptions: {
ecmaVersion: 2020,
sourceType: "module",
project: "./tsconfig.json",
},
},
plugins: {
"@typescript-eslint": tseslint,
},
settings: {
"import/resolver": {
typescript: {},
},
},
rules: {
indent: ["error", 2],
"no-var": "error",
"prefer-const": "error",
eqeqeq: ["error", "always"],
"no-trailing-spaces": "error",
"brace-style": ["error", "1tbs"],
"@typescript-eslint/no-unused-vars": [
"warn",
{ argsIgnorePattern: "^_" },
],
"@typescript-eslint/explicit-function-return-type": "warn",
"@typescript-eslint/explicit-module-boundary-types": "warn",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-non-null-assertion": "warn",
"@typescript-eslint/no-empty-function": "warn",
"@typescript-eslint/consistent-type-imports": "warn",
"@typescript-eslint/no-useless-constructor": "error",
"@typescript-eslint/no-unsafe-call": "error",
"@typescript-eslint/no-unsafe-argument": "error",
"no-debugger": "error",
"no-undef": "error",
"no-unused-expressions": "error",
"no-redeclare": "error",
"no-magic-numbers": [
"warn",
{ ignore: [0, 1], ignoreArrayIndexes: true },
],
complexity: ["warn", { max: 10 }],
"max-params": ["warn", 5],
"no-else-return": "warn",
"no-useless-escape": "error",
},
},
];