@pumpn/eslint-config 17.2.3 → 18.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/_common/_exports.js +5 -0
- package/_common/all-extensions/_exports.js +1 -0
- package/_common/all-extensions/js-extensions.js +10 -0
- package/_common/all-extensions.js +6 -0
- package/_common/convert-extensions-to-glob.js +12 -0
- package/_common/js-jsx-extensions.js +3 -0
- package/_common/ts-extensions.js +10 -0
- package/_common/ts-jsx-extensions.js +3 -0
- package/config/_common/_exports.js +5 -0
- package/config/_common/add-prefix-to-rules.js +13 -0
- package/config/_common/core-json-rules.js +24 -0
- package/config/_common/json-plugins.js +9 -0
- package/config/_common/pick-unicorn-rules-for-language/_exports.js +2 -0
- package/config/_common/pick-unicorn-rules-for-language/pick-rules-for-language.js +52 -0
- package/config/_common/pick-unicorn-rules-for-language/unicorn/_exports.js +9 -0
- package/config/_common/pick-unicorn-rules-for-language/unicorn/binary-group-length.js +3 -0
- package/config/_common/pick-unicorn-rules-for-language/unicorn/hexadecimal-group-length.js +3 -0
- package/config/_common/pick-unicorn-rules-for-language/unicorn/maximum-nested-calls.js +3 -0
- package/config/_common/pick-unicorn-rules-for-language/unicorn/number-group-length.js +3 -0
- package/config/_common/pick-unicorn-rules-for-language/unicorn/octal-group-length.js +3 -0
- package/config/_common/pick-unicorn-rules-for-language/unicorn/patterns.js +28 -0
- package/config/_common/pick-unicorn-rules-for-language/unicorn/unicorn-consistency-rules/_exports.js +1 -0
- package/config/_common/pick-unicorn-rules-for-language/unicorn/unicorn-consistency-rules/consistent-function-style.js +3 -0
- package/config/_common/pick-unicorn-rules-for-language/unicorn/unicorn-consistency-rules.js +66 -0
- package/config/_common/pick-unicorn-rules-for-language/unicorn/unicorn-preference-rules.js +199 -0
- package/config/_common/pick-unicorn-rules-for-language/unicorn/unicorn-redundancy-rules.js +47 -0
- package/config/_common/pick-unicorn-rules-for-language/unicorn.js +368 -0
- package/config/_common/pick-unicorn-rules-for-language.js +14 -0
- package/config/_exports.js +11 -0
- package/config/converted-globals.js +16 -0
- package/config/css-config/_exports.js +2 -0
- package/config/css-config/css-plugins.js +9 -0
- package/config/css-config/css-rules/_exports.js +1 -0
- package/config/css-config/css-rules/core-css-rules.js +25 -0
- package/config/css-config/css-rules.js +10 -0
- package/config/css-config.js +17 -0
- package/config/default-glob.js +6 -0
- package/config/html-config/_exports.js +2 -0
- package/config/html-config/html-plugins.js +9 -0
- package/config/html-config/html-rules/_exports.js +1 -0
- package/config/html-config/html-rules/core-html-rules/_exports.js +4 -0
- package/config/html-config/html-rules/core-html-rules/core-html-accessibility-rules.js +28 -0
- package/config/html-config/html-rules/core-html-rules/core-html-best-practice-rules.js +42 -0
- package/config/html-config/html-rules/core-html-rules/core-html-seo-rules.js +16 -0
- package/config/html-config/html-rules/core-html-rules/core-html-style-rules.js +23 -0
- package/config/html-config/html-rules/core-html-rules.js +27 -0
- package/config/html-config/html-rules.js +10 -0
- package/config/html-config.js +12 -0
- package/config/json-config/_exports.js +1 -0
- package/config/json-config/json-rules.js +9 -0
- package/config/json-config.js +13 -0
- package/config/jsonc-config/_exports.js +1 -0
- package/config/jsonc-config/jsonc-rules.js +9 -0
- package/config/jsonc-config.js +26 -0
- package/config/jsx-glob/_exports.js +1 -0
- package/config/jsx-glob/jsx-extensions.js +6 -0
- package/config/jsx-glob.js +7 -0
- package/config/md-config/_exports.js +2 -0
- package/config/md-config/md-plugins.js +9 -0
- package/config/md-config/md-rules/_exports.js +1 -0
- package/config/md-config/md-rules/core-md-rules.js +30 -0
- package/config/md-config/md-rules.js +10 -0
- package/config/md-config.js +15 -0
- package/{plugins.js → config/plugins.js} +7 -6
- package/{rules → config/rules}/_common/_exports.js +0 -1
- package/{rules → config/rules}/_exports.js +1 -4
- package/config/rules/better-tailwindcss/correctness.js +13 -0
- package/config/rules/better-tailwindcss/stylistic.js +42 -0
- package/config/rules/better-tailwindcss.js +15 -0
- package/config/rules/command.js +17 -0
- package/config/rules/depend.js +17 -0
- package/config/rules/eslint-comments/best-practices.js +14 -0
- package/config/rules/eslint-comments/stylistic-issues.js +17 -0
- package/config/rules/eslint-comments.js +15 -0
- package/config/rules/import-x/helpful-warnings.js +26 -0
- package/config/rules/import-x/module-systems.js +14 -0
- package/config/rules/import-x/static-analysis.js +40 -0
- package/config/rules/import-x/style-guide/_exports.js +1 -0
- package/config/rules/import-x/style-guide/max-dependencies.js +3 -0
- package/config/rules/import-x/style-guide.js +94 -0
- package/config/rules/import-x.js +22 -0
- package/config/rules/jsdoc.js +464 -0
- package/config/rules/no-secrets/_exports.js +1 -0
- package/config/rules/no-secrets/tolerance.js +3 -0
- package/config/rules/no-secrets.js +30 -0
- package/config/rules/perfectionist.js +331 -0
- package/config/rules/promise.js +53 -0
- package/config/rules/react/core.js +69 -0
- package/config/rules/react/debug.js +14 -0
- package/config/rules/react/dom.js +25 -0
- package/config/rules/react/jsx.js +23 -0
- package/config/rules/react/naming-convention.js +12 -0
- package/config/rules/react/rsc.js +10 -0
- package/config/rules/react/web-api.js +15 -0
- package/config/rules/react.js +28 -0
- package/config/rules/regexp/best-practices.js +47 -0
- package/config/rules/regexp/possible-errors.js +31 -0
- package/config/rules/regexp/stylistic-issues.js +79 -0
- package/config/rules/regexp.js +20 -0
- package/config/rules/security.js +31 -0
- package/config/rules/sonarjs/problem.js +134 -0
- package/config/rules/sonarjs/suggestion.js +167 -0
- package/config/rules/sonarjs.js +15 -0
- package/config/rules/stylistic/_common/_exports.js +1 -0
- package/{rules → config/rules}/stylistic/_exports.js +1 -1
- package/config/rules/stylistic/brackets/_exports.js +2 -0
- package/config/rules/stylistic/brackets/min-elements-for-curly-newline.js +3 -0
- package/config/rules/stylistic/brackets/wrap-multilines-default.js +3 -0
- package/config/rules/stylistic/brackets.js +90 -0
- package/config/rules/stylistic/commas.js +18 -0
- package/config/rules/stylistic/comments.js +13 -0
- package/config/rules/stylistic/disallow.js +36 -0
- package/config/rules/stylistic/indent.js +19 -0
- package/config/rules/stylistic/jsx.js +42 -0
- package/config/rules/stylistic/linebreaks/_exports.js +1 -0
- package/config/rules/stylistic/linebreaks/max-ignored-chain-depth.js +3 -0
- package/config/rules/stylistic/linebreaks.js +67 -0
- package/config/rules/stylistic/misc.js +49 -0
- package/config/rules/stylistic/operators.js +31 -0
- package/config/rules/stylistic/quotes.js +12 -0
- package/config/rules/stylistic/semis.js +19 -0
- package/config/rules/stylistic/spacing.js +68 -0
- package/config/rules/stylistic/types.js +12 -0
- package/config/rules/stylistic.js +40 -0
- package/config/rules/suggestions/_exports.js +9 -0
- package/config/rules/suggestions/max-classes-per-file.js +3 -0
- package/config/rules/suggestions/max-depth.js +3 -0
- package/config/rules/suggestions/max-identifier-length.js +3 -0
- package/config/rules/suggestions/max-lines-per-file.js +3 -0
- package/config/rules/suggestions/max-lines-per-function.js +3 -0
- package/config/rules/suggestions/max-nested-callbacks.js +3 -0
- package/config/rules/suggestions/max-parameters.js +3 -0
- package/config/rules/suggestions/max-statements.js +3 -0
- package/config/rules/suggestions/min-identifier-length.js +3 -0
- package/{rules → config/rules}/suggestions.js +17 -15
- package/config/rules.js +50 -0
- package/config/ts-glob.js +6 -0
- package/config.js +51 -53
- package/package.json +51 -38
- package/.ls-lint.yml +0 -6
- package/.vscode/settings.json +0 -18
- package/deno.json +0 -78
- package/deno.lock +0 -1632
- package/eslint.config.js +0 -25
- package/rules/better-tailwindcss/correctness.js +0 -7
- package/rules/better-tailwindcss/stylistic.js +0 -38
- package/rules/better-tailwindcss.js +0 -19
- package/rules/command.js +0 -12
- package/rules/depend.js +0 -12
- package/rules/eslint-comments/best-practices.js +0 -9
- package/rules/eslint-comments/stylistic-issues.js +0 -12
- package/rules/eslint-comments.js +0 -19
- package/rules/import-x/helpful-warnings.js +0 -21
- package/rules/import-x/module-systems.js +0 -9
- package/rules/import-x/static-analysis.js +0 -35
- package/rules/import-x/style-guide.js +0 -89
- package/rules/import-x.js +0 -19
- package/rules/jsdoc.js +0 -433
- package/rules/no-secrets.js +0 -25
- package/rules/perfectionist.js +0 -318
- package/rules/promise.js +0 -48
- package/rules/react/core.js +0 -59
- package/rules/react/debug.js +0 -6
- package/rules/react/dom.js +0 -15
- package/rules/react/jsx.js +0 -18
- package/rules/react/naming-convention.js +0 -6
- package/rules/react/rsc.js +0 -5
- package/rules/react/web-api.js +0 -10
- package/rules/react.js +0 -19
- package/rules/regexp/best-practices.js +0 -42
- package/rules/regexp/possible-errors.js +0 -26
- package/rules/regexp/stylistic-issues.js +0 -74
- package/rules/regexp.js +0 -19
- package/rules/security.js +0 -25
- package/rules/sonarjs/problem.js +0 -123
- package/rules/sonarjs/suggestion.js +0 -135
- package/rules/sonarjs.js +0 -19
- package/rules/stylistic/_common/_exports.js +0 -3
- package/rules/stylistic/brackets.js +0 -87
- package/rules/stylistic/commas.js +0 -13
- package/rules/stylistic/comments.js +0 -8
- package/rules/stylistic/disallow.js +0 -31
- package/rules/stylistic/indent.js +0 -14
- package/rules/stylistic/jsx.js +0 -37
- package/rules/stylistic/linebreaks.js +0 -63
- package/rules/stylistic/misc.js +0 -45
- package/rules/stylistic/operators.js +0 -26
- package/rules/stylistic/quotes.js +0 -7
- package/rules/stylistic/semis.js +0 -14
- package/rules/stylistic/spacing.js +0 -63
- package/rules/stylistic/types.js +0 -7
- package/rules/stylistic.js +0 -19
- package/rules/unicorn.js +0 -306
- package/rules.js +0 -19
- package/scripts/update-import-map.js +0 -47
- package/scripts/update-package-json.js +0 -66
- package/scripts/update-tsconfig.js +0 -46
- package/tsconfig.json +0 -27
- /package/{rules → config}/_common/tab-width.js +0 -0
- /package/{rules → config/rules}/_common/maximum-line-length.js +0 -0
- /package/{rules → config/rules}/better-tailwindcss/_exports.js +0 -0
- /package/{rules → config/rules}/eslint-comments/_exports.js +0 -0
- /package/{rules → config/rules}/import-x/_exports.js +0 -0
- /package/{rules → config/rules}/layout-and-formatting.js +0 -0
- /package/{rules → config/rules}/possible-problems.js +0 -0
- /package/{rules → config/rules}/react/_exports.js +0 -0
- /package/{rules → config/rules}/regexp/_exports.js +0 -0
- /package/{rules → config/rules}/sonarjs/_exports.js +0 -0
- /package/{rules → config/rules}/stylistic/_common/min-items-for-array-newline.js +0 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import addPrefixToRules from "../../_common/add-prefix-to-rules.js";
|
|
2
|
+
|
|
3
|
+
const stylisticIssuesRules = addPrefixToRules(
|
|
4
|
+
"regexp",
|
|
5
|
+
{
|
|
6
|
+
"grapheme-string-literal": "off",
|
|
7
|
+
"hexadecimal-escape": ["error", "always"],
|
|
8
|
+
"letter-case": [
|
|
9
|
+
"error",
|
|
10
|
+
{
|
|
11
|
+
caseInsensitive: "lowercase",
|
|
12
|
+
controlEscape: "uppercase",
|
|
13
|
+
hexadecimalEscape: "uppercase",
|
|
14
|
+
unicodeEscape: "uppercase"
|
|
15
|
+
}
|
|
16
|
+
],
|
|
17
|
+
"match-any": "error",
|
|
18
|
+
"no-useless-escape": "error",
|
|
19
|
+
"no-useless-non-capturing-group": "error",
|
|
20
|
+
"prefer-character-class": "error",
|
|
21
|
+
"prefer-d": "error",
|
|
22
|
+
"prefer-lookaround": [
|
|
23
|
+
"error",
|
|
24
|
+
{
|
|
25
|
+
lookbehind: true,
|
|
26
|
+
strictTypes: true
|
|
27
|
+
}
|
|
28
|
+
],
|
|
29
|
+
"prefer-named-backreference": "error",
|
|
30
|
+
"prefer-named-capture-group": "error",
|
|
31
|
+
"prefer-named-replacement": [
|
|
32
|
+
"error",
|
|
33
|
+
{
|
|
34
|
+
strictTypes: true
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
"prefer-plus-quantifier": "error",
|
|
38
|
+
"prefer-question-quantifier": "error",
|
|
39
|
+
"prefer-result-array-groups": [
|
|
40
|
+
"error",
|
|
41
|
+
{
|
|
42
|
+
strictTypes: true
|
|
43
|
+
}
|
|
44
|
+
],
|
|
45
|
+
"prefer-star-quantifier": "error",
|
|
46
|
+
"prefer-unicode-codepoint-escapes": "error",
|
|
47
|
+
"prefer-w": "error",
|
|
48
|
+
"sort-character-class-elements": [
|
|
49
|
+
"error",
|
|
50
|
+
{
|
|
51
|
+
order: [
|
|
52
|
+
String.raw`\s`,
|
|
53
|
+
String.raw`\w`,
|
|
54
|
+
String.raw`\d`,
|
|
55
|
+
String.raw`\p`,
|
|
56
|
+
"*",
|
|
57
|
+
String.raw`\q`,
|
|
58
|
+
"[]"
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
],
|
|
62
|
+
"sort-flags": "error",
|
|
63
|
+
"unicode-escape": ["error", "unicodeCodePointEscape"],
|
|
64
|
+
"unicode-property": [
|
|
65
|
+
"error",
|
|
66
|
+
{
|
|
67
|
+
generalCategory: "never",
|
|
68
|
+
key: "ignore",
|
|
69
|
+
property: {
|
|
70
|
+
binary: "ignore",
|
|
71
|
+
generalCategory: "ignore",
|
|
72
|
+
script: "long"
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
|
|
79
|
+
export default stylisticIssuesRules;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {
|
|
2
|
+
bestPracticesRules,
|
|
3
|
+
possibleErrorsRules,
|
|
4
|
+
stylisticIssuesRules
|
|
5
|
+
} from "./regexp/_exports.js";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @import { Linter } from "eslint";
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @satisfies {Linter.RulesRecord}
|
|
13
|
+
*/
|
|
14
|
+
const regexpRules = {
|
|
15
|
+
...bestPracticesRules,
|
|
16
|
+
...possibleErrorsRules,
|
|
17
|
+
...stylisticIssuesRules
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export default regexpRules;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import addPrefixToRules from "../_common/add-prefix-to-rules.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @import { Linter } from "eslint";
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @satisfies {Linter.RulesRecord}
|
|
9
|
+
*/
|
|
10
|
+
const securityRules = addPrefixToRules(
|
|
11
|
+
"security",
|
|
12
|
+
{
|
|
13
|
+
"detect-bidi-characters": "warn",
|
|
14
|
+
"detect-buffer-noassert": "warn",
|
|
15
|
+
"detect-child-process": "warn",
|
|
16
|
+
"detect-disable-mustache-escape": "warn",
|
|
17
|
+
"detect-eval-with-expression": "warn",
|
|
18
|
+
"detect-invisible-characters": "warn",
|
|
19
|
+
"detect-new-buffer": "warn",
|
|
20
|
+
"detect-no-csrf-before-method-override": "warn",
|
|
21
|
+
"detect-non-literal-fs-filename": "warn",
|
|
22
|
+
"detect-non-literal-regexp": "warn",
|
|
23
|
+
"detect-non-literal-require": "warn",
|
|
24
|
+
"detect-object-injection": "off",
|
|
25
|
+
"detect-possible-timing-attacks": "warn",
|
|
26
|
+
"detect-pseudoRandomBytes": "warn",
|
|
27
|
+
"detect-unsafe-regex": "warn"
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
export default securityRules;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import addPrefixToRules from "../../_common/add-prefix-to-rules.js";
|
|
2
|
+
|
|
3
|
+
const problemRules = addPrefixToRules(
|
|
4
|
+
"sonarjs",
|
|
5
|
+
{
|
|
6
|
+
"anchor-precedence": "error",
|
|
7
|
+
"array-callback-without-return": "error",
|
|
8
|
+
"async-test-assertions": "error",
|
|
9
|
+
"aws-apigateway-public-api": "error",
|
|
10
|
+
"aws-ec2-rds-dms-public": "error",
|
|
11
|
+
"aws-ec2-unencrypted-ebs-volume": "error",
|
|
12
|
+
"aws-efs-unencrypted": "error",
|
|
13
|
+
"aws-iam-all-privileges": "error",
|
|
14
|
+
"aws-iam-all-resources-accessible": "error",
|
|
15
|
+
"aws-iam-privilege-escalation": "error",
|
|
16
|
+
"aws-iam-public-access": "error",
|
|
17
|
+
"aws-opensearchservice-domain": "error",
|
|
18
|
+
"aws-rds-unencrypted-databases": "error",
|
|
19
|
+
"aws-restricted-ip-admin-access": "error",
|
|
20
|
+
"aws-s3-bucket-granted-access": "error",
|
|
21
|
+
"aws-s3-bucket-insecure-http": "error",
|
|
22
|
+
"aws-s3-bucket-public-access": "error",
|
|
23
|
+
"aws-s3-bucket-versioning": "error",
|
|
24
|
+
"aws-sagemaker-unencrypted-notebook": "error",
|
|
25
|
+
"aws-sns-unencrypted-topics": "error",
|
|
26
|
+
"aws-sqs-unencrypted-queue": "error",
|
|
27
|
+
"bitwise-operators": "off",
|
|
28
|
+
"code-eval": "error",
|
|
29
|
+
"comma-or-logical-or-case": "error",
|
|
30
|
+
"constructor-for-side-effects": "error",
|
|
31
|
+
"content-length": "error",
|
|
32
|
+
"content-security-policy": "error",
|
|
33
|
+
"cookie-no-httponly": "error",
|
|
34
|
+
cors: "error",
|
|
35
|
+
csrf: "error",
|
|
36
|
+
"different-types-comparison": "error",
|
|
37
|
+
"disabled-auto-escaping": "error",
|
|
38
|
+
"disabled-resource-integrity": "error",
|
|
39
|
+
"disabled-timeout": "error",
|
|
40
|
+
"dompurify-unsafe-config": "error",
|
|
41
|
+
"dynamically-constructed-templates": "error",
|
|
42
|
+
"empty-string-repetition": "error",
|
|
43
|
+
"encryption-secure-mode": "error",
|
|
44
|
+
"existing-groups": "error",
|
|
45
|
+
"file-permissions": "error",
|
|
46
|
+
"file-uploads": "error",
|
|
47
|
+
"for-in": "error",
|
|
48
|
+
"for-loop-increment-sign": "error",
|
|
49
|
+
"generator-without-yield": "error",
|
|
50
|
+
"hardcoded-secret-signatures": "error",
|
|
51
|
+
hashing: "error",
|
|
52
|
+
"in-operator-type-error": "error",
|
|
53
|
+
"insecure-cookie": "error",
|
|
54
|
+
"insecure-jwt-token": "error",
|
|
55
|
+
"jsx-no-leaked-render": "error",
|
|
56
|
+
"link-with-target-blank": "error",
|
|
57
|
+
"new-operator-misuse": "error",
|
|
58
|
+
"no-all-duplicated-branches": "error",
|
|
59
|
+
"no-alphabetical-sort": "error",
|
|
60
|
+
"no-angular-bypass-sanitization": "error",
|
|
61
|
+
"no-built-in-override": "error",
|
|
62
|
+
"no-clear-text-protocols": "error",
|
|
63
|
+
"no-collection-size-mischeck": "error",
|
|
64
|
+
"no-control-regex": "error",
|
|
65
|
+
"no-debounce-throttle-in-render": "error",
|
|
66
|
+
"no-debug-commands-in-ui-tests": "error",
|
|
67
|
+
"no-delete-var": "error",
|
|
68
|
+
"no-element-overwrite": "error",
|
|
69
|
+
"no-empty-alternatives": "error",
|
|
70
|
+
"no-empty-character-class": "error",
|
|
71
|
+
"no-empty-collection": "error",
|
|
72
|
+
"no-empty-parameterized-test-dataset": "error",
|
|
73
|
+
"no-exclusive-tests": "error",
|
|
74
|
+
"no-extra-arguments": "error",
|
|
75
|
+
"no-floating-point-equality": "error",
|
|
76
|
+
"no-function-declaration-in-block": "error",
|
|
77
|
+
"no-globals-shadowing": "error",
|
|
78
|
+
"no-hardcoded-passwords": "error",
|
|
79
|
+
"no-hardcoded-secrets": "error",
|
|
80
|
+
"no-hook-setter-in-body": "error",
|
|
81
|
+
"no-identical-conditions": "error",
|
|
82
|
+
"no-identical-expressions": "error",
|
|
83
|
+
"no-ignored-return": "error",
|
|
84
|
+
"no-incompatible-assertion-types": "error",
|
|
85
|
+
"no-invalid-regexp": "error",
|
|
86
|
+
"no-literal-call": "error",
|
|
87
|
+
"no-mime-sniff": "error",
|
|
88
|
+
"no-misleading-character-class": "error",
|
|
89
|
+
"no-mixed-completion-style": "error",
|
|
90
|
+
"no-mutate-reactive-state-in-updated-hook": "error",
|
|
91
|
+
"no-os-command-from-path": "error",
|
|
92
|
+
"no-parameter-reassignment": "error",
|
|
93
|
+
"no-reference-error": "error",
|
|
94
|
+
"no-referrer-policy": "error",
|
|
95
|
+
"no-same-argument-assert": "error",
|
|
96
|
+
"no-session-cookies-on-static-assets": "error",
|
|
97
|
+
"no-try-promise": "error",
|
|
98
|
+
"no-unthrown-error": "error",
|
|
99
|
+
"no-use-of-empty-return-value": "error",
|
|
100
|
+
"no-useless-increment": "error",
|
|
101
|
+
"no-useless-intersection": "error",
|
|
102
|
+
"no-useless-react-setstate": "error",
|
|
103
|
+
"no-weak-cipher": "error",
|
|
104
|
+
"no-weak-keys": "error",
|
|
105
|
+
"non-existent-operator": "error",
|
|
106
|
+
"null-dereference": "error",
|
|
107
|
+
"post-message": "error",
|
|
108
|
+
"production-debug": "error",
|
|
109
|
+
"pseudo-random": "error",
|
|
110
|
+
"publicly-writable-directories": "error",
|
|
111
|
+
"reduce-initial-value": "error",
|
|
112
|
+
"review-blockchain-mnemonic": "error",
|
|
113
|
+
"session-regeneration": "error",
|
|
114
|
+
"slow-regex": "error",
|
|
115
|
+
"sql-queries": "error",
|
|
116
|
+
"stateful-regex": "error",
|
|
117
|
+
"strict-transport-security": "error",
|
|
118
|
+
"synchronous-exception-assertions": "error",
|
|
119
|
+
"synchronous-suite-callback": "error",
|
|
120
|
+
"table-header": "error",
|
|
121
|
+
"table-header-reference": "error",
|
|
122
|
+
"testing-library-prefer-query-by-disappearance": "error",
|
|
123
|
+
"unicode-aware-regex": "error",
|
|
124
|
+
"unverified-certificate": "error",
|
|
125
|
+
"unverified-hostname": "error",
|
|
126
|
+
"updated-const-var": "error",
|
|
127
|
+
"weak-ssl": "error",
|
|
128
|
+
"x-powered-by": "error",
|
|
129
|
+
"xml-parser-xxe": "error"
|
|
130
|
+
|
|
131
|
+
}
|
|
132
|
+
);
|
|
133
|
+
|
|
134
|
+
export default problemRules;
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import addPrefixToRules from "../../_common/add-prefix-to-rules.js";
|
|
2
|
+
|
|
3
|
+
const suggestionRules = addPrefixToRules(
|
|
4
|
+
"sonarjs",
|
|
5
|
+
{
|
|
6
|
+
"max-lines": "error",
|
|
7
|
+
"max-lines-per-function": "error",
|
|
8
|
+
"max-switch-cases": "error",
|
|
9
|
+
"max-union-size": "error",
|
|
10
|
+
"argument-type": "error",
|
|
11
|
+
"arguments-order": "error",
|
|
12
|
+
"arguments-usage": "error",
|
|
13
|
+
"array-constructor": "error",
|
|
14
|
+
"arrow-function-convention": "off",
|
|
15
|
+
"assertions-in-test-cases": "error",
|
|
16
|
+
"assertions-in-tests": "error",
|
|
17
|
+
"avoid-mutating-nested-properties-of-shallow-clones": "error",
|
|
18
|
+
"block-scoped-var": "error",
|
|
19
|
+
"bool-param-default": "error",
|
|
20
|
+
"call-argument-line": "error",
|
|
21
|
+
"chai-determinate-assertion": "error",
|
|
22
|
+
"class-name": "error",
|
|
23
|
+
"class-prototype": "error",
|
|
24
|
+
"cognitive-complexity": "error",
|
|
25
|
+
"comment-regex": "error",
|
|
26
|
+
"composite-assertions": "error",
|
|
27
|
+
"concise-regex": "error",
|
|
28
|
+
"cyclomatic-complexity": "error",
|
|
29
|
+
"declarations-in-global-scope": "error",
|
|
30
|
+
deprecation: "error",
|
|
31
|
+
"destructuring-assignment-syntax": "error",
|
|
32
|
+
"duplicates-in-character-class": "error",
|
|
33
|
+
"elseif-without-else": "error",
|
|
34
|
+
"explicit-test-skip": "error",
|
|
35
|
+
"expression-complexity": "error",
|
|
36
|
+
"file-header": "off",
|
|
37
|
+
"file-name-differ-from-class": "off",
|
|
38
|
+
"fixme-tag": "error",
|
|
39
|
+
"function-inside-loop": "error",
|
|
40
|
+
"function-name": "off",
|
|
41
|
+
"function-return-type": "error",
|
|
42
|
+
"future-reserved-words": "error",
|
|
43
|
+
"hooks-before-test-cases": "error",
|
|
44
|
+
"inconsistent-function-call": "error",
|
|
45
|
+
"index-of-compare-to-positive-number": "error",
|
|
46
|
+
"inverted-assertion-arguments": "error",
|
|
47
|
+
"label-position": "error",
|
|
48
|
+
"memoize-cache-key": "error",
|
|
49
|
+
"misplaced-loop-counter": "error",
|
|
50
|
+
"nested-control-flow": "error",
|
|
51
|
+
"no-array-delete": "error",
|
|
52
|
+
"no-associative-arrays": "error",
|
|
53
|
+
"no-async-constructor": "error",
|
|
54
|
+
"no-case-label-in-switch": "error",
|
|
55
|
+
"no-code-after-done": "error",
|
|
56
|
+
"no-collapsible-if": "error",
|
|
57
|
+
"no-commented-code": "error",
|
|
58
|
+
"no-dead-store": "off",
|
|
59
|
+
"no-default-utility-imports": "error",
|
|
60
|
+
"no-duplicate-in-composite": "error",
|
|
61
|
+
"no-duplicate-parameterized-test-case": "error",
|
|
62
|
+
"no-duplicate-string": "error",
|
|
63
|
+
"no-duplicate-test-title": "error",
|
|
64
|
+
"no-duplicated-branches": "error",
|
|
65
|
+
"no-empty-after-reluctant": "error",
|
|
66
|
+
"no-empty-group": "error",
|
|
67
|
+
"no-empty-test-file": "error",
|
|
68
|
+
"no-empty-test-title": "error",
|
|
69
|
+
"no-equals-in-for-termination": "error",
|
|
70
|
+
"no-fallthrough": "error",
|
|
71
|
+
"no-fixed-wait-in-tests": "error",
|
|
72
|
+
"no-for-in-iterable": "error",
|
|
73
|
+
"no-forced-browser-interaction": "error",
|
|
74
|
+
"no-global-this": "error",
|
|
75
|
+
"no-gratuitous-expressions": "error",
|
|
76
|
+
"no-hardcoded-ip": "error",
|
|
77
|
+
"no-identical-functions": "error",
|
|
78
|
+
"no-ignored-exceptions": "error",
|
|
79
|
+
"no-implicit-dependencies": "off",
|
|
80
|
+
"no-implicit-global": "error",
|
|
81
|
+
"no-in-misuse": "error",
|
|
82
|
+
"no-incomplete-assertions": "error",
|
|
83
|
+
"no-inconsistent-returns": "error",
|
|
84
|
+
"no-incorrect-string-concat": "error",
|
|
85
|
+
"no-internal-api-use": "error",
|
|
86
|
+
"no-interpolation-in-inline-snapshots": "error",
|
|
87
|
+
"no-invariant-returns": "error",
|
|
88
|
+
"no-inverted-boolean-check": "error",
|
|
89
|
+
"no-labels": "error",
|
|
90
|
+
"no-misleading-array-reverse": "error",
|
|
91
|
+
"no-nested-assignment": "error",
|
|
92
|
+
"no-nested-conditional": "error",
|
|
93
|
+
"no-nested-functions": "error",
|
|
94
|
+
"no-nested-incdec": "error",
|
|
95
|
+
"no-nested-switch": "error",
|
|
96
|
+
"no-nested-template-literals": "error",
|
|
97
|
+
"no-networkidle-wait": "error",
|
|
98
|
+
"no-primitive-wrappers": "error",
|
|
99
|
+
"no-redundant-assignments": "error",
|
|
100
|
+
"no-redundant-boolean": "error",
|
|
101
|
+
"no-redundant-jump": "error",
|
|
102
|
+
"no-redundant-optional": "error",
|
|
103
|
+
"no-regex-spaces": "error",
|
|
104
|
+
"no-require-or-define": "error",
|
|
105
|
+
"no-return-type-any": "error",
|
|
106
|
+
"no-same-line-conditional": "error",
|
|
107
|
+
"no-selector-parameter": "error",
|
|
108
|
+
"no-skipped-tests": "error",
|
|
109
|
+
"no-small-switch": "error",
|
|
110
|
+
"no-sonar-comments": "error",
|
|
111
|
+
"no-table-as-layout": "error",
|
|
112
|
+
"no-trivial-assertions": "error",
|
|
113
|
+
"no-undefined-argument": "error",
|
|
114
|
+
"no-undefined-assignment": "off",
|
|
115
|
+
"no-unenclosed-multiline-block": "error",
|
|
116
|
+
"no-uniq-key": "error",
|
|
117
|
+
"no-unused-collection": "error",
|
|
118
|
+
"no-unused-function-argument": "off",
|
|
119
|
+
"no-unused-vars": "off",
|
|
120
|
+
"no-useless-catch": "error",
|
|
121
|
+
"no-variable-usage-before-declaration": "error",
|
|
122
|
+
"no-vue-class-component": "error",
|
|
123
|
+
"no-vue-mixins": "error",
|
|
124
|
+
"no-wildcard-import": "off",
|
|
125
|
+
"non-number-in-arithmetic-expression": "error",
|
|
126
|
+
"object-alt-content": "error",
|
|
127
|
+
"operation-returning-nan": "error",
|
|
128
|
+
"parameterized-tests": "error",
|
|
129
|
+
"prefer-cypress-should": "error",
|
|
130
|
+
"prefer-default-last": "error",
|
|
131
|
+
"prefer-immediate-return": "error",
|
|
132
|
+
"prefer-native-axios-alternative": "error",
|
|
133
|
+
"prefer-native-jquery-alternative": "error",
|
|
134
|
+
"prefer-native-lodash-alternative": "error",
|
|
135
|
+
"prefer-object-literal": "error",
|
|
136
|
+
"prefer-promise-shorthand": "error",
|
|
137
|
+
"prefer-read-only-props": "error",
|
|
138
|
+
"prefer-regexp-exec": "error",
|
|
139
|
+
"prefer-single-boolean-return": "error",
|
|
140
|
+
"prefer-specific-assertions": "error",
|
|
141
|
+
"prefer-type-guard": "error",
|
|
142
|
+
"prefer-while": "error",
|
|
143
|
+
"public-static-readonly": "error",
|
|
144
|
+
"redundant-type-aliases": "error",
|
|
145
|
+
"regex-complexity": "error",
|
|
146
|
+
"shorthand-property-grouping": "off",
|
|
147
|
+
"single-char-in-character-classes": "error",
|
|
148
|
+
"single-character-alternation": "error",
|
|
149
|
+
"stable-tests": "error",
|
|
150
|
+
"strings-comparison": "error",
|
|
151
|
+
"super-linear-regex": "error",
|
|
152
|
+
"test-check-exception": "error",
|
|
153
|
+
"testing-library-query-assertion": "error",
|
|
154
|
+
"todo-tag": "off",
|
|
155
|
+
"too-many-break-or-continue-in-loop": "error",
|
|
156
|
+
"unused-import": "error",
|
|
157
|
+
"unused-named-groups": "error",
|
|
158
|
+
"updated-loop-counter": "error",
|
|
159
|
+
"use-type-alias": "error",
|
|
160
|
+
"values-not-convertible-to-numbers": "error",
|
|
161
|
+
"variable-name": "error",
|
|
162
|
+
"vitest-mock-at-module-scope": "error",
|
|
163
|
+
"void-use": "error"
|
|
164
|
+
}
|
|
165
|
+
);
|
|
166
|
+
|
|
167
|
+
export default suggestionRules;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { problemRules, suggestionRules } from "./sonarjs/_exports.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @import { Linter } from "eslint";
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @satisfies {Linter.RulesRecord}
|
|
9
|
+
*/
|
|
10
|
+
const sonarjsRules = {
|
|
11
|
+
...problemRules,
|
|
12
|
+
...suggestionRules
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default sonarjsRules;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as minItemsForArrayNewline } from "./min-items-for-array-newline.js";
|
|
@@ -4,7 +4,7 @@ export { default as commentsRules } from "./comments.js";
|
|
|
4
4
|
export { default as disallowRules } from "./disallow.js";
|
|
5
5
|
export { default as indentRules } from "./indent.js";
|
|
6
6
|
export { default as jsxRules } from "./jsx.js";
|
|
7
|
-
export { default as
|
|
7
|
+
export { default as lineBreaksRules } from "./linebreaks.js";
|
|
8
8
|
export { default as miscRules } from "./misc.js";
|
|
9
9
|
export { default as operatorsRules } from "./operators.js";
|
|
10
10
|
export { default as quotesRules } from "./quotes.js";
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import addPrefixToRules from "../../_common/add-prefix-to-rules.js";
|
|
2
|
+
|
|
3
|
+
import { minItemsForArrayNewline } from "./_common/_exports.js";
|
|
4
|
+
import { minElementsForCurlyNewline, wrapMultilinesDefault } from "./brackets/_exports.js";
|
|
5
|
+
|
|
6
|
+
const bracketsRules = addPrefixToRules(
|
|
7
|
+
"@stylistic",
|
|
8
|
+
{
|
|
9
|
+
"array-bracket-newline": [
|
|
10
|
+
"error",
|
|
11
|
+
{
|
|
12
|
+
minItems: minItemsForArrayNewline,
|
|
13
|
+
multiline: true
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
"array-bracket-spacing": ["error", "never"],
|
|
17
|
+
"arrow-parens": ["error", "always"],
|
|
18
|
+
"brace-style": ["error", "stroustrup"],
|
|
19
|
+
"curly-newline": [
|
|
20
|
+
"error",
|
|
21
|
+
{
|
|
22
|
+
minElements: minElementsForCurlyNewline,
|
|
23
|
+
consistent: true,
|
|
24
|
+
multiline: true
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"function-paren-newline": ["error", "multiline-arguments"],
|
|
28
|
+
"jsx-closing-bracket-location": "error",
|
|
29
|
+
"jsx-curly-brace-presence": [
|
|
30
|
+
"error",
|
|
31
|
+
{
|
|
32
|
+
children: "never",
|
|
33
|
+
propElementValues: "always",
|
|
34
|
+
props: "never"
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
"jsx-curly-newline": [
|
|
38
|
+
"error",
|
|
39
|
+
{
|
|
40
|
+
multiline: "consistent",
|
|
41
|
+
singleline: "forbid"
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
"jsx-curly-spacing": [
|
|
45
|
+
"error",
|
|
46
|
+
{
|
|
47
|
+
attributes: true,
|
|
48
|
+
children: true,
|
|
49
|
+
when: "never"
|
|
50
|
+
}
|
|
51
|
+
],
|
|
52
|
+
"jsx-wrap-multilines": [
|
|
53
|
+
"error",
|
|
54
|
+
{
|
|
55
|
+
arrow: wrapMultilinesDefault,
|
|
56
|
+
assignment: wrapMultilinesDefault,
|
|
57
|
+
condition: wrapMultilinesDefault,
|
|
58
|
+
declaration: wrapMultilinesDefault,
|
|
59
|
+
logical: wrapMultilinesDefault,
|
|
60
|
+
prop: wrapMultilinesDefault,
|
|
61
|
+
propertyValue: wrapMultilinesDefault,
|
|
62
|
+
return: wrapMultilinesDefault
|
|
63
|
+
}
|
|
64
|
+
],
|
|
65
|
+
"new-parens": ["error", "always"],
|
|
66
|
+
"object-curly-newline": [
|
|
67
|
+
"error",
|
|
68
|
+
{
|
|
69
|
+
minProperties: minElementsForCurlyNewline,
|
|
70
|
+
consistent: true,
|
|
71
|
+
multiline: true
|
|
72
|
+
}
|
|
73
|
+
],
|
|
74
|
+
"object-curly-spacing": ["error", "always"],
|
|
75
|
+
"space-before-function-paren": [
|
|
76
|
+
"error",
|
|
77
|
+
{
|
|
78
|
+
anonymous: "always",
|
|
79
|
+
asyncArrow: "always",
|
|
80
|
+
named: "never"
|
|
81
|
+
}
|
|
82
|
+
],
|
|
83
|
+
"space-in-parens": ["error", "never"],
|
|
84
|
+
"template-curly-spacing": ["error", "never"],
|
|
85
|
+
"wrap-iife": ["error", "inside"],
|
|
86
|
+
"wrap-regex": "off"
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
|
|
90
|
+
export default bracketsRules;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import addPrefixToRules from "../../_common/add-prefix-to-rules.js";
|
|
2
|
+
|
|
3
|
+
const commasRules = addPrefixToRules(
|
|
4
|
+
"@stylistic",
|
|
5
|
+
{
|
|
6
|
+
"comma-dangle": ["error", "never"],
|
|
7
|
+
"comma-spacing": [
|
|
8
|
+
"error",
|
|
9
|
+
{
|
|
10
|
+
before: false,
|
|
11
|
+
after: true
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"comma-style": ["error", "last"]
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
|
|
18
|
+
export default commasRules;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import addPrefixToRules from "../../_common/add-prefix-to-rules.js";
|
|
2
|
+
|
|
3
|
+
const commentsRules = addPrefixToRules(
|
|
4
|
+
"@stylistic",
|
|
5
|
+
{
|
|
6
|
+
"line-comment-position": ["error", { position: "above" }],
|
|
7
|
+
"lines-around-comment": "off",
|
|
8
|
+
"multiline-comment-style": "off",
|
|
9
|
+
"spaced-comment": "off"
|
|
10
|
+
}
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
export default commentsRules;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import addPrefixToRules from "../../_common/add-prefix-to-rules.js";
|
|
2
|
+
|
|
3
|
+
const disallowRules = addPrefixToRules(
|
|
4
|
+
"@stylistic",
|
|
5
|
+
{
|
|
6
|
+
"no-confusing-arrow": "error",
|
|
7
|
+
"no-extra-parens": ["error", "functions"],
|
|
8
|
+
"no-floating-decimal": "error",
|
|
9
|
+
"no-mixed-spaces-and-tabs": "error",
|
|
10
|
+
"no-multi-spaces": [
|
|
11
|
+
"error",
|
|
12
|
+
{
|
|
13
|
+
exceptions: { Property: false }
|
|
14
|
+
}
|
|
15
|
+
],
|
|
16
|
+
"no-multiple-empty-lines": [
|
|
17
|
+
"error",
|
|
18
|
+
{
|
|
19
|
+
max: 1,
|
|
20
|
+
maxBOF: 0,
|
|
21
|
+
maxEOF: 1
|
|
22
|
+
}
|
|
23
|
+
],
|
|
24
|
+
"no-tabs": "off",
|
|
25
|
+
"no-trailing-spaces": [
|
|
26
|
+
"error",
|
|
27
|
+
{
|
|
28
|
+
ignoreComments: false,
|
|
29
|
+
skipBlankLines: false
|
|
30
|
+
}
|
|
31
|
+
],
|
|
32
|
+
"no-whitespace-before-property": "error"
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
export default disallowRules;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import addPrefixToRules from "../../_common/add-prefix-to-rules.js";
|
|
2
|
+
|
|
3
|
+
const indentRules = addPrefixToRules(
|
|
4
|
+
"@stylistic",
|
|
5
|
+
{
|
|
6
|
+
indent: [
|
|
7
|
+
"error",
|
|
8
|
+
"tab",
|
|
9
|
+
{
|
|
10
|
+
SwitchCase: 1,
|
|
11
|
+
tabLength: 4
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"indent-binary-ops": ["error", "tab"],
|
|
15
|
+
"jsx-indent-props": ["error", "tab"]
|
|
16
|
+
}
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
export default indentRules;
|