eslint-config-webpack 4.6.3 → 4.7.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/configs/browser.js
CHANGED
package/configs/javascript.js
CHANGED
|
@@ -626,6 +626,8 @@ const suggestions = {
|
|
|
626
626
|
|
|
627
627
|
"prefer-template": "error",
|
|
628
628
|
|
|
629
|
+
"preserve-caught-error": "error",
|
|
630
|
+
|
|
629
631
|
radix: ["error", "always"],
|
|
630
632
|
|
|
631
633
|
// `require-await` doesn't work when the function returns Promise<any>
|
|
@@ -750,6 +752,8 @@ const unicornRules = {
|
|
|
750
752
|
// No need
|
|
751
753
|
// "unicorn/no-array-reverse": "off",
|
|
752
754
|
|
|
755
|
+
"unicorn/no-array-sort": "error",
|
|
756
|
+
|
|
753
757
|
// No need
|
|
754
758
|
// "unicorn/no-await-expression-member": "off",
|
|
755
759
|
|
|
@@ -768,6 +772,9 @@ const unicornRules = {
|
|
|
768
772
|
|
|
769
773
|
"unicorn/no-hex-escape": "error",
|
|
770
774
|
|
|
775
|
+
// No need
|
|
776
|
+
// "unicorn/no-immediate-mutation": "error",
|
|
777
|
+
|
|
771
778
|
"unicorn/no-instanceof-builtins": "error",
|
|
772
779
|
|
|
773
780
|
"unicorn/no-invalid-fetch-options": "error",
|
|
@@ -841,6 +848,8 @@ const unicornRules = {
|
|
|
841
848
|
// No need
|
|
842
849
|
// "unicorn/no-unused-properties": "off",
|
|
843
850
|
|
|
851
|
+
"unicorn/no-useless-collection-argument": "error",
|
|
852
|
+
|
|
844
853
|
"unicorn/no-useless-error-capture-stack-trace": "error",
|
|
845
854
|
|
|
846
855
|
"unicorn/no-useless-fallback-in-spread": "error",
|
|
@@ -882,10 +891,15 @@ const unicornRules = {
|
|
|
882
891
|
// No need
|
|
883
892
|
// "unicorn/prefer-at": "off",
|
|
884
893
|
|
|
894
|
+
"unicorn/prefer-bigint-literals": "error",
|
|
895
|
+
|
|
885
896
|
"unicorn/prefer-blob-reading-methods": "error",
|
|
886
897
|
|
|
887
898
|
"unicorn/prefer-class-fields": "error",
|
|
888
899
|
|
|
900
|
+
// Not here, define only for `browsers`
|
|
901
|
+
// "unicorn/prefer-classlist-toggle": "error",
|
|
902
|
+
|
|
889
903
|
// No need
|
|
890
904
|
// "unicorn/prefer-code-point": "error",
|
|
891
905
|
|
|
@@ -963,6 +977,8 @@ const unicornRules = {
|
|
|
963
977
|
|
|
964
978
|
"unicorn/prefer-regexp-test": "error",
|
|
965
979
|
|
|
980
|
+
"unicorn/prefer-response-static-json": "error",
|
|
981
|
+
|
|
966
982
|
// No need
|
|
967
983
|
// "unicorn/prefer-set-has": "off",
|
|
968
984
|
|
|
@@ -1005,6 +1021,8 @@ const unicornRules = {
|
|
|
1005
1021
|
// No need
|
|
1006
1022
|
// "unicorn/require-array-join-separator": "error",
|
|
1007
1023
|
|
|
1024
|
+
"unicorn/require-module-attributes": "error",
|
|
1025
|
+
|
|
1008
1026
|
"unicorn/require-module-specifiers": "error",
|
|
1009
1027
|
|
|
1010
1028
|
// No need
|
|
@@ -1249,8 +1267,6 @@ function getConfig(esVersion) {
|
|
|
1249
1267
|
config.rules["prefer-object-spread"] = "off";
|
|
1250
1268
|
}
|
|
1251
1269
|
|
|
1252
|
-
// unicorn/prefer-class-fields
|
|
1253
|
-
|
|
1254
1270
|
if (esVersion < 2019) {
|
|
1255
1271
|
config.rules["unicorn/prefer-object-from-entries"] = "off";
|
|
1256
1272
|
config.rules["unicorn/prefer-array-flat"] = "off";
|
|
@@ -1260,6 +1276,7 @@ function getConfig(esVersion) {
|
|
|
1260
1276
|
}
|
|
1261
1277
|
|
|
1262
1278
|
if (esVersion < 2020) {
|
|
1279
|
+
config.rules["unicorn/prefer-bigint-literals"] = "off";
|
|
1263
1280
|
config.rules["unicorn/prefer-global-this"] = "off";
|
|
1264
1281
|
config.rules["unicorn/prefer-logical-operator-over-ternary"] = "off";
|
|
1265
1282
|
}
|
package/configs/jest.js
CHANGED
|
@@ -102,6 +102,8 @@ async function getJestRecommendedConfig() {
|
|
|
102
102
|
// No need
|
|
103
103
|
// "jest/no-test-return-statement": "error",
|
|
104
104
|
|
|
105
|
+
"jest/no-unneeded-async-expect-function": "error",
|
|
106
|
+
|
|
105
107
|
// No need
|
|
106
108
|
// "jest/no-untyped-mock-factory": "error",
|
|
107
109
|
|
|
@@ -164,6 +166,10 @@ async function getJestRecommendedConfig() {
|
|
|
164
166
|
|
|
165
167
|
"jest/prefer-to-contain": "error",
|
|
166
168
|
|
|
169
|
+
"jest/prefer-to-have-been-called": "error",
|
|
170
|
+
|
|
171
|
+
"jest/prefer-to-have-been-called-times": "error",
|
|
172
|
+
|
|
167
173
|
"jest/prefer-to-have-length": "error",
|
|
168
174
|
|
|
169
175
|
// No need
|
|
@@ -186,6 +192,9 @@ async function getJestRecommendedConfig() {
|
|
|
186
192
|
// From recommended
|
|
187
193
|
// "jest/valid-expect-in-promise": "error",
|
|
188
194
|
|
|
195
|
+
// No need
|
|
196
|
+
// "valid-mock-module-path": "off",
|
|
197
|
+
|
|
189
198
|
// From recommended
|
|
190
199
|
"jest/valid-title": [
|
|
191
200
|
"error",
|
package/configs/typescript.js
CHANGED
|
@@ -105,6 +105,9 @@ async function getTypescriptJSDocRecommendedConfig() {
|
|
|
105
105
|
// From recommended
|
|
106
106
|
// "jsdoc/empty-tags": "error",
|
|
107
107
|
|
|
108
|
+
// From recommended
|
|
109
|
+
// "jsdoc/escape-inline-tags": "error",
|
|
110
|
+
|
|
108
111
|
// "jsdoc/implements-on-classes": "error",
|
|
109
112
|
|
|
110
113
|
// No need
|
|
@@ -154,28 +157,11 @@ async function getTypescriptJSDocRecommendedConfig() {
|
|
|
154
157
|
message:
|
|
155
158
|
"Please use `@property {string=} property`/`@param {string=} arg` instead `[arg]` for optional properties and parameters",
|
|
156
159
|
},
|
|
157
|
-
// No `*` type
|
|
158
|
-
{
|
|
159
|
-
comment: "JsdocBlock:has(JsdocTypeAny)",
|
|
160
|
-
message: "Please use `any` or `EXPECTED_ANY` type.",
|
|
161
|
-
},
|
|
162
160
|
// No `?` type
|
|
163
161
|
{
|
|
164
162
|
comment: "JsdocBlock:has(JsdocTypeUnknown)",
|
|
165
163
|
message: "Please use `unknown` or `any` (or `EXPECTED_ANY`) type",
|
|
166
164
|
},
|
|
167
|
-
// No `any` type
|
|
168
|
-
{
|
|
169
|
-
comment: "JsdocBlock:has(JsdocTypeName[value=/^any$/])",
|
|
170
|
-
message: "Please use provide types instead `any`",
|
|
171
|
-
},
|
|
172
|
-
// No `Function` type
|
|
173
|
-
{
|
|
174
|
-
comment:
|
|
175
|
-
"JsdocBlock:has(JsdocTypeName[value=/^(function|Function)$/])",
|
|
176
|
-
message:
|
|
177
|
-
"Please use provide types for function - `(a: number, b: number) -> number` instead `Function`/`function` or use `EXPECTED_FUNCTION` type",
|
|
178
|
-
},
|
|
179
165
|
// No `Object`
|
|
180
166
|
{
|
|
181
167
|
comment:
|
|
@@ -199,6 +185,13 @@ async function getTypescriptJSDocRecommendedConfig() {
|
|
|
199
185
|
// No need
|
|
200
186
|
// "jsdoc/no-undefined-types": "error",
|
|
201
187
|
|
|
188
|
+
// TODO enable me in future
|
|
189
|
+
// "jsdoc/prefer-import-tag": "error",
|
|
190
|
+
|
|
191
|
+
"jsdoc/reject-any-type": "error",
|
|
192
|
+
|
|
193
|
+
"jsdoc/reject-function-type": "error",
|
|
194
|
+
|
|
202
195
|
"jsdoc/require-asterisk-prefix": "error",
|
|
203
196
|
|
|
204
197
|
// No need
|
|
@@ -219,6 +212,12 @@ async function getTypescriptJSDocRecommendedConfig() {
|
|
|
219
212
|
// From recommended
|
|
220
213
|
// "jsdoc/require-jsdoc": "error",
|
|
221
214
|
|
|
215
|
+
// No need
|
|
216
|
+
// "jsdoc/require-next-description":"error",
|
|
217
|
+
|
|
218
|
+
// No need
|
|
219
|
+
// "jsdoc/require-next-type": "error",
|
|
220
|
+
|
|
222
221
|
// From recommended
|
|
223
222
|
// "jsdoc/require-param": "error",
|
|
224
223
|
|
|
@@ -252,14 +251,32 @@ async function getTypescriptJSDocRecommendedConfig() {
|
|
|
252
251
|
// From recommended
|
|
253
252
|
// "jsdoc/require-returns-type": "error",
|
|
254
253
|
|
|
254
|
+
// No need
|
|
255
|
+
// "jsdoc/require-tags": "error",
|
|
256
|
+
|
|
255
257
|
"jsdoc/require-template": "error",
|
|
256
258
|
|
|
259
|
+
// No need
|
|
260
|
+
// "jsdoc/require-template-description": "error",
|
|
261
|
+
|
|
257
262
|
// No need
|
|
258
263
|
// "jsdoc/require-throws": "error",
|
|
259
264
|
|
|
265
|
+
// No need
|
|
266
|
+
// "jsdoc/require-throws-description": "error",
|
|
267
|
+
|
|
268
|
+
// No need
|
|
269
|
+
// "jsdoc/require-throws-type": "error",
|
|
270
|
+
|
|
260
271
|
// From recommended
|
|
261
272
|
// "jsdoc/require-yields": "error",
|
|
262
273
|
|
|
274
|
+
// No need
|
|
275
|
+
// "jsdoc/require-yields-description": "error",
|
|
276
|
+
|
|
277
|
+
// No need
|
|
278
|
+
// "jsdoc/require-yields-type": "error",
|
|
279
|
+
|
|
263
280
|
// From recommended
|
|
264
281
|
// "jsdoc/require-yields-check": "error",
|
|
265
282
|
|
|
@@ -272,6 +289,9 @@ async function getTypescriptJSDocRecommendedConfig() {
|
|
|
272
289
|
// No need
|
|
273
290
|
// "jsdoc/text-escaping": "error",
|
|
274
291
|
|
|
292
|
+
// TODO enable after https://github.com/gajus/eslint-plugin-jsdoc/issues/1615
|
|
293
|
+
// "jsdoc/type-formatting": "error",
|
|
294
|
+
|
|
275
295
|
// Doesn't support function overloading/tuples/`readonly`/module keyword/etc
|
|
276
296
|
// Also `typescript` reports this itself
|
|
277
297
|
"jsdoc/valid-types": "off",
|
|
@@ -598,6 +618,9 @@ async function getTypescriptRecommendedConfig() {
|
|
|
598
618
|
// From recommended
|
|
599
619
|
// "@typescript-eslint/no-unused-expressions": "error",
|
|
600
620
|
|
|
621
|
+
"no-unused-private-class-members": "off",
|
|
622
|
+
"@typescript-eslint/no-unused-private-class-members": "error",
|
|
623
|
+
|
|
601
624
|
// Provide better options
|
|
602
625
|
"no-unused-vars": "off",
|
|
603
626
|
"@typescript-eslint/no-unused-vars": [
|
|
@@ -633,6 +656,9 @@ async function getTypescriptRecommendedConfig() {
|
|
|
633
656
|
// No need
|
|
634
657
|
// "@typescript-eslint/no-useless-constructor": "error",
|
|
635
658
|
|
|
659
|
+
// No need
|
|
660
|
+
// "@typescript-eslint/no-useless-default-assignment": "error",
|
|
661
|
+
|
|
636
662
|
"@typescript-eslint/no-useless-empty-export": "error",
|
|
637
663
|
|
|
638
664
|
// From recommended
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-config-webpack",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.7.0",
|
|
4
4
|
"description": "Provides Webpack's eslint rules as an extensible shared config",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -37,32 +37,32 @@
|
|
|
37
37
|
"release": "standard-version"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"detect-indent": "^7.0.
|
|
41
|
-
"jsonc-eslint-parser": "^2.4.
|
|
42
|
-
"semver": "^7.7.
|
|
43
|
-
"sort-package-json": "^3.
|
|
40
|
+
"detect-indent": "^7.0.2",
|
|
41
|
+
"jsonc-eslint-parser": "^2.4.2",
|
|
42
|
+
"semver": "^7.7.3",
|
|
43
|
+
"sort-package-json": "^3.6.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@eslint/js": "^9.
|
|
47
|
-
"@eslint/markdown": "^7.1
|
|
48
|
-
"@stylistic/eslint-plugin": "^5.
|
|
49
|
-
"eslint": "^9.
|
|
46
|
+
"@eslint/js": "^9.39.2",
|
|
47
|
+
"@eslint/markdown": "^7.5.1",
|
|
48
|
+
"@stylistic/eslint-plugin": "^5.6.1",
|
|
49
|
+
"eslint": "^9.39.2",
|
|
50
50
|
"eslint-find-rules": "^5.0.0",
|
|
51
51
|
"eslint-plugin-import": "^2.32.0",
|
|
52
|
-
"eslint-plugin-jest": "^29.0
|
|
53
|
-
"eslint-plugin-jsdoc": "^
|
|
54
|
-
"eslint-plugin-n": "^17.
|
|
52
|
+
"eslint-plugin-jest": "^29.5.0",
|
|
53
|
+
"eslint-plugin-jsdoc": "^61.5.0",
|
|
54
|
+
"eslint-plugin-n": "^17.23.1",
|
|
55
55
|
"eslint-plugin-prettier": "^5.5.3",
|
|
56
56
|
"eslint-plugin-react": "^7.37.5",
|
|
57
|
-
"eslint-plugin-unicorn": "^
|
|
58
|
-
"globals": "^16.
|
|
59
|
-
"jest": "^30.0
|
|
60
|
-
"prettier": "^3.
|
|
61
|
-
"react": "^19.
|
|
62
|
-
"react-dom": "^19.
|
|
57
|
+
"eslint-plugin-unicorn": "^62.0.0",
|
|
58
|
+
"globals": "^16.5.0",
|
|
59
|
+
"jest": "^30.2.0",
|
|
60
|
+
"prettier": "^3.7.4",
|
|
61
|
+
"react": "^19.2.3",
|
|
62
|
+
"react-dom": "^19.2.3",
|
|
63
63
|
"standard-version": "^9.5.0",
|
|
64
|
-
"typescript": "^5.
|
|
65
|
-
"typescript-eslint": "^8.
|
|
64
|
+
"typescript": "^5.9.3",
|
|
65
|
+
"typescript-eslint": "^8.50.0"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
68
|
"@eslint/js": ">= 9.28.0",
|
|
@@ -77,10 +77,10 @@
|
|
|
77
77
|
"eslint-plugin-prettier": ">= 5.5.3",
|
|
78
78
|
"eslint-plugin-react": ">= 7.37.5",
|
|
79
79
|
"eslint-plugin-unicorn": ">= 60.0.0",
|
|
80
|
-
"globals": ">= 16.
|
|
80
|
+
"globals": ">= 16.5.0",
|
|
81
81
|
"prettier": ">= 3.5.3",
|
|
82
82
|
"typescript": ">= 5.0.0",
|
|
83
|
-
"typescript-eslint": ">= 8.
|
|
83
|
+
"typescript-eslint": ">= 8.50.0"
|
|
84
84
|
},
|
|
85
85
|
"peerDependenciesMeta": {
|
|
86
86
|
"@eslint/markdown": {
|
|
@@ -30,7 +30,7 @@ function detectNewlineGraceful(string) {
|
|
|
30
30
|
return detectNewline(string) || "\n";
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
// eslint-disable-next-line jsdoc/
|
|
33
|
+
// eslint-disable-next-line jsdoc/reject-any-type
|
|
34
34
|
/** @typedef {Record<string, any>} ObjectToSort */
|
|
35
35
|
|
|
36
36
|
/**
|
|
@@ -50,7 +50,7 @@ function sortObjectKeys(object, sortWith) {
|
|
|
50
50
|
|
|
51
51
|
const objectKeys = Object.keys(object);
|
|
52
52
|
|
|
53
|
-
return (keys ||
|
|
53
|
+
return (keys || objectKeys.toSorted(sortFn)).reduce((total, key) => {
|
|
54
54
|
if (Object.hasOwn(object, key)) {
|
|
55
55
|
total[key] = object[key];
|
|
56
56
|
}
|
|
@@ -66,11 +66,12 @@ function sortObjectKeys(object, sortWith) {
|
|
|
66
66
|
export const isPackageJson = (filePath) =>
|
|
67
67
|
/(?:^|[/\\])package.json$/.test(filePath);
|
|
68
68
|
|
|
69
|
-
|
|
69
|
+
/* eslint-disable jsdoc/reject-any-type */
|
|
70
70
|
/**
|
|
71
71
|
* @typedef {import("eslint").AST.Program} PackageJsonAst
|
|
72
72
|
* @property {[any]} body body
|
|
73
73
|
*/
|
|
74
|
+
/* eslint-enable jsdoc/reject-any-type */
|
|
74
75
|
|
|
75
76
|
/**
|
|
76
77
|
* @typedef {import("eslint").SourceCode} PackageJsonSourceCode
|