@html-validate/eslint-config 9.4.6 → 9.5.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/dist/cli.mjs +3 -3
- package/dist/cli.mjs.map +2 -2
- package/index.mjs +13 -114
- package/package.json +3 -3
package/index.mjs
CHANGED
|
@@ -96,9 +96,9 @@ export default [
|
|
|
96
96
|
|
|
97
97
|
/* enable eslint-plugin-unicorn */
|
|
98
98
|
...eslintPluginUnicorn.configs.recommended.rules,
|
|
99
|
-
"unicorn/better-dom-traversing": "error",
|
|
100
99
|
"unicorn/catch-error-name": "off",
|
|
101
100
|
"unicorn/consistent-assert": "off",
|
|
101
|
+
"unicorn/consistent-class-member-order": "off",
|
|
102
102
|
"unicorn/consistent-compound-words": [
|
|
103
103
|
"error",
|
|
104
104
|
{
|
|
@@ -109,20 +109,14 @@ export default [
|
|
|
109
109
|
},
|
|
110
110
|
},
|
|
111
111
|
],
|
|
112
|
-
"unicorn/consistent-date-clone": "error",
|
|
113
112
|
"unicorn/consistent-empty-array-spread": "off",
|
|
114
|
-
"unicorn/consistent-existence-index-check": "error",
|
|
115
|
-
"unicorn/consistent-function-scoping": "error",
|
|
116
|
-
"unicorn/consistent-json-file-read": "error",
|
|
117
|
-
"unicorn/consistent-template-literal-escape": "error",
|
|
118
113
|
"unicorn/custom-error-definition": "error",
|
|
119
114
|
"unicorn/dom-node-dataset": "off",
|
|
120
|
-
"unicorn/error-message": "error",
|
|
121
115
|
"unicorn/escape-case": "off", // typically not useful for this organisation
|
|
122
116
|
"unicorn/expiring-todo-comments": "off", // could be useful later
|
|
123
117
|
"unicorn/explicit-length-check": ["error", { "non-zero": "greater-than" }],
|
|
124
118
|
"unicorn/filename-case": [
|
|
125
|
-
|
|
119
|
+
/* enforce kebab-case in filenames */
|
|
126
120
|
"error",
|
|
127
121
|
{
|
|
128
122
|
case: "kebabCase",
|
|
@@ -130,157 +124,62 @@ export default [
|
|
|
130
124
|
},
|
|
131
125
|
],
|
|
132
126
|
"unicorn/import-style": "off", // off for now
|
|
133
|
-
"unicorn/isolated-functions": "error",
|
|
134
|
-
"unicorn/new-for-builtins": "error",
|
|
135
127
|
"unicorn/no-abusive-eslint-disable": "off", // covered by eslint-plugin-eslint-comments
|
|
136
|
-
"unicorn/no-
|
|
137
|
-
"unicorn/no-anonymous-default-export": "error",
|
|
138
|
-
"unicorn/no-array-callback-reference": "off", // opinionated, prefer to allow passing function references to array methods (and for most part typescript will handle this)
|
|
139
|
-
"unicorn/no-array-fill-with-reference-type": "error",
|
|
140
|
-
"unicorn/no-array-for-each": "error",
|
|
141
|
-
"unicorn/no-array-from-fill": "error",
|
|
142
|
-
"unicorn/no-array-method-this-argument": "error",
|
|
128
|
+
"unicorn/no-array-callback-reference": "off", // opinionated, prefer to allow passing function references to array methods (and for most part TypeScript will handle this)
|
|
143
129
|
"unicorn/no-array-reduce": "off", // allow usage of reduce()
|
|
144
|
-
"unicorn/no-array-reverse": "error", // prefer immutable .toReversed() (available in Node.js 20+)
|
|
145
|
-
"unicorn/no-array-sort": "error", // prefer immutable .toSorted() (available in Node.js 20+)
|
|
146
|
-
"unicorn/no-await-expression-member": "error",
|
|
147
|
-
"unicorn/no-await-in-promise-methods": "error",
|
|
148
|
-
"unicorn/no-blob-to-file": "error",
|
|
149
130
|
"unicorn/no-canvas-to-image": "off", // not really relevant for the html-validate projects
|
|
150
|
-
"unicorn/no-confusing-array-splice": "error",
|
|
151
|
-
"unicorn/no-console-spaces": "error",
|
|
152
131
|
"unicorn/no-document-cookie": "off", // typically not useful for this organisation
|
|
153
|
-
"unicorn/no-duplicate-set-values": "error",
|
|
154
132
|
"unicorn/no-empty-file": "off",
|
|
155
|
-
"unicorn/no-exports-in-scripts": "error",
|
|
156
|
-
"unicorn/no-for-loop": "error",
|
|
157
|
-
"unicorn/no-hex-escape": "error",
|
|
158
133
|
"unicorn/no-immediate-mutation": "off",
|
|
159
|
-
"unicorn/no-
|
|
160
|
-
"unicorn/no-
|
|
161
|
-
"unicorn/no-
|
|
162
|
-
"unicorn/no-invalid-file-input-accept": "off",
|
|
163
|
-
"unicorn/no-invalid-remove-event-listener": "error",
|
|
164
|
-
"unicorn/no-late-current-target-access": "error",
|
|
165
|
-
"unicorn/no-magic-array-flat-depth": "error",
|
|
166
|
-
"unicorn/no-manually-wrapped-comments": "off",
|
|
167
|
-
"unicorn/no-named-default": "off", // named default is useful for vue
|
|
134
|
+
"unicorn/no-invalid-argument-count": "off", // does not respect optional parameters (e.g. jsdoc [param])
|
|
135
|
+
"unicorn/no-invalid-fetch-options": "off", // let TypeScript and tests handle this
|
|
136
|
+
"unicorn/no-named-default": "off", // named default is useful for Vue.js
|
|
168
137
|
"unicorn/no-negated-condition": "off", // mostly agree with the rule but sometimes its useful to have the common case first even if negated
|
|
169
138
|
"unicorn/no-negation-in-equality-check": "off",
|
|
170
|
-
"unicorn/no-new-array": "error",
|
|
171
|
-
"unicorn/no-new-buffer": "error",
|
|
172
139
|
"unicorn/no-null": "off", // prefer using null over undefined
|
|
173
|
-
"unicorn/no-object-as-default-parameter": "error",
|
|
174
140
|
"unicorn/no-process-exit": "off", // covered by n/no-process-exit (enabled by recommended-module preset)
|
|
175
141
|
"unicorn/no-single-promise-in-promise-methods": "warn",
|
|
176
142
|
"unicorn/no-static-only-class": "off",
|
|
177
143
|
"unicorn/no-thenable": "off",
|
|
178
|
-
"unicorn/no-this-assignment": "error",
|
|
179
144
|
"unicorn/no-this-outside-of-class": "off", // disagree somewhat with the rule, flags stateful objects
|
|
180
|
-
"unicorn/no-typeof-undefined": "error",
|
|
181
|
-
"unicorn/no-unnecessary-array-flat-depth": "error",
|
|
182
|
-
"unicorn/no-unnecessary-array-splice-count": "error",
|
|
183
|
-
"unicorn/no-unnecessary-await": "error",
|
|
184
|
-
"unicorn/no-unnecessary-nested-ternary": "error",
|
|
185
145
|
"unicorn/no-unnecessary-polyfills": "off",
|
|
186
|
-
"unicorn/no-unnecessary-slice-end": "error",
|
|
187
146
|
"unicorn/no-unreadable-array-destructuring": "off",
|
|
188
147
|
"unicorn/no-unreadable-iife": "off",
|
|
189
|
-
"unicorn/no-unused-array-method-return": "error",
|
|
190
|
-
"unicorn/no-useless-collection-argument": "error",
|
|
191
|
-
"unicorn/no-useless-error-capture-stack-trace": "error",
|
|
192
|
-
"unicorn/no-useless-fallback-in-spread": "error",
|
|
193
|
-
"unicorn/no-useless-iterator-to-array": "error",
|
|
194
|
-
"unicorn/no-useless-length-check": "error",
|
|
195
|
-
"unicorn/no-useless-promise-resolve-reject": "error",
|
|
196
|
-
"unicorn/no-useless-spread": "error",
|
|
197
148
|
"unicorn/no-useless-switch-case": "off",
|
|
198
149
|
"unicorn/no-useless-undefined": "off", // opinionated, I prefer to explicitly pass undefined
|
|
199
|
-
"unicorn/no-zero-fractions": "error",
|
|
200
150
|
"unicorn/number-literal-case": ["error", { hexadecimalValue: "lowercase" }],
|
|
201
151
|
"unicorn/numeric-separators-style": "off",
|
|
202
|
-
"unicorn/prefer-add-event-listener": "error",
|
|
203
|
-
"unicorn/prefer-array-find": "error",
|
|
204
|
-
"unicorn/prefer-array-flat": "error",
|
|
205
|
-
"unicorn/prefer-array-flat-map": "error",
|
|
206
|
-
"unicorn/prefer-array-index-of": "error",
|
|
207
|
-
"unicorn/prefer-array-last-methods": "error",
|
|
208
|
-
"unicorn/prefer-array-some": "error",
|
|
209
|
-
"unicorn/prefer-at": "error",
|
|
210
152
|
"unicorn/prefer-bigint-literals": "off",
|
|
211
|
-
"unicorn/prefer-blob-reading-methods": "error",
|
|
212
|
-
"unicorn/prefer-class-fields": "error",
|
|
213
153
|
"unicorn/prefer-classlist-toggle": "off",
|
|
214
|
-
"unicorn/prefer-code-point": "error",
|
|
215
|
-
"unicorn/prefer-date-now": "error",
|
|
216
|
-
"unicorn/prefer-default-parameters": "error",
|
|
217
154
|
"unicorn/prefer-dom-node-append": "off",
|
|
218
155
|
"unicorn/prefer-dom-node-remove": "off",
|
|
219
156
|
"unicorn/prefer-dom-node-text-content": "off",
|
|
220
157
|
"unicorn/prefer-event-target": "off",
|
|
221
|
-
"unicorn/prefer-export-from": "error",
|
|
222
|
-
"unicorn/prefer-get-or-insert-computed": "error",
|
|
223
158
|
"unicorn/prefer-global-this": "off",
|
|
224
|
-
"unicorn/prefer-https": "error",
|
|
225
159
|
"unicorn/prefer-import-meta-properties": "error",
|
|
226
|
-
"unicorn/prefer-includes": "error",
|
|
227
|
-
"unicorn/prefer-includes-over-repeated-comparisons": "error",
|
|
228
|
-
"unicorn/prefer-iterator-concat": "off",
|
|
229
|
-
"unicorn/prefer-iterator-to-array-at-end": "error",
|
|
230
|
-
"unicorn/prefer-keyboard-event-key": "error",
|
|
231
160
|
"unicorn/prefer-logical-operator-over-ternary": "off",
|
|
232
|
-
"unicorn/prefer-math-abs": "error",
|
|
233
|
-
"unicorn/prefer-math-min-max": "error",
|
|
234
|
-
"unicorn/prefer-math-trunc": "error",
|
|
235
161
|
"unicorn/prefer-modern-dom-apis": "off",
|
|
236
|
-
"unicorn/prefer-modern-math-apis": "error",
|
|
237
162
|
"unicorn/prefer-module": "off",
|
|
238
163
|
"unicorn/prefer-native-coercion-functions": "off",
|
|
239
|
-
"unicorn/prefer-negative-index": "error",
|
|
240
|
-
"unicorn/prefer-number-properties": "error",
|
|
241
|
-
"unicorn/prefer-object-from-entries": "error",
|
|
242
164
|
"unicorn/prefer-optional-catch-binding": "off", // covered by sonarjs/no-ignored-exceptions
|
|
243
|
-
"unicorn/prefer-prototype-methods": "error",
|
|
244
|
-
"unicorn/prefer-query-selector": "error",
|
|
245
165
|
"unicorn/prefer-queue-microtask": [
|
|
246
166
|
"error",
|
|
247
167
|
{ checkSetImmediate: true, checkSetTimeout: true },
|
|
248
168
|
],
|
|
249
|
-
"unicorn/prefer-reflect-apply": "error",
|
|
250
|
-
"unicorn/prefer-regexp-test": "error",
|
|
251
169
|
"unicorn/prefer-response-static-json": "off",
|
|
252
|
-
"unicorn/prefer-
|
|
253
|
-
"unicorn/prefer-
|
|
254
|
-
"unicorn/prefer-simple-condition-first": "error",
|
|
170
|
+
"unicorn/prefer-scoped-selector": "off",
|
|
171
|
+
"unicorn/prefer-short-arrow-method": "off",
|
|
255
172
|
"unicorn/prefer-single-call": "off",
|
|
256
|
-
"unicorn/prefer-split-limit": "error",
|
|
257
173
|
"unicorn/prefer-spread": "off", // for now
|
|
258
|
-
"unicorn/prefer-string-match-all": "error",
|
|
259
|
-
"unicorn/prefer-string-pad-start-end": "error",
|
|
260
174
|
"unicorn/prefer-string-raw": "off", // for now
|
|
261
|
-
"unicorn/prefer-string-repeat": "error",
|
|
262
|
-
"unicorn/prefer-string-replace-all": "error",
|
|
263
|
-
"unicorn/prefer-string-slice": "error",
|
|
264
|
-
"unicorn/prefer-string-starts-ends-with": "error",
|
|
265
|
-
"unicorn/prefer-string-trim-start-end": "error",
|
|
266
|
-
"unicorn/prefer-structured-clone": "error",
|
|
267
|
-
"unicorn/prefer-switch": "error",
|
|
268
175
|
"unicorn/prefer-ternary": "off",
|
|
269
|
-
"unicorn/prefer-top-level-await": "error",
|
|
270
|
-
"unicorn/prefer-type-error": "error",
|
|
271
176
|
"unicorn/prevent-abbreviations": "off",
|
|
272
177
|
"unicorn/relative-url-style": "warn",
|
|
273
|
-
"unicorn/require-array-join-separator": "error",
|
|
274
178
|
"unicorn/require-css-escape": "off", // would be useful but we dont have CSS.escape()
|
|
275
179
|
"unicorn/require-module-attributes": "off",
|
|
276
180
|
"unicorn/require-module-specifiers": "off",
|
|
277
|
-
"unicorn/require-number-to-fixed-digits-argument": "error",
|
|
278
|
-
"unicorn/require-passive-events": "error",
|
|
279
181
|
"unicorn/switch-case-braces": "off",
|
|
280
|
-
"unicorn/switch-case-break-position": "error",
|
|
281
182
|
"unicorn/text-encoding-identifier-case": "off",
|
|
282
|
-
"unicorn/throw-new-error": "error",
|
|
283
|
-
"unicorn/try-complexity": "off",
|
|
284
183
|
...filterRules(eslintConfigPrettier.rules, (rule) => {
|
|
285
184
|
return rule.startsWith("unicorn/");
|
|
286
185
|
}),
|
|
@@ -355,7 +254,7 @@ export default [
|
|
|
355
254
|
"import-x/no-duplicates": "error",
|
|
356
255
|
|
|
357
256
|
/* this is checked by compiler and without additional configuration does not
|
|
358
|
-
* work with
|
|
257
|
+
* work with TypeScript */
|
|
359
258
|
"n/no-missing-import": "off",
|
|
360
259
|
"n/no-missing-require": "off",
|
|
361
260
|
|
|
@@ -369,12 +268,12 @@ export default [
|
|
|
369
268
|
"security/detect-object-injection": "off", // produces more noise than useful errors
|
|
370
269
|
"security/detect-unsafe-regex": "error",
|
|
371
270
|
|
|
372
|
-
"sonarjs/argument-type": "off", // handled by
|
|
271
|
+
"sonarjs/argument-type": "off", // handled by TypeScript (and this rule is sometimes wrong)
|
|
373
272
|
"sonarjs/arguments-order": "off", // another slow rule, would be nice to have enabled thought
|
|
374
273
|
"sonarjs/cognitive-complexity": "off", // already covered by native complexity rule
|
|
375
274
|
"sonarjs/concise-regex": "off", // already covered by unicorn/better-regex
|
|
376
275
|
"sonarjs/deprecation": "off", // already covered by @typescript-eslint/no-deprecated
|
|
377
|
-
"sonarjs/function-return-type": "off", // overly broad and opinionated, let
|
|
276
|
+
"sonarjs/function-return-type": "off", // overly broad and opinionated, let TypeScript deal with this
|
|
378
277
|
"sonarjs/no-commented-code": "off", // neat rule but is very very slow (over 50% of the total linting time)
|
|
379
278
|
"sonarjs/no-control-regex": "off", // already covered by no-control-regexp
|
|
380
279
|
"sonarjs/no-empty-test-file": "off", // could be useful but it does not handle it.each or similar constructs thus yields more false positives than its worth */
|
|
@@ -382,7 +281,7 @@ export default [
|
|
|
382
281
|
"sonarjs/no-skipped-tests": "off", // covered by jest/no-disabled-tests and mocha/no-pending-tests
|
|
383
282
|
"sonarjs/no-small-switch": "off", // prefer to use small switches when the intention is to all more cases later
|
|
384
283
|
"sonarjs/no-unused-vars": "off", // already coveredby @typescript-eslint/no-unused-vars
|
|
385
|
-
"sonarjs/prefer-nullish-coalescing": "off", // requires
|
|
284
|
+
"sonarjs/prefer-nullish-coalescing": "off", // requires TypeScript and strictNullChecks, which is sane, but we also use @typescript-eslint/prefer-nullish-coalescing so this becomes redundant
|
|
386
285
|
"sonarjs/prefer-regexp-exec": "off", // prefer @typescript-eslint/prefer-regexp-exec
|
|
387
286
|
"sonarjs/prefer-single-boolean-return": "off", // prefer to use multiple returns even for booleans (looks better and can yield performance increase
|
|
388
287
|
"sonarjs/redundant-type-aliases": "off", // "redundant" type aliases helps with self-documenting code
|
|
@@ -392,7 +291,7 @@ export default [
|
|
|
392
291
|
"sonarjs/use-type-alias": "off", // overly broad, lets leave this to the discretion of the author
|
|
393
292
|
"sonarjs/void-use": "off", // used to silence warnings about unawaited promises
|
|
394
293
|
|
|
395
|
-
/* disable sonarjs
|
|
294
|
+
/* disable sonarjs AWS related rules as we dont use AWS */
|
|
396
295
|
"sonarjs/aws-apigateway-public-api": "off",
|
|
397
296
|
"sonarjs/aws-ec2-rds-dms-public": "off",
|
|
398
297
|
"sonarjs/aws-ec2-unencrypted-ebs-volume": "off",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@html-validate/eslint-config",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.5.0",
|
|
4
4
|
"description": "Eslint sharable config used by the various HTML-validate packages",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint"
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"eslint-plugin-regexp": "3.1.0",
|
|
51
51
|
"eslint-plugin-security": "4.0.1",
|
|
52
52
|
"eslint-plugin-sonarjs": "4.0.3",
|
|
53
|
-
"eslint-plugin-unicorn": "
|
|
53
|
+
"eslint-plugin-unicorn": "66.0.0",
|
|
54
54
|
"find-up": "8.0.0",
|
|
55
55
|
"globals": "17.3.0",
|
|
56
56
|
"nunjucks": "3.2.4"
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"publishConfig": {
|
|
66
66
|
"access": "public"
|
|
67
67
|
},
|
|
68
|
-
"gitHead": "
|
|
68
|
+
"gitHead": "bcdd8a68ca8a4c57fa4b2b27dad0e86e7f9e7c50"
|
|
69
69
|
}
|