eslint-config-deepcrawl 14.16.0 → 16.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 +18 -1
- package/index.js +44 -44
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ 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@^10.0.0
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
## Usage
|
|
@@ -60,3 +60,20 @@ Apart from ESLint, it is recommended to use the following Prettier configuration
|
|
|
60
60
|
```
|
|
61
61
|
|
|
62
62
|
with `lint-staged` pre-commit hook done via `husky`.
|
|
63
|
+
|
|
64
|
+
## Migrating from v14
|
|
65
|
+
|
|
66
|
+
v15 upgrades to ESLint 10 and replaces `eslint-plugin-import` with its
|
|
67
|
+
maintained fork `eslint-plugin-import-x`. To upgrade:
|
|
68
|
+
|
|
69
|
+
1. Bump `eslint` to `^10.0.0` (drop ESLint 9).
|
|
70
|
+
2. Rename every `import/*` rule reference in your `eslint.config.*` to
|
|
71
|
+
`import-x/*` — e.g. `"import/no-default-export"` →
|
|
72
|
+
`"import-x/no-default-export"`. ESLint silently ignores unknown rule
|
|
73
|
+
names set to `"off"`, so a missed rename turns into a silent loss of
|
|
74
|
+
your override.
|
|
75
|
+
3. Remove `@types/eslint__js` from your `devDependencies` if you have it
|
|
76
|
+
— `@eslint/js@10` now ships its own type definitions.
|
|
77
|
+
|
|
78
|
+
No other consumer changes are required; the rest of the ruleset is
|
|
79
|
+
unchanged.
|
package/index.js
CHANGED
|
@@ -1,48 +1,45 @@
|
|
|
1
1
|
import eslintJs from "@eslint/js";
|
|
2
|
+
import stylisticPlugin from "@stylistic/eslint-plugin";
|
|
3
|
+
import { defineConfig } from "eslint/config";
|
|
2
4
|
import eslintConfigPrettier from "eslint-config-prettier/flat";
|
|
3
5
|
import arrayFuncPlugin from "eslint-plugin-array-func";
|
|
4
|
-
import
|
|
6
|
+
import importXPlugin from "eslint-plugin-import-x";
|
|
5
7
|
import jestPlugin from "eslint-plugin-jest";
|
|
6
|
-
import noLoopsPlugin from "eslint-plugin-no-loops";
|
|
7
8
|
import nodePlugin from "eslint-plugin-n";
|
|
8
|
-
import
|
|
9
|
+
import noLoopsPlugin from "eslint-plugin-no-loops";
|
|
10
|
+
import packageJsonPlugin from "eslint-plugin-package-json";
|
|
9
11
|
import promisePlugin from "eslint-plugin-promise";
|
|
10
12
|
import sonarjsPlugin from "eslint-plugin-sonarjs";
|
|
11
13
|
import typescriptEslint from "typescript-eslint";
|
|
12
14
|
|
|
13
|
-
export default [
|
|
15
|
+
export default defineConfig([
|
|
16
|
+
{ linterOptions: { reportUnusedDisableDirectives: true } },
|
|
17
|
+
|
|
14
18
|
eslintJs.configs.recommended,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
files: ["**/*.{cts,mts,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,
|
|
19
|
+
importXPlugin.flatConfigs.recommended,
|
|
20
|
+
importXPlugin.flatConfigs.typescript,
|
|
31
21
|
jestPlugin.configs["flat/recommended"],
|
|
32
22
|
nodePlugin.configs["flat/recommended"],
|
|
23
|
+
promisePlugin.configs["flat/recommended"],
|
|
33
24
|
{
|
|
34
|
-
...
|
|
25
|
+
...packageJsonPlugin.configs.recommended,
|
|
35
26
|
rules: {
|
|
36
|
-
...
|
|
27
|
+
...packageJsonPlugin.configs.recommended.rules,
|
|
37
28
|
// https://github.com/JoshuaKGoldberg/eslint-plugin-package-json/issues/499
|
|
38
29
|
"package-json/sort-collections": ["error", ["devDependencies", "dependencies", "peerDependencies", "config"]],
|
|
39
30
|
},
|
|
40
31
|
},
|
|
41
|
-
|
|
42
|
-
eslintConfigPrettier,
|
|
32
|
+
|
|
43
33
|
{
|
|
44
|
-
|
|
34
|
+
files: ["**/*.{cts,mts,ts,tsx}"],
|
|
35
|
+
extends: [typescriptEslint.configs.recommendedTypeChecked],
|
|
36
|
+
languageOptions: { parserOptions: { projectService: true } },
|
|
45
37
|
},
|
|
38
|
+
{
|
|
39
|
+
files: ["**/*.{cjs,js,jsx,mjs}"],
|
|
40
|
+
extends: [typescriptEslint.configs.disableTypeChecked],
|
|
41
|
+
},
|
|
42
|
+
|
|
46
43
|
{
|
|
47
44
|
plugins: { "array-func": arrayFuncPlugin },
|
|
48
45
|
rules: { "array-func/avoid-reverse": "error" },
|
|
@@ -77,6 +74,9 @@ export default [
|
|
|
77
74
|
"sonarjs/prefer-while": "error",
|
|
78
75
|
},
|
|
79
76
|
},
|
|
77
|
+
|
|
78
|
+
eslintConfigPrettier,
|
|
79
|
+
|
|
80
80
|
{
|
|
81
81
|
files: ["**/*.{cts,mts,ts,tsx}"],
|
|
82
82
|
rules: {
|
|
@@ -141,7 +141,6 @@ export default [
|
|
|
141
141
|
Number: { message: "Use number instead", fixWith: "number" },
|
|
142
142
|
Symbol: { message: "Use symbol instead", fixWith: "symbol" },
|
|
143
143
|
BigInt: { message: "Use bigint instead", fixWith: "bigint" },
|
|
144
|
-
// object typing
|
|
145
144
|
Object: {
|
|
146
145
|
message: [
|
|
147
146
|
'The `Object` type actually means "any non-nullish value", so it is marginally better than `unknown`.',
|
|
@@ -174,24 +173,25 @@ export default [
|
|
|
174
173
|
"@typescript-eslint/require-array-sort-compare": "error",
|
|
175
174
|
"@typescript-eslint/restrict-template-expressions": "off",
|
|
176
175
|
"@typescript-eslint/return-await": "error",
|
|
177
|
-
"@typescript-eslint/sort-type-constituents": "error",
|
|
178
176
|
"@typescript-eslint/unified-signatures": "error",
|
|
179
177
|
},
|
|
180
178
|
},
|
|
179
|
+
|
|
181
180
|
{
|
|
181
|
+
plugins: { "@stylistic": stylisticPlugin },
|
|
182
182
|
rules: {
|
|
183
183
|
complexity: ["error", 15],
|
|
184
184
|
"default-case-last": "error",
|
|
185
|
-
"import/default": "off",
|
|
186
|
-
"import/named": "off",
|
|
187
|
-
"import/namespace": "off",
|
|
188
|
-
"import/newline-after-import": "error",
|
|
189
|
-
"import/no-default-export": "error",
|
|
190
|
-
"import/no-named-as-default": "off",
|
|
191
|
-
"import/no-named-as-default-member": "off",
|
|
192
|
-
"import/no-relative-packages": "error",
|
|
193
|
-
"import/no-unresolved": "off",
|
|
194
|
-
"import/order": [
|
|
185
|
+
"import-x/default": "off",
|
|
186
|
+
"import-x/named": "off",
|
|
187
|
+
"import-x/namespace": "off",
|
|
188
|
+
"import-x/newline-after-import": "error",
|
|
189
|
+
"import-x/no-default-export": "error",
|
|
190
|
+
"import-x/no-named-as-default": "off",
|
|
191
|
+
"import-x/no-named-as-default-member": "off",
|
|
192
|
+
"import-x/no-relative-packages": "error",
|
|
193
|
+
"import-x/no-unresolved": "off",
|
|
194
|
+
"import-x/order": [
|
|
195
195
|
"error",
|
|
196
196
|
{
|
|
197
197
|
alphabetize: { order: "asc", caseInsensitive: true },
|
|
@@ -209,13 +209,14 @@ export default [
|
|
|
209
209
|
"jest/prefer-expect-resolves": "error",
|
|
210
210
|
"jest/prefer-to-be": "error",
|
|
211
211
|
"max-classes-per-file": ["error", 1],
|
|
212
|
-
"max-len": [
|
|
213
|
-
"error",
|
|
214
|
-
{ code: 120, ignoreComments: true, ignorePattern: "^(export|import)*", ignoreTemplateLiterals: true },
|
|
215
|
-
],
|
|
216
212
|
"max-lines-per-function": ["warn", { max: 40, skipBlankLines: true, skipComments: true, IIFEs: true }],
|
|
217
213
|
"max-params": ["error", 7],
|
|
218
|
-
"max-
|
|
214
|
+
"@stylistic/max-len": [
|
|
215
|
+
"error",
|
|
216
|
+
{ code: 120, ignoreComments: true, ignorePattern: "^(export|import)\\b", ignoreTemplateLiterals: true },
|
|
217
|
+
],
|
|
218
|
+
"@stylistic/max-statements-per-line": ["error", { max: 1 }],
|
|
219
|
+
"@stylistic/spaced-comment": "error",
|
|
219
220
|
"n/no-missing-import": "off",
|
|
220
221
|
"n/no-unsupported-features/node-builtins": ["error", { ignores: ["fetch", "navigator", "Response", "Request"] }],
|
|
221
222
|
"n/no-unsupported-features/es-syntax": ["error", { ignores: ["modules"] }],
|
|
@@ -235,7 +236,6 @@ export default [
|
|
|
235
236
|
"object-shorthand": "error",
|
|
236
237
|
"prefer-template": "error",
|
|
237
238
|
"promise/prefer-await-to-then": "error",
|
|
238
|
-
"spaced-comment": "error",
|
|
239
239
|
},
|
|
240
240
|
},
|
|
241
|
-
];
|
|
241
|
+
]);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-config-deepcrawl",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "16.0.0",
|
|
4
4
|
"description": "ESLint rules recommended by Lumar (formerly DeepCrawl).",
|
|
5
5
|
"homepage": "https://github.com/deepcrawl/eslint-config",
|
|
6
6
|
"bugs": {
|
|
@@ -22,26 +22,26 @@
|
|
|
22
22
|
"prettier:fix": "prettier --write ."
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@eslint/js": "^
|
|
25
|
+
"@eslint/js": "^10.0.1",
|
|
26
|
+
"@stylistic/eslint-plugin": "^5.10.0",
|
|
26
27
|
"eslint-config-prettier": "^10.1.8",
|
|
28
|
+
"eslint-import-resolver-typescript": "^4.4.4",
|
|
27
29
|
"eslint-plugin-array-func": "^5.1.1",
|
|
28
|
-
"eslint-plugin-import": "^
|
|
30
|
+
"eslint-plugin-import-x": "^4.16.2",
|
|
29
31
|
"eslint-plugin-jest": "^29.15.2",
|
|
30
|
-
"eslint-plugin-n": "^
|
|
32
|
+
"eslint-plugin-n": "^18.0.1",
|
|
31
33
|
"eslint-plugin-no-loops": "^0.4.0",
|
|
32
|
-
"eslint-plugin-package-json": "^
|
|
34
|
+
"eslint-plugin-package-json": "^1.1.0",
|
|
33
35
|
"eslint-plugin-promise": "^7.3.0",
|
|
34
36
|
"eslint-plugin-sonarjs": "^4.0.3",
|
|
35
|
-
"
|
|
36
|
-
"typescript-eslint": "^8.59.0"
|
|
37
|
+
"typescript-eslint": "^8.59.4"
|
|
37
38
|
},
|
|
38
39
|
"devDependencies": {
|
|
39
|
-
"@types/eslint__js": "9.14.0",
|
|
40
40
|
"prettier": "3.8.3",
|
|
41
41
|
"prettier-plugin-packagejson": "3.0.2"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
|
-
"eslint": "^
|
|
44
|
+
"eslint": "^10.0.0",
|
|
45
45
|
"typescript": ">=5.8"
|
|
46
46
|
},
|
|
47
47
|
"packageManager": "yarn@4.14.1",
|