eslint-config-deepcrawl 13.12.0 → 14.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -15
- package/index.js +235 -326
- package/package.json +28 -17
package/README.md
CHANGED
|
@@ -9,27 +9,17 @@ Add `eslint-config-deepcrawl` and its peer dependencies to your `package.json`:
|
|
|
9
9
|
```shell
|
|
10
10
|
yarn add --dev \
|
|
11
11
|
eslint-config-deepcrawl \
|
|
12
|
-
eslint@^
|
|
12
|
+
eslint@^9.12.0
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
## Usage
|
|
16
16
|
|
|
17
|
-
Update your
|
|
17
|
+
Update your `eslint.config.mjs` file:
|
|
18
18
|
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
"extends": ["deepcrawl"]
|
|
22
|
-
}
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
If you are using tsconfig paths, you also need to let `eslint-plugin-import` know, which imports should it consider internal, for example:
|
|
19
|
+
```js
|
|
20
|
+
import eslintConfigDeepcrawl from "eslint-config-deepcrawl";
|
|
26
21
|
|
|
27
|
-
|
|
28
|
-
{
|
|
29
|
-
"settings": {
|
|
30
|
-
"import/internal-regex": "^@(src|test)/"
|
|
31
|
-
}
|
|
32
|
-
}
|
|
22
|
+
export default [...eslintConfigDeepcrawl];
|
|
33
23
|
```
|
|
34
24
|
|
|
35
25
|
## Recommendations
|
|
@@ -58,6 +48,7 @@ Apart from ESLint, it is recommended to use the following Prettier configuration
|
|
|
58
48
|
"arrowParens": "avoid",
|
|
59
49
|
"bracketSpacing": true,
|
|
60
50
|
"endOfLine": "lf",
|
|
51
|
+
"plugins": ["prettier-plugin-packagejson"],
|
|
61
52
|
"printWidth": 120,
|
|
62
53
|
"quoteProps": "as-needed",
|
|
63
54
|
"semi": true,
|
package/index.js
CHANGED
|
@@ -1,332 +1,241 @@
|
|
|
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
|
-
|
|
1
|
+
import eslintJs from "@eslint/js";
|
|
2
|
+
import eslintConfigPrettier from "eslint-config-prettier";
|
|
3
|
+
import arrayFuncPlugin from "eslint-plugin-array-func";
|
|
4
|
+
import importPlugin from "eslint-plugin-import";
|
|
5
|
+
import jestPlugin from "eslint-plugin-jest";
|
|
6
|
+
import noLoopsPlugin from "eslint-plugin-no-loops";
|
|
7
|
+
import nodePlugin from "eslint-plugin-n";
|
|
8
|
+
import packageJsonPluginConfig from "eslint-plugin-package-json/configs/recommended";
|
|
9
|
+
import promisePlugin from "eslint-plugin-promise";
|
|
10
|
+
import sonarjsPlugin from "eslint-plugin-sonarjs";
|
|
11
|
+
import typescriptEslint from "typescript-eslint";
|
|
12
|
+
|
|
13
|
+
export default [
|
|
14
|
+
eslintJs.configs.recommended,
|
|
15
|
+
...typescriptEslint.config({
|
|
16
|
+
extends: [...typescriptEslint.configs.recommendedTypeChecked],
|
|
17
|
+
files: ["**/*.{ts,tsx}"],
|
|
18
|
+
languageOptions: {
|
|
19
|
+
parserOptions: {
|
|
20
|
+
projectService: true,
|
|
21
|
+
tsconfigRootDir: import.meta.name,
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
}),
|
|
25
|
+
{
|
|
26
|
+
files: ["**/*.{cjs,js,jsx,mjs}"],
|
|
27
|
+
...typescriptEslint.configs.disableTypeChecked,
|
|
28
|
+
},
|
|
29
|
+
importPlugin.flatConfigs.recommended,
|
|
30
|
+
importPlugin.flatConfigs.typescript,
|
|
31
|
+
jestPlugin.configs["flat/recommended"],
|
|
32
|
+
nodePlugin.configs["flat/recommended"],
|
|
33
|
+
{
|
|
34
|
+
...packageJsonPluginConfig,
|
|
35
|
+
rules: {
|
|
36
|
+
...packageJsonPluginConfig.rules,
|
|
37
|
+
// https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/issues/499
|
|
38
|
+
"package-json/sort-collections": ["error", ["devDependencies", "dependencies", "peerDependencies", "config"]],
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
promisePlugin.configs["flat/recommended"],
|
|
42
|
+
eslintConfigPrettier,
|
|
43
|
+
{
|
|
44
|
+
linterOptions: { reportUnusedDisableDirectives: true },
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
plugins: { "array-func": arrayFuncPlugin },
|
|
48
|
+
rules: { "array-func/avoid-reverse": "error" },
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
plugins: { "no-loops": noLoopsPlugin },
|
|
52
|
+
rules: { "no-loops/no-loops": "error" },
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
plugins: { sonarjs: sonarjsPlugin },
|
|
56
|
+
rules: {
|
|
57
|
+
"sonarjs/cognitive-complexity": ["error", 15],
|
|
58
|
+
"sonarjs/max-switch-cases": "error",
|
|
59
|
+
"sonarjs/no-all-duplicated-branches": "error",
|
|
60
|
+
"sonarjs/no-collapsible-if": "error",
|
|
61
|
+
"sonarjs/no-collection-size-mischeck": "error",
|
|
62
|
+
"sonarjs/no-duplicate-string": "warn",
|
|
63
|
+
"sonarjs/no-duplicated-branches": "error",
|
|
64
|
+
"sonarjs/no-element-overwrite": "error",
|
|
65
|
+
"sonarjs/no-identical-conditions": "error",
|
|
66
|
+
"sonarjs/no-identical-expressions": "error",
|
|
67
|
+
"sonarjs/no-identical-functions": "error",
|
|
68
|
+
"sonarjs/no-inverted-boolean-check": "error",
|
|
69
|
+
"sonarjs/no-one-iteration-loop": "error",
|
|
70
|
+
"sonarjs/no-redundant-boolean": "error",
|
|
71
|
+
"sonarjs/no-redundant-jump": "error",
|
|
72
|
+
"sonarjs/no-same-line-conditional": "error",
|
|
73
|
+
"sonarjs/no-small-switch": "error",
|
|
74
|
+
"sonarjs/no-unused-collection": "error",
|
|
75
|
+
"sonarjs/no-use-of-empty-return-value": "error",
|
|
76
|
+
"sonarjs/no-useless-catch": "error",
|
|
77
|
+
"sonarjs/prefer-immediate-return": "error",
|
|
78
|
+
"sonarjs/prefer-while": "error",
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
files: ["**/*.{ts,tsx}"],
|
|
83
|
+
rules: {
|
|
84
|
+
"@typescript-eslint/array-type": ["error", { default: "array-simple" }],
|
|
85
|
+
"@typescript-eslint/consistent-type-assertions": [
|
|
86
|
+
"error",
|
|
87
|
+
{ assertionStyle: "angle-bracket", objectLiteralTypeAssertions: "allow" },
|
|
88
|
+
],
|
|
89
|
+
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
|
|
90
|
+
"@typescript-eslint/explicit-function-return-type": [
|
|
91
|
+
"error",
|
|
92
|
+
{ allowExpressions: true, allowTypedFunctionExpressions: true },
|
|
93
|
+
],
|
|
94
|
+
"@typescript-eslint/explicit-member-accessibility": [
|
|
95
|
+
"error",
|
|
96
|
+
{ accessibility: "explicit", overrides: { constructors: "no-public" } },
|
|
97
|
+
],
|
|
98
|
+
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
99
|
+
"@typescript-eslint/naming-convention": [
|
|
100
|
+
"warn",
|
|
101
|
+
{ selector: "default", format: ["camelCase"], leadingUnderscore: "allow", trailingUnderscore: "allow" },
|
|
102
|
+
{ selector: "import", format: ["camelCase", "PascalCase", "snake_case"] },
|
|
103
|
+
{
|
|
104
|
+
selector: "variable",
|
|
105
|
+
format: ["camelCase", "PascalCase", "UPPER_CASE"],
|
|
106
|
+
leadingUnderscore: "allow",
|
|
107
|
+
trailingUnderscore: "allow",
|
|
52
108
|
},
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
{
|
|
59
|
-
selector: "default",
|
|
60
|
-
format: ["camelCase"],
|
|
61
|
-
leadingUnderscore: "allow",
|
|
62
|
-
trailingUnderscore: "allow",
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
selector: "import",
|
|
66
|
-
format: ["camelCase", "PascalCase", "snake_case"],
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
selector: "variable",
|
|
70
|
-
format: ["camelCase", "PascalCase", "UPPER_CASE"],
|
|
71
|
-
leadingUnderscore: "allow",
|
|
72
|
-
trailingUnderscore: "allow",
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
"selector": "variable",
|
|
76
|
-
"types": ["boolean"],
|
|
77
|
-
"format": ["PascalCase"],
|
|
78
|
-
"prefix": ["are", "can", "did", "does", "do", "has", "is", "not", "should", "was", "were", "will", "with"]
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
selector: "function",
|
|
82
|
-
format: ["camelCase", "PascalCase"],
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
selector: "property",
|
|
86
|
-
format: ["camelCase", "PascalCase", "UPPER_CASE"],
|
|
87
|
-
leadingUnderscore: "allow",
|
|
88
|
-
trailingUnderscore: "allow",
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
selector: "property",
|
|
92
|
-
format: null,
|
|
93
|
-
filter: {
|
|
94
|
-
regex: "[- :]",
|
|
95
|
-
match: true,
|
|
109
|
+
{
|
|
110
|
+
selector: "variable",
|
|
111
|
+
types: ["boolean"],
|
|
112
|
+
format: ["PascalCase"],
|
|
113
|
+
prefix: ["are", "can", "did", "does", "do", "has", "is", "not", "should", "was", "were", "will", "with"],
|
|
96
114
|
},
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
selector: "typeLike",
|
|
104
|
-
format: ["PascalCase"],
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
selector: "interface",
|
|
108
|
-
format: ["PascalCase"],
|
|
109
|
-
prefix: ["I"]
|
|
110
|
-
},
|
|
111
|
-
{
|
|
112
|
-
selector: "typeParameter",
|
|
113
|
-
format: ["PascalCase"],
|
|
114
|
-
prefix: ["T"]
|
|
115
|
-
},
|
|
116
|
-
],
|
|
117
|
-
"@typescript-eslint/no-base-to-string": "off",
|
|
118
|
-
"@typescript-eslint/no-duplicate-enum-values": "off",
|
|
119
|
-
"@typescript-eslint/no-empty-function": [
|
|
120
|
-
"error",
|
|
121
|
-
{
|
|
122
|
-
allow: ["protected-constructors", "private-constructors"],
|
|
123
|
-
},
|
|
124
|
-
],
|
|
125
|
-
"@typescript-eslint/no-explicit-any": [
|
|
126
|
-
"error",
|
|
127
|
-
{
|
|
128
|
-
fixToUnknown: true,
|
|
129
|
-
ignoreRestArgs: true,
|
|
130
|
-
},
|
|
131
|
-
],
|
|
132
|
-
"@typescript-eslint/no-inferrable-types": [
|
|
133
|
-
"error",
|
|
134
|
-
{
|
|
135
|
-
ignoreProperties: true,
|
|
136
|
-
},
|
|
137
|
-
],
|
|
138
|
-
"@typescript-eslint/no-magic-numbers": [
|
|
139
|
-
"off",
|
|
140
|
-
{
|
|
141
|
-
ignoreNumericLiteralTypes: true,
|
|
142
|
-
},
|
|
143
|
-
],
|
|
144
|
-
"@typescript-eslint/no-non-null-asserted-nullish-coalescing": "error",
|
|
145
|
-
"@typescript-eslint/no-non-null-assertion": "error",
|
|
146
|
-
"@typescript-eslint/no-restricted-types": [
|
|
147
|
-
"error",
|
|
148
|
-
{
|
|
149
|
-
types: {
|
|
150
|
-
String: {
|
|
151
|
-
message: "Use string instead",
|
|
152
|
-
fixWith: "string",
|
|
153
|
-
},
|
|
154
|
-
Boolean: {
|
|
155
|
-
message: "Use boolean instead",
|
|
156
|
-
fixWith: "boolean",
|
|
157
|
-
},
|
|
158
|
-
Number: {
|
|
159
|
-
message: "Use number instead",
|
|
160
|
-
fixWith: "number",
|
|
161
|
-
},
|
|
162
|
-
Symbol: {
|
|
163
|
-
message: "Use symbol instead",
|
|
164
|
-
fixWith: "symbol",
|
|
165
|
-
},
|
|
166
|
-
BigInt: {
|
|
167
|
-
message: "Use bigint instead",
|
|
168
|
-
fixWith: "bigint",
|
|
169
|
-
},
|
|
170
|
-
// object typing
|
|
171
|
-
Object: {
|
|
172
|
-
message: [
|
|
173
|
-
'The `Object` type actually means "any non-nullish value", so it is marginally better than `unknown`.',
|
|
174
|
-
'- If you want a type meaning "any object", you probably want `Record<string, unknown>` instead.',
|
|
175
|
-
'- If you want a type meaning "any value", you probably want `unknown` instead.',
|
|
176
|
-
].join('\n'),
|
|
177
|
-
},
|
|
178
|
-
object: {
|
|
179
|
-
message: [
|
|
180
|
-
'The `object` type is currently hard to use ([see this issue](https://github.com/microsoft/TypeScript/issues/21732)).',
|
|
181
|
-
'Consider using `Record<string, unknown>` instead, as it allows you to more easily inspect and use the keys.',
|
|
182
|
-
].join('\n'),
|
|
183
|
-
},
|
|
115
|
+
{ selector: "function", format: ["camelCase", "PascalCase"] },
|
|
116
|
+
{
|
|
117
|
+
selector: "property",
|
|
118
|
+
format: ["camelCase", "PascalCase", "UPPER_CASE"],
|
|
119
|
+
leadingUnderscore: "allow",
|
|
120
|
+
trailingUnderscore: "allow",
|
|
184
121
|
},
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
"import/no-named-as-default-member": "off",
|
|
224
|
-
"import/no-relative-packages": "error",
|
|
225
|
-
"import/no-unresolved": "off",
|
|
226
|
-
"import/order": [
|
|
227
|
-
"error",
|
|
228
|
-
{
|
|
229
|
-
alphabetize: {
|
|
230
|
-
order: "asc",
|
|
231
|
-
caseInsensitive: true,
|
|
122
|
+
{ selector: "property", format: null, filter: { regex: "[- :]", match: true } },
|
|
123
|
+
{ selector: "enumMember", format: ["camelCase", "PascalCase"] },
|
|
124
|
+
{ selector: "typeLike", format: ["PascalCase"] },
|
|
125
|
+
{ selector: "interface", format: ["PascalCase"], prefix: ["I"] },
|
|
126
|
+
{ selector: "typeParameter", format: ["PascalCase"], prefix: ["T"] },
|
|
127
|
+
],
|
|
128
|
+
"@typescript-eslint/no-base-to-string": "off",
|
|
129
|
+
"@typescript-eslint/no-duplicate-enum-values": "off",
|
|
130
|
+
"@typescript-eslint/no-empty-function": ["error", { allow: ["protected-constructors", "private-constructors"] }],
|
|
131
|
+
"@typescript-eslint/no-explicit-any": ["error", { fixToUnknown: true, ignoreRestArgs: true }],
|
|
132
|
+
"@typescript-eslint/no-inferrable-types": ["error", { ignoreProperties: true }],
|
|
133
|
+
"@typescript-eslint/no-magic-numbers": ["off", { ignoreNumericLiteralTypes: true }],
|
|
134
|
+
"@typescript-eslint/no-non-null-asserted-nullish-coalescing": "error",
|
|
135
|
+
"@typescript-eslint/no-non-null-assertion": "error",
|
|
136
|
+
"@typescript-eslint/no-restricted-types": [
|
|
137
|
+
"error",
|
|
138
|
+
{
|
|
139
|
+
types: {
|
|
140
|
+
String: { message: "Use string instead", fixWith: "string" },
|
|
141
|
+
Boolean: { message: "Use boolean instead", fixWith: "boolean" },
|
|
142
|
+
Number: { message: "Use number instead", fixWith: "number" },
|
|
143
|
+
Symbol: { message: "Use symbol instead", fixWith: "symbol" },
|
|
144
|
+
BigInt: { message: "Use bigint instead", fixWith: "bigint" },
|
|
145
|
+
// object typing
|
|
146
|
+
Object: {
|
|
147
|
+
message: [
|
|
148
|
+
'The `Object` type actually means "any non-nullish value", so it is marginally better than `unknown`.',
|
|
149
|
+
'- If you want a type meaning "any object", you probably want `Record<string, unknown>` instead.',
|
|
150
|
+
'- If you want a type meaning "any value", you probably want `unknown` instead.',
|
|
151
|
+
].join("\n"),
|
|
152
|
+
},
|
|
153
|
+
object: {
|
|
154
|
+
message: [
|
|
155
|
+
"The `object` type is currently hard to use ([see this issue](https://github.com/microsoft/TypeScript/issues/21732)).",
|
|
156
|
+
"Consider using `Record<string, unknown>` instead, as it allows you to more easily inspect and use the keys.",
|
|
157
|
+
].join("\n"),
|
|
158
|
+
},
|
|
159
|
+
},
|
|
232
160
|
},
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
"error",
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
],
|
|
254
|
-
"n/no-unsupported-features/es-syntax": [
|
|
255
|
-
"error",
|
|
256
|
-
{
|
|
257
|
-
ignores: ["modules"],
|
|
258
|
-
},
|
|
259
|
-
],
|
|
260
|
-
"promise/prefer-await-to-then": "error",
|
|
261
|
-
"sonarjs/cognitive-complexity": ["error", 8],
|
|
262
|
-
"sonarjs/max-switch-cases": "error",
|
|
263
|
-
"sonarjs/no-all-duplicated-branches": "error",
|
|
264
|
-
"sonarjs/no-collapsible-if": "error",
|
|
265
|
-
"sonarjs/no-collection-size-mischeck": "error",
|
|
266
|
-
"sonarjs/no-duplicate-string": "warn",
|
|
267
|
-
"sonarjs/no-duplicated-branches": "error",
|
|
268
|
-
"sonarjs/no-element-overwrite": "error",
|
|
269
|
-
"sonarjs/no-identical-conditions": "error",
|
|
270
|
-
"sonarjs/no-identical-expressions": "error",
|
|
271
|
-
"sonarjs/no-identical-functions": "error",
|
|
272
|
-
"sonarjs/no-inverted-boolean-check": "error",
|
|
273
|
-
"sonarjs/no-one-iteration-loop": "error",
|
|
274
|
-
"sonarjs/no-redundant-boolean": "error",
|
|
275
|
-
"sonarjs/no-redundant-jump": "error",
|
|
276
|
-
"sonarjs/no-same-line-conditional": "error",
|
|
277
|
-
"sonarjs/no-small-switch": "error",
|
|
278
|
-
"sonarjs/no-unused-collection": "error",
|
|
279
|
-
"sonarjs/no-use-of-empty-return-value": "error",
|
|
280
|
-
"sonarjs/no-useless-catch": "error",
|
|
281
|
-
"sonarjs/prefer-immediate-return": "error",
|
|
282
|
-
"sonarjs/prefer-while": "error",
|
|
283
|
-
"complexity": ["error", 10],
|
|
284
|
-
"default-case-last": "error",
|
|
285
|
-
"max-classes-per-file": ["error", 1],
|
|
286
|
-
"max-len": [
|
|
287
|
-
"error",
|
|
288
|
-
{
|
|
289
|
-
code: 120,
|
|
290
|
-
ignoreComments: true,
|
|
291
|
-
ignorePattern: "^(export|import)*",
|
|
292
|
-
ignoreTemplateLiterals: true,
|
|
293
|
-
}
|
|
294
|
-
],
|
|
295
|
-
"max-lines-per-function": [
|
|
296
|
-
"warn",
|
|
297
|
-
{
|
|
298
|
-
max: 20,
|
|
299
|
-
skipBlankLines: true,
|
|
300
|
-
skipComments: true,
|
|
301
|
-
IIFEs: true
|
|
302
|
-
},
|
|
303
|
-
],
|
|
304
|
-
"max-params": ["error", 7],
|
|
305
|
-
"max-statements-per-line": [
|
|
306
|
-
"error",
|
|
307
|
-
{
|
|
308
|
-
max: 1,
|
|
309
|
-
},
|
|
310
|
-
],
|
|
311
|
-
"no-console": "error",
|
|
312
|
-
"no-else-return": "error",
|
|
313
|
-
"no-multi-str": "error",
|
|
314
|
-
"no-restricted-properties": [
|
|
315
|
-
"error",
|
|
316
|
-
{
|
|
317
|
-
object: "Object",
|
|
318
|
-
property: "assign",
|
|
319
|
-
message: "Object.assign allows getting around type checking. Consider another solution.",
|
|
320
|
-
}
|
|
321
|
-
],
|
|
322
|
-
"no-self-assign": "error",
|
|
323
|
-
"object-shorthand": "error",
|
|
324
|
-
"prefer-template": "error",
|
|
325
|
-
"spaced-comment": "error",
|
|
161
|
+
],
|
|
162
|
+
"@typescript-eslint/no-this-alias": ["error", { allowDestructuring: true }],
|
|
163
|
+
"@typescript-eslint/no-unnecessary-type-arguments": "error",
|
|
164
|
+
"@typescript-eslint/no-unsafe-argument": "off",
|
|
165
|
+
"@typescript-eslint/no-unsafe-assignment": "off",
|
|
166
|
+
"@typescript-eslint/no-unsafe-call": "off",
|
|
167
|
+
"@typescript-eslint/no-unsafe-enum-comparison": "off",
|
|
168
|
+
"@typescript-eslint/no-unsafe-function-type": "off",
|
|
169
|
+
"@typescript-eslint/no-unsafe-member-access": "off",
|
|
170
|
+
"@typescript-eslint/no-unsafe-return": "off",
|
|
171
|
+
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_", destructuredArrayIgnorePattern: "^_" }],
|
|
172
|
+
"@typescript-eslint/no-useless-constructor": "error",
|
|
173
|
+
"@typescript-eslint/prefer-includes": "error",
|
|
174
|
+
"@typescript-eslint/prefer-regexp-exec": "error",
|
|
175
|
+
"@typescript-eslint/require-array-sort-compare": "error",
|
|
176
|
+
"@typescript-eslint/restrict-template-expressions": "off",
|
|
177
|
+
"@typescript-eslint/return-await": "error",
|
|
178
|
+
"@typescript-eslint/sort-type-constituents": "error",
|
|
179
|
+
"@typescript-eslint/unified-signatures": "error",
|
|
180
|
+
},
|
|
326
181
|
},
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
182
|
+
{
|
|
183
|
+
rules: {
|
|
184
|
+
complexity: ["error", 15],
|
|
185
|
+
"default-case-last": "error",
|
|
186
|
+
"import/default": "off",
|
|
187
|
+
"import/named": "off",
|
|
188
|
+
"import/namespace": "off",
|
|
189
|
+
"import/newline-after-import": "error",
|
|
190
|
+
"import/no-default-export": "error",
|
|
191
|
+
"import/no-named-as-default": "off",
|
|
192
|
+
"import/no-named-as-default-member": "off",
|
|
193
|
+
"import/no-relative-packages": "error",
|
|
194
|
+
"import/no-unresolved": "off",
|
|
195
|
+
"import/order": [
|
|
196
|
+
"error",
|
|
197
|
+
{
|
|
198
|
+
alphabetize: { order: "asc", caseInsensitive: true },
|
|
199
|
+
"newlines-between": "always",
|
|
200
|
+
groups: ["builtin", "external", "internal", "parent", "sibling", "index"],
|
|
201
|
+
},
|
|
202
|
+
],
|
|
203
|
+
"jest/expect-expect": "error",
|
|
204
|
+
"jest/padding-around-after-all-blocks": "error",
|
|
205
|
+
"jest/padding-around-after-each-blocks": "error",
|
|
206
|
+
"jest/padding-around-before-all-blocks": "error",
|
|
207
|
+
"jest/padding-around-before-each-blocks": "error",
|
|
208
|
+
"jest/padding-around-describe-blocks": "error",
|
|
209
|
+
"jest/padding-around-test-blocks": "error",
|
|
210
|
+
"jest/prefer-expect-resolves": "error",
|
|
211
|
+
"jest/prefer-to-be": "error",
|
|
212
|
+
"max-classes-per-file": ["error", 1],
|
|
213
|
+
"max-len": [
|
|
214
|
+
"error",
|
|
215
|
+
{ code: 120, ignoreComments: true, ignorePattern: "^(export|import)*", ignoreTemplateLiterals: true },
|
|
216
|
+
],
|
|
217
|
+
"max-lines-per-function": ["warn", { max: 20, skipBlankLines: true, skipComments: true, IIFEs: true }],
|
|
218
|
+
"max-params": ["error", 7],
|
|
219
|
+
"max-statements-per-line": ["error", { max: 1 }],
|
|
220
|
+
"n/no-missing-import": "off",
|
|
221
|
+
"n/no-unsupported-features/node-builtins": ["error", { ignores: ["fetch", "navigator", "Response", "Request"] }],
|
|
222
|
+
"n/no-unsupported-features/es-syntax": ["error", { ignores: ["modules"] }],
|
|
223
|
+
"no-console": "error",
|
|
224
|
+
"no-else-return": "error",
|
|
225
|
+
"no-multi-str": "error",
|
|
226
|
+
"no-restricted-properties": [
|
|
227
|
+
"error",
|
|
228
|
+
{
|
|
229
|
+
object: "Object",
|
|
230
|
+
property: "assign",
|
|
231
|
+
message: "Object.assign allows getting around type checking. Consider another solution.",
|
|
232
|
+
},
|
|
233
|
+
],
|
|
234
|
+
"no-self-assign": "error",
|
|
235
|
+
"object-shorthand": "error",
|
|
236
|
+
"prefer-template": "error",
|
|
237
|
+
"promise/prefer-await-to-then": "error",
|
|
238
|
+
"spaced-comment": "error",
|
|
239
|
+
},
|
|
331
240
|
},
|
|
332
|
-
|
|
241
|
+
];
|
package/package.json
CHANGED
|
@@ -1,40 +1,51 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-config-deepcrawl",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "ESLint rules recommended by DeepCrawl.",
|
|
3
|
+
"version": "14.0.0",
|
|
4
|
+
"description": "ESLint rules recommended by Lumar (formerly DeepCrawl).",
|
|
5
5
|
"homepage": "https://github.com/deepcrawl/eslint-config",
|
|
6
6
|
"bugs": {
|
|
7
7
|
"url": "https://github.com/deepcrawl/eslint-config/issues"
|
|
8
8
|
},
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "ssh://git@github.com/deepcrawl/eslint-config.git"
|
|
12
|
+
},
|
|
9
13
|
"license": "MIT",
|
|
10
14
|
"author": "DeepCrawl",
|
|
15
|
+
"type": "module",
|
|
11
16
|
"main": "index.js",
|
|
12
17
|
"files": [
|
|
13
18
|
"index.js"
|
|
14
19
|
],
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
},
|
|
19
|
-
"publishConfig": {
|
|
20
|
-
"registry": "https://registry.npmjs.org/"
|
|
20
|
+
"scripts": {
|
|
21
|
+
"prettier:check": "prettier --list-different .",
|
|
22
|
+
"prettier:fix": "prettier --write ."
|
|
21
23
|
},
|
|
22
24
|
"dependencies": {
|
|
23
|
-
"@
|
|
24
|
-
"@typescript-eslint/parser": "^8.8.1",
|
|
25
|
+
"@eslint/js": "^9.12.0",
|
|
25
26
|
"eslint-config-prettier": "^9.1.0",
|
|
26
|
-
"eslint-plugin-array-func": "^
|
|
27
|
+
"eslint-plugin-array-func": "^5.0.2",
|
|
27
28
|
"eslint-plugin-import": "^2.31.0",
|
|
28
29
|
"eslint-plugin-jest": "^28.8.3",
|
|
29
|
-
"eslint-plugin-json-format": "^2.0.1",
|
|
30
30
|
"eslint-plugin-n": "^17.11.1",
|
|
31
|
-
"eslint-plugin-no-loops": "^0.
|
|
31
|
+
"eslint-plugin-no-loops": "^0.4.0",
|
|
32
|
+
"eslint-plugin-package-json": "^0.15.3",
|
|
32
33
|
"eslint-plugin-promise": "^7.1.0",
|
|
33
|
-
"eslint-plugin-sonarjs": "^2.0.3"
|
|
34
|
+
"eslint-plugin-sonarjs": "^2.0.3",
|
|
35
|
+
"jsonc-eslint-parser": "^2.4.0",
|
|
36
|
+
"typescript-eslint": "^8.9.0"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@types/eslint__js": "8.42.3",
|
|
40
|
+
"prettier": "3.3.3",
|
|
41
|
+
"prettier-plugin-packagejson": "2.5.3"
|
|
34
42
|
},
|
|
35
43
|
"peerDependencies": {
|
|
36
|
-
"eslint": "^
|
|
37
|
-
"typescript": ">=5.
|
|
44
|
+
"eslint": "^9.12.0",
|
|
45
|
+
"typescript": ">=5.4"
|
|
38
46
|
},
|
|
39
|
-
"packageManager": "yarn@4.5.0"
|
|
47
|
+
"packageManager": "yarn@4.5.0",
|
|
48
|
+
"publishConfig": {
|
|
49
|
+
"registry": "https://registry.npmjs.org/"
|
|
50
|
+
}
|
|
40
51
|
}
|