@html-validate/eslint-config 6.9.0 → 6.10.2
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 -12
- 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
|
|
@@ -37,11 +37,6 @@ export default [
|
|
|
37
37
|
languageOptions: {
|
|
38
38
|
ecmaVersion: 2023,
|
|
39
39
|
sourceType: "module",
|
|
40
|
-
parserOptions: {
|
|
41
|
-
ecmaFeatures: {
|
|
42
|
-
globalReturn: true,
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
40
|
globals: {
|
|
46
41
|
...globals.es2023,
|
|
47
42
|
...globals.node,
|
|
@@ -145,7 +140,19 @@ export default [
|
|
|
145
140
|
"import/no-mutable-exports": "error",
|
|
146
141
|
"import/no-named-default": "error",
|
|
147
142
|
"import/no-useless-path-segments": "error",
|
|
148
|
-
"import/order":
|
|
143
|
+
"import/order": [
|
|
144
|
+
"warn",
|
|
145
|
+
{
|
|
146
|
+
alphabetize: {
|
|
147
|
+
order: "asc",
|
|
148
|
+
orderImportKind: "asc",
|
|
149
|
+
},
|
|
150
|
+
named: {
|
|
151
|
+
enabled: true,
|
|
152
|
+
types: "types-first",
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
],
|
|
149
156
|
"import/no-named-as-default": "error",
|
|
150
157
|
"import/no-named-as-default-member": "error",
|
|
151
158
|
"import/no-duplicates": "error",
|
|
@@ -155,6 +162,9 @@ export default [
|
|
|
155
162
|
"n/no-missing-import": "off",
|
|
156
163
|
"n/no-missing-require": "off",
|
|
157
164
|
|
|
165
|
+
/* prefer "node:foo" over "foo" */
|
|
166
|
+
"n/prefer-node-protocol": "error",
|
|
167
|
+
|
|
158
168
|
"security/detect-child-process": "off", // produces more noise than useful errors
|
|
159
169
|
"security/detect-non-literal-fs-filename": "off", // html-validate reads files, don't want to acknowledge all occurrences
|
|
160
170
|
"security/detect-non-literal-regexp": "error",
|
|
@@ -162,19 +172,47 @@ export default [
|
|
|
162
172
|
"security/detect-object-injection": "off", // produces more noise than useful errors
|
|
163
173
|
"security/detect-unsafe-regex": "error",
|
|
164
174
|
|
|
175
|
+
"sonarjs/argument-type": "off", // handled by typescript (and this rule is sometimes wrong)
|
|
176
|
+
"sonarjs/arguments-order": "off", // another slow rule, would be nice to have enabled thought
|
|
165
177
|
"sonarjs/cognitive-complexity": "off", // already covered by native complexity rule
|
|
166
178
|
"sonarjs/deprecation": "off", // already covered by @typescript-eslint/no-deprecated
|
|
167
179
|
"sonarjs/function-return-type": "off", // overly broad and opinionated, let typescript deal with this
|
|
180
|
+
"sonarjs/no-commented-code": "off", // neat rule but is very very slow (over 50% of the total linting time)
|
|
181
|
+
"sonarjs/no-control-regex": "off", // already covered by no-control-regexp
|
|
168
182
|
"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 */
|
|
183
|
+
"sonarjs/no-skipped-tests": "off", // covered by jest/no-disabled-tests and mocha/no-pending-tests
|
|
169
184
|
"sonarjs/no-small-switch": "off", // prefer to use small switches when the intention is to all more cases later
|
|
170
185
|
"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
186
|
"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
187
|
"sonarjs/prefer-regexp-exec": "off", // prefer @typescript-eslint/prefer-regexp-exec
|
|
188
|
+
"sonarjs/prefer-single-boolean-return": "off", // prefer to use multiple returns even for booleans (looks better and can yield performance increase
|
|
189
|
+
"sonarjs/redundant-type-aliases": "off", // "redundant" type aliases helps with self-documenting code
|
|
176
190
|
"sonarjs/todo-tag": "off", // want to be able to leave todo tasks
|
|
191
|
+
"sonarjs/unused-import": "off", // already covered by @typescript-eslint/no-unused-vars
|
|
192
|
+
"sonarjs/unused-named-groups": "off", // named groups can help readability even if not used
|
|
193
|
+
"sonarjs/use-type-alias": "off", // overly broad, lets leave this to the discretion of the author
|
|
177
194
|
"sonarjs/void-use": "off", // used to silence warnings about unawaited promises
|
|
195
|
+
|
|
196
|
+
/* disable sonarjs aws related rules as we dont use aws */
|
|
197
|
+
"sonarjs/aws-apigateway-public-api": "off",
|
|
198
|
+
"sonarjs/aws-ec2-rds-dms-public": "off",
|
|
199
|
+
"sonarjs/aws-ec2-unencrypted-ebs-volume": "off",
|
|
200
|
+
"sonarjs/aws-efs-unencrypted": "off",
|
|
201
|
+
"sonarjs/aws-iam-all-privileges": "off",
|
|
202
|
+
"sonarjs/aws-iam-all-resources-accessible": "off",
|
|
203
|
+
"sonarjs/aws-iam-privilege-escalation": "off",
|
|
204
|
+
"sonarjs/aws-iam-public-access": "off",
|
|
205
|
+
"sonarjs/aws-opensearchservice-domain": "off",
|
|
206
|
+
"sonarjs/aws-rds-unencrypted-databases": "off",
|
|
207
|
+
"sonarjs/aws-restricted-ip-admin-access": "off",
|
|
208
|
+
"sonarjs/aws-s3-bucket-granted-access": "off",
|
|
209
|
+
"sonarjs/aws-s3-bucket-insecure-http": "off",
|
|
210
|
+
"sonarjs/aws-s3-bucket-public-access": "off",
|
|
211
|
+
"sonarjs/aws-s3-bucket-server-encryption": "off",
|
|
212
|
+
"sonarjs/aws-s3-bucket-versioning": "off",
|
|
213
|
+
"sonarjs/aws-sagemaker-unencrypted-notebook": "off",
|
|
214
|
+
"sonarjs/aws-sns-unencrypted-topics": "off",
|
|
215
|
+
"sonarjs/aws-sqs-unencrypted-queue": "off",
|
|
178
216
|
},
|
|
179
217
|
}),
|
|
180
218
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@html-validate/eslint-config",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.10.2",
|
|
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": "5f217ae81c545e51f9a6eb8eeae9c0eb93c36688"
|
|
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 %}
|