@html-validate/eslint-config 6.9.0 → 6.10.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 +4 -4
- package/dist/cli.mjs.map +3 -3
- package/eslint.mjs +1 -1
- package/index.mjs +50 -7
- package/package.json +2 -2
- package/template/eslint.config.mjs.njk +13 -13
package/eslint.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import path from "node:path";
|
|
4
3
|
import { spawn } from "node:child_process";
|
|
5
4
|
import { createRequire } from "node:module";
|
|
5
|
+
import path from "node:path";
|
|
6
6
|
|
|
7
7
|
const require = createRequire(import.meta.url);
|
|
8
8
|
const pkgPath = path.dirname(require.resolve("eslint/package.json"));
|
package/index.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { fileURLToPath } from "node:url";
|
|
2
2
|
import js from "@eslint/js";
|
|
3
|
-
import globals from "globals";
|
|
4
3
|
import eslintConfigPrettier from "eslint-config-prettier";
|
|
4
|
+
import eslintPluginArrayFunc from "eslint-plugin-array-func";
|
|
5
5
|
import eslintPluginEslintComments from "eslint-plugin-eslint-comments";
|
|
6
|
-
import eslintPluginPrettier from "eslint-plugin-prettier";
|
|
7
6
|
import eslintPluginImport from "eslint-plugin-import";
|
|
8
7
|
import eslintPluginN from "eslint-plugin-n";
|
|
9
|
-
import
|
|
8
|
+
import eslintPluginPrettier from "eslint-plugin-prettier";
|
|
10
9
|
import eslintPluginSecurity from "eslint-plugin-security";
|
|
11
10
|
import eslintPluginSonarjs from "eslint-plugin-sonarjs";
|
|
11
|
+
import globals from "globals";
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* @typedef {import("eslint").Linter.Config} Config
|
|
@@ -145,7 +145,19 @@ export default [
|
|
|
145
145
|
"import/no-mutable-exports": "error",
|
|
146
146
|
"import/no-named-default": "error",
|
|
147
147
|
"import/no-useless-path-segments": "error",
|
|
148
|
-
"import/order":
|
|
148
|
+
"import/order": [
|
|
149
|
+
"warn",
|
|
150
|
+
{
|
|
151
|
+
alphabetize: {
|
|
152
|
+
order: "asc",
|
|
153
|
+
orderImportKind: "asc",
|
|
154
|
+
},
|
|
155
|
+
named: {
|
|
156
|
+
enabled: true,
|
|
157
|
+
types: "types-first",
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
],
|
|
149
161
|
"import/no-named-as-default": "error",
|
|
150
162
|
"import/no-named-as-default-member": "error",
|
|
151
163
|
"import/no-duplicates": "error",
|
|
@@ -155,6 +167,9 @@ export default [
|
|
|
155
167
|
"n/no-missing-import": "off",
|
|
156
168
|
"n/no-missing-require": "off",
|
|
157
169
|
|
|
170
|
+
/* prefer "node:foo" over "foo" */
|
|
171
|
+
"n/prefer-node-protocol": "error",
|
|
172
|
+
|
|
158
173
|
"security/detect-child-process": "off", // produces more noise than useful errors
|
|
159
174
|
"security/detect-non-literal-fs-filename": "off", // html-validate reads files, don't want to acknowledge all occurrences
|
|
160
175
|
"security/detect-non-literal-regexp": "error",
|
|
@@ -162,19 +177,47 @@ export default [
|
|
|
162
177
|
"security/detect-object-injection": "off", // produces more noise than useful errors
|
|
163
178
|
"security/detect-unsafe-regex": "error",
|
|
164
179
|
|
|
180
|
+
"sonarjs/argument-type": "off", // handled by typescript (and this rule is sometimes wrong)
|
|
181
|
+
"sonarjs/arguments-order": "off", // another slow rule, would be nice to have enabled thought
|
|
165
182
|
"sonarjs/cognitive-complexity": "off", // already covered by native complexity rule
|
|
166
183
|
"sonarjs/deprecation": "off", // already covered by @typescript-eslint/no-deprecated
|
|
167
184
|
"sonarjs/function-return-type": "off", // overly broad and opinionated, let typescript deal with this
|
|
185
|
+
"sonarjs/no-commented-code": "off", // neat rule but is very very slow (over 50% of the total linting time)
|
|
186
|
+
"sonarjs/no-control-regex": "off", // already covered by no-control-regexp
|
|
168
187
|
"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 */
|
|
188
|
+
"sonarjs/no-skipped-tests": "off", // covered by jest/no-disabled-tests and mocha/no-pending-tests
|
|
169
189
|
"sonarjs/no-small-switch": "off", // prefer to use small switches when the intention is to all more cases later
|
|
170
190
|
"sonarjs/no-unused-vars": "off", // already coveredby @typescript-eslint/no-unused-vars
|
|
171
|
-
"sonarjs/unused-import": "off", // already covered by @typescript-eslint/no-unused-vars
|
|
172
191
|
"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
|
|
173
|
-
"sonarjs/prefer-single-boolean-return": "off", // prefer to use multiple returns even for booleans (looks better and can yield performance increase
|
|
174
|
-
"sonarjs/no-control-regex": "off", // already covered by no-control-regexp
|
|
175
192
|
"sonarjs/prefer-regexp-exec": "off", // prefer @typescript-eslint/prefer-regexp-exec
|
|
193
|
+
"sonarjs/prefer-single-boolean-return": "off", // prefer to use multiple returns even for booleans (looks better and can yield performance increase
|
|
194
|
+
"sonarjs/redundant-type-aliases": "off", // "redundant" type aliases helps with self-documenting code
|
|
176
195
|
"sonarjs/todo-tag": "off", // want to be able to leave todo tasks
|
|
196
|
+
"sonarjs/unused-import": "off", // already covered by @typescript-eslint/no-unused-vars
|
|
197
|
+
"sonarjs/unused-named-groups": "off", // named groups can help readability even if not used
|
|
198
|
+
"sonarjs/use-type-alias": "off", // overly broad, lets leave this to the discretion of the author
|
|
177
199
|
"sonarjs/void-use": "off", // used to silence warnings about unawaited promises
|
|
200
|
+
|
|
201
|
+
/* disable sonarjs aws related rules as we dont use aws */
|
|
202
|
+
"sonarjs/aws-apigateway-public-api": "off",
|
|
203
|
+
"sonarjs/aws-ec2-rds-dms-public": "off",
|
|
204
|
+
"sonarjs/aws-ec2-unencrypted-ebs-volume": "off",
|
|
205
|
+
"sonarjs/aws-efs-unencrypted": "off",
|
|
206
|
+
"sonarjs/aws-iam-all-privileges": "off",
|
|
207
|
+
"sonarjs/aws-iam-all-resources-accessible": "off",
|
|
208
|
+
"sonarjs/aws-iam-privilege-escalation": "off",
|
|
209
|
+
"sonarjs/aws-iam-public-access": "off",
|
|
210
|
+
"sonarjs/aws-opensearchservice-domain": "off",
|
|
211
|
+
"sonarjs/aws-rds-unencrypted-databases": "off",
|
|
212
|
+
"sonarjs/aws-restricted-ip-admin-access": "off",
|
|
213
|
+
"sonarjs/aws-s3-bucket-granted-access": "off",
|
|
214
|
+
"sonarjs/aws-s3-bucket-insecure-http": "off",
|
|
215
|
+
"sonarjs/aws-s3-bucket-public-access": "off",
|
|
216
|
+
"sonarjs/aws-s3-bucket-server-encryption": "off",
|
|
217
|
+
"sonarjs/aws-s3-bucket-versioning": "off",
|
|
218
|
+
"sonarjs/aws-sagemaker-unencrypted-notebook": "off",
|
|
219
|
+
"sonarjs/aws-sns-unencrypted-topics": "off",
|
|
220
|
+
"sonarjs/aws-sqs-unencrypted-queue": "off",
|
|
178
221
|
},
|
|
179
222
|
}),
|
|
180
223
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@html-validate/eslint-config",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.10.0",
|
|
4
4
|
"description": "Eslint sharable config used by the various HTML-validate packages",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint"
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"publishConfig": {
|
|
65
65
|
"access": "public"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "3387d5569fb64ddcf5ca5e8c8dd20645bba42381"
|
|
68
68
|
}
|
|
@@ -6,29 +6,29 @@ import path from "node:path";
|
|
|
6
6
|
import { fileURLToPath } from "node:url";
|
|
7
7
|
{% endif %}
|
|
8
8
|
import defaultConfig from "@html-validate/eslint-config";
|
|
9
|
-
{% if typescript %}
|
|
10
|
-
import typescriptConfig from "@html-validate/eslint-config-typescript";
|
|
11
|
-
{% endif %}
|
|
12
|
-
{% if typeinfo %}
|
|
13
|
-
import typescriptTypeinfoConfig from "@html-validate/eslint-config-typescript-typeinfo";
|
|
14
|
-
{% endif %}
|
|
15
9
|
{% if angularjs %}
|
|
16
10
|
import angularjsConfig from "@html-validate/eslint-config-angularjs";
|
|
17
11
|
{% endif %}
|
|
18
|
-
{% if
|
|
19
|
-
import
|
|
12
|
+
{% if cypress %}
|
|
13
|
+
import cypressConfig from "@html-validate/eslint-config-cypress";
|
|
20
14
|
{% endif %}
|
|
21
15
|
{% if jest %}
|
|
22
16
|
import jestConfig from "@html-validate/eslint-config-jest";
|
|
23
17
|
{% endif %}
|
|
18
|
+
{% if protractor %}
|
|
19
|
+
import protractorConfig from "@html-validate/eslint-config-protractor";
|
|
20
|
+
{% endif %}
|
|
21
|
+
{% if typescript %}
|
|
22
|
+
import typescriptConfig from "@html-validate/eslint-config-typescript";
|
|
23
|
+
{% endif %}
|
|
24
|
+
{% if typeinfo %}
|
|
25
|
+
import typescriptTypeinfoConfig from "@html-validate/eslint-config-typescript-typeinfo";
|
|
26
|
+
{% endif %}
|
|
24
27
|
{% if vitest %}
|
|
25
28
|
import vitestConfig from "@html-validate/eslint-config-vitest";
|
|
26
29
|
{% endif %}
|
|
27
|
-
{% if
|
|
28
|
-
import
|
|
29
|
-
{% endif %}
|
|
30
|
-
{% if protractor %}
|
|
31
|
-
import protractorConfig from "@html-validate/eslint-config-protractor";
|
|
30
|
+
{% if vue %}
|
|
31
|
+
import vueConfig from "@html-validate/eslint-config-vue";
|
|
32
32
|
{% endif %}
|
|
33
33
|
|
|
34
34
|
{% if typeinfo %}
|