-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.eslintrc.js
94 lines (94 loc) · 3.5 KB
/
.eslintrc.js
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
86
87
88
89
90
91
92
93
94
module.exports = {
env: {
browser: true,
es2021: true,
},
extends: [
"eslint:recommended",
"plugin:react/recommended",
"plugin:@typescript-eslint/recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"plugin:clean-regex/recommended",
],
parser: "@typescript-eslint/parser",
parserOptions: {
ecmaFeatures: {
jsx: true,
},
ecmaVersion: 12,
sourceType: "module",
project: ["./tsconfig.json"],
},
settings: {
react: {
version: "latest",
},
},
plugins: ["react", "@typescript-eslint", "clean-regex"],
rules: {
eqeqeq: "error",
quotes: [
"error",
"double",
{
avoidEscape: true,
allowTemplateLiterals: true,
},
],
semi: ["error", "always"],
"no-console": "off",
"no-sparse-arrays": "off",
"indent": ["warn", "tab", { SwitchCase: 1 }],
"@typescript-eslint/explicit-module-boundary-types": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-namespace": "off",
"@typescript-eslint/unbound-method": "warn",
"@typescript-eslint/member-delimiter-style": "warn",
"@typescript-eslint/prefer-readonly": "warn",
"@typescript-eslint/class-literal-property-style": "warn",
"@typescript-eslint/consistent-indexed-object-style": "warn",
"@typescript-eslint/consistent-type-assertions": "warn",
// "@typescript-eslint/no-extraneous-class": "warn",
"@typescript-eslint/no-implicit-any-catch": "warn",
"@typescript-eslint/prefer-for-of": "warn",
"@typescript-eslint/prefer-function-type": "warn",
"@typescript-eslint/prefer-includes": "warn",
"@typescript-eslint/prefer-nullish-coalescing": "warn",
"@typescript-eslint/prefer-optional-chain": "warn",
"@typescript-eslint/prefer-reduce-type-parameter": "warn",
"@typescript-eslint/prefer-string-starts-ends-with": "warn",
"@typescript-eslint/prefer-ts-expect-error": "warn",
"@typescript-eslint/promise-function-async": "warn",
"@typescript-eslint/require-array-sort-compare": ["warn", { ignoreStringArrays: true }],
"@typescript-eslint/switch-exhaustiveness-check": "warn",
"@typescript-eslint/type-annotation-spacing": "warn",
"@typescript-eslint/unified-signatures": "warn",
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "warn",
"@typescript-eslint/no-unnecessary-type-arguments": "warn",
"@typescript-eslint/no-unnecessary-type-constraint": "warn",
"@typescript-eslint/non-nullable-type-assertion-style": "warn",
"@typescript-eslint/explicit-function-return-type": [
"warn",
{ allowExpressions: true, allowConciseArrowFunctionExpressionsStartingWithVoid: true },
],
"@typescript-eslint/no-unnecessary-condition": "error",
"@typescript-eslint/no-invalid-void-type": "error",
"@typescript-eslint/no-loss-of-precision": "error",
"@typescript-eslint/dot-notation": "error",
"@typescript-eslint/no-dynamic-delete": "error",
"@typescript-eslint/no-extraneous-class": "error",
"@typescript-eslint/consistent-type-definitions": ["warn", "interface"],
// ee
"@typescript-eslint/explicit-member-accessibility": ["warn", { accessibility: "explicit" }],
"@typescript-eslint/ban-ts-comment": "warn",
"@typescript-eslint/array-type": ["warn", { default: "array" }], //e
"@typescript-eslint/consistent-type-imports": ["warn", { prefer: "type-imports" }],
"@typescript-eslint/no-unused-vars": ["warn", { args: "none" }],
"import/no-unresolved": "off",
"import/namespace": "off",
"react/react-in-jsx-scope": "off",
},
ignorePatterns: [".eslintrc.js", "next.config.js", "babel.config.js", "loader.mjs"],
};