-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.eslintrc.json
135 lines (115 loc) · 3.53 KB
/
.eslintrc.json
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
{
"$schema": "https://raw.githubusercontent.com/SchemaStore/schemastore/master/src/schemas/json/eslintrc.json",
"root": true,
"env": {
"node": true,
"es2022": true
},
"plugins": [
"@typescript-eslint",
"import"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2022,
"project": "tsconfig.json"
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking"
],
"rules": {
// ESLint
// Possible Problems
"no-constructor-return": ["error"],
"no-duplicate-imports": ["error"],
"no-new-native-nonconstructor": ["error"],
"no-promise-executor-return": ["error"],
"no-self-compare": ["error"],
"no-template-curly-in-string": ["error"],
"no-unmodified-loop-condition": ["error"],
"no-unused-private-class-members": ["error"],
"require-atomic-updates": ["error"],
// Suggestions
"arrow-body-style": ["error", "as-needed", {
"requireReturnForObjectLiteral": true
}],
"eqeqeq": ["error", "always"],
"func-style": ["error", "declaration", {
"allowArrowFunctions": true
}],
"no-eval": ["error", { "allowIndirect": false }],
"no-floating-decimal": ["error"],
"no-implied-eval": ["error"],
"no-multi-str": ["error"],
"no-octal-escape": ["error"],
"no-param-reassign": ["error"],
"no-var": ["error"],
"operator-assignment": ["error", "always"],
"prefer-arrow-callback": ["error", {
"allowNamedFunctions": false,
"allowUnboundThis": true
}],
"prefer-const": ["error", {
"destructuring": "any",
"ignoreReadBeforeAssign": false
}],
"prefer-exponentiation-operator": ["error"],
"prefer-named-capture-group": ["error"],
"prefer-numeric-literals": ["error"],
"prefer-regex-literals": ["error", {
"disallowRedundantWrapping": true
}],
"prefer-rest-params": ["error"],
"prefer-spread": ["error"],
"prefer-template": ["error"],
"quote-props": ["error", "as-needed", {
"keywords": true,
"unnecessary": true,
"numbers": false
}],
"radix": ["error", "always"],
// @typescript-eslint/eslint-plugin
// ...tsEslintPlugin.configs["recommended"].rules,
// ...tsEslintPlugin.configs["recommended-requiring-type-checking"].rules,
"@typescript-eslint/explicit-member-accessibility": ["error", {
"accessability": "explicit"
}],
"@typescript-eslint/member-delimiter-style": ["error", {
"multiline": {
"delimiter": "semi",
"requireLast": true
},
"singleline": {
"delimiter": "semi",
"requireLast": true
}
}],
"@typescript-eslint/no-inferrable-types": ["off"],
"@typescript-eslint/no-require-imports": ["error"],
"@typescript-eslint/no-unsafe-declaration-merging": ["error"],
"@typescript-eslint/no-unsafe-enum-comparison": ["error"],
"@typescript-eslint/parameter-properties": ["error", {
"allow": [],
"prefer": "class-property"
}],
"@typescript-eslint/prefer-literal-enum-member": ["error"],
"@typescript-eslint/prefer-optional-chain": ["error"],
"@typescript-eslint/prefer-string-starts-ends-with": ["error"],
"@typescript-eslint/prefer-ts-expect-error": ["error"],
"@typescript-eslint/require-array-sort-compare": ["error", {
"ignoreStringArrays": true
}],
// eslint-plugin-import
// ...eslintPluginImport.configs.recommended,
// ...eslintPluginImport.configs.typescript,
// Helpful warnings
"import/no-deprecated": ["error"],
"import/no-empty-named-blocks": ["error"],
// Module systems
// Static analysis
"import/no-absolute-path": ["error"],
"import/no-self-import": ["error"]
}
}