@pumpn/eslint-config 15.6.1 → 16.1.1
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/.vscode/settings.json +14 -1
- package/config.js +27 -91
- package/deno.json +22 -22
- package/deno.lock +698 -2293
- package/eslint.config.js +13 -5
- package/package.json +20 -21
- package/plugins.js +15 -13
- package/rules/_exports.js +1 -1
- package/rules/command.js +12 -0
- package/rules/depend.js +1 -1
- package/rules/eslint-comments.js +1 -1
- package/rules/github.js +1 -1
- package/rules/import-x/helpful-warnings.js +2 -2
- package/rules/import-x/static-analysis.js +1 -1
- package/rules/import-x/style-guide.js +11 -8
- package/rules/import-x.js +1 -1
- package/rules/jsdoc.js +3 -27
- package/rules/jsx-a11y.js +1 -1
- package/rules/layout-and-formatting.js +1 -1
- package/rules/no-secrets.js +1 -1
- package/rules/no-unsanitized.js +1 -1
- package/rules/perfectionist.js +21 -24
- package/rules/possible-problems.js +1 -1
- package/rules/promise.js +20 -5
- package/rules/react.js +1 -1
- package/rules/redos.js +1 -1
- package/rules/regexp.js +1 -1
- package/rules/security.js +1 -1
- package/rules/sonarjs.js +1 -1
- package/rules/stylistic/_common/min-items-for-array-newline.js +1 -1
- package/rules/stylistic/indent.js +0 -1
- package/rules/stylistic/linebreaks.js +3 -15
- package/rules/stylistic.js +1 -1
- package/rules/suggestions.js +4 -16
- package/rules/tailwindcss.js +1 -1
- package/rules/unicorn.js +24 -6
- package/rules.js +1 -1
- package/scripts/update-package-json.js +42 -22
- package/.tool-versions +0 -1
- package/documentation/global.html +0 -566
- package/documentation/index.html +0 -135
- package/documentation/index.js.html +0 -35865
- package/documentation/scripts/app.min.js +0 -1
- package/documentation/scripts/linenumber.js +0 -26
- package/documentation/scripts/search.js +0 -39
- package/documentation/styles/app.min.css +0 -1
- package/documentation/styles/iframe.css +0 -13
- package/documentation/styles/prettify-jsdoc.css +0 -111
- package/documentation/styles/prettify-tomorrow.css +0 -132
- package/documentation/styles/reset.css +0 -44
- package/jsdoc.json +0 -51
- package/rules/func-params-args.js +0 -19
package/eslint.config.js
CHANGED
|
@@ -2,6 +2,18 @@ import config from "./config.js";
|
|
|
2
2
|
|
|
3
3
|
const eslintConfig = [
|
|
4
4
|
...config,
|
|
5
|
+
{
|
|
6
|
+
rules: {
|
|
7
|
+
"tailwindcss/classnames-order": "off",
|
|
8
|
+
"tailwindcss/enforces-negative-arbitrary-values": "off",
|
|
9
|
+
"tailwindcss/enforces-shorthand": "off",
|
|
10
|
+
"tailwindcss/migration-from-tailwind-2": "off",
|
|
11
|
+
"tailwindcss/no-arbitrary-value": "off",
|
|
12
|
+
"tailwindcss/no-contradicting-classname": "off",
|
|
13
|
+
"tailwindcss/no-custom-classname": "off",
|
|
14
|
+
"tailwindcss/no-unnecessary-arbitrary-value": "off"
|
|
15
|
+
}
|
|
16
|
+
},
|
|
5
17
|
{
|
|
6
18
|
files: ["rules/unicorn.js"],
|
|
7
19
|
rules: {
|
|
@@ -9,11 +21,7 @@ const eslintConfig = [
|
|
|
9
21
|
}
|
|
10
22
|
},
|
|
11
23
|
{
|
|
12
|
-
files: [
|
|
13
|
-
"plugins.js",
|
|
14
|
-
"rules/_exports.js",
|
|
15
|
-
"rules/func-params-args.js"
|
|
16
|
-
],
|
|
24
|
+
files: ["plugins.js", "rules/_exports.js", "rules/func-params-args.js"],
|
|
17
25
|
rules: {
|
|
18
26
|
"unicorn/prevent-abbreviations": [
|
|
19
27
|
"error",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pumpn/eslint-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "16.1.1",
|
|
4
4
|
"description": "standard eslint config for pumpn code projects",
|
|
5
5
|
"main": "config.js",
|
|
6
6
|
"author": "Nano Miratus <nanomiratus@gmail.com>",
|
|
@@ -17,31 +17,30 @@
|
|
|
17
17
|
"test": "echo 'no tests yet'"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
|
-
"eslint": "^9.
|
|
20
|
+
"eslint": "^9.33.0"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@eslint-community/eslint-plugin-eslint-comments": "^4.
|
|
24
|
-
"@eslint-react/eslint-plugin": "^1.
|
|
25
|
-
"@stylistic/eslint-plugin": "^
|
|
26
|
-
"@typescript-eslint/parser": "^8.
|
|
27
|
-
"eslint-
|
|
28
|
-
"eslint-plugin-
|
|
29
|
-
"eslint-plugin-
|
|
30
|
-
"eslint-plugin-import-x": "^4.
|
|
31
|
-
"eslint-plugin-jsdoc": "^
|
|
23
|
+
"@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
|
|
24
|
+
"@eslint-react/eslint-plugin": "^1.52.6",
|
|
25
|
+
"@stylistic/eslint-plugin": "^5.2.3",
|
|
26
|
+
"@typescript-eslint/parser": "^8.40.0",
|
|
27
|
+
"eslint-import-resolver-typescript": "^4.4.4",
|
|
28
|
+
"eslint-plugin-command": "^3.3.1",
|
|
29
|
+
"eslint-plugin-depend": "^1.2.0",
|
|
30
|
+
"eslint-plugin-import-x": "^4.16.1",
|
|
31
|
+
"eslint-plugin-jsdoc": "^54.1.0",
|
|
32
32
|
"eslint-plugin-no-secrets": "^2.2.1",
|
|
33
|
-
"eslint-plugin-perfectionist": "^4.
|
|
34
|
-
"eslint-plugin-promise": "^7.1
|
|
35
|
-
"eslint-plugin-
|
|
36
|
-
"eslint-plugin-
|
|
37
|
-
"eslint-plugin-regexp": "^2.6.0",
|
|
33
|
+
"eslint-plugin-perfectionist": "^4.15.0",
|
|
34
|
+
"eslint-plugin-promise": "^7.2.1",
|
|
35
|
+
"eslint-plugin-redos": "^4.5.0",
|
|
36
|
+
"eslint-plugin-regexp": "^2.10.0",
|
|
38
37
|
"eslint-plugin-security": "^3.0.1",
|
|
39
|
-
"eslint-plugin-sonarjs": "^3.0.
|
|
40
|
-
"eslint-plugin-tailwindcss": "^
|
|
41
|
-
"eslint-plugin-unicorn": "^
|
|
42
|
-
"globals": "^
|
|
38
|
+
"eslint-plugin-sonarjs": "^3.0.4",
|
|
39
|
+
"eslint-plugin-tailwindcss": "^4.0.0-beta.0",
|
|
40
|
+
"eslint-plugin-unicorn": "^60.0.0",
|
|
41
|
+
"globals": "^16.3.0"
|
|
43
42
|
},
|
|
44
43
|
"peerDependencies": {
|
|
45
|
-
"eslint": "^9.
|
|
44
|
+
"eslint": "^9.33.0"
|
|
46
45
|
}
|
|
47
46
|
}
|
package/plugins.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
/* eslint-disable
|
|
1
|
+
// TODO [2025-10-01]: Remove this directive once https://github.com/eslint-stylistic/eslint-stylistic/issues/573 is resolved
|
|
2
|
+
/* eslint-disable object-shorthand -- see above */
|
|
3
3
|
/* eslint-disable import-x/max-dependencies -- collection file */
|
|
4
4
|
|
|
5
5
|
// import github from "eslint-plugin-github";
|
|
@@ -8,16 +8,15 @@
|
|
|
8
8
|
import eslintComments from "@eslint-community/eslint-plugin-eslint-comments";
|
|
9
9
|
import react from "@eslint-react/eslint-plugin";
|
|
10
10
|
import stylistic from "@stylistic/eslint-plugin";
|
|
11
|
+
import command from "eslint-plugin-command";
|
|
11
12
|
import depend from "eslint-plugin-depend";
|
|
12
|
-
import disableAutofix from "eslint-plugin-disable-autofix";
|
|
13
|
-
import funcParamsArgs from "eslint-plugin-func-params-args";
|
|
14
13
|
import importX from "eslint-plugin-import-x";
|
|
15
14
|
import jsdoc from "eslint-plugin-jsdoc";
|
|
16
15
|
import noSecrets from "eslint-plugin-no-secrets";
|
|
17
16
|
import perfectionist from "eslint-plugin-perfectionist";
|
|
18
17
|
import promise from "eslint-plugin-promise";
|
|
19
18
|
import redos from "eslint-plugin-redos";
|
|
20
|
-
import regexp from "eslint-plugin-regexp";
|
|
19
|
+
import * as regexp from "eslint-plugin-regexp";
|
|
21
20
|
import security from "eslint-plugin-security";
|
|
22
21
|
import sonarjs from "eslint-plugin-sonarjs";
|
|
23
22
|
import tailwindcss from "eslint-plugin-tailwindcss";
|
|
@@ -39,23 +38,26 @@ const plugins = /** @type {const} */ ({
|
|
|
39
38
|
// "jsx-a11y": jsxA11y,
|
|
40
39
|
// "no-unsanitized": noUnsanitized,
|
|
41
40
|
"@eslint-community/eslint-comments": eslintComments,
|
|
42
|
-
"@stylistic":
|
|
41
|
+
"@stylistic": stylistic,
|
|
42
|
+
command,
|
|
43
43
|
depend,
|
|
44
|
-
|
|
45
|
-
"func-params-args": funcParamsArgs,
|
|
44
|
+
// TODO [2025-10-01]: Remove assertion once https://github.com/un-ts/eslint-plugin-import-x/issues/421 is resolved
|
|
46
45
|
"import-x": /** @type {ESLint.Plugin} */ (
|
|
47
|
-
/** @type {unknown} */ (
|
|
46
|
+
/** @type {unknown} */ (
|
|
47
|
+
importX
|
|
48
|
+
)
|
|
48
49
|
),
|
|
49
50
|
jsdoc,
|
|
50
51
|
"no-secrets": noSecrets,
|
|
51
|
-
perfectionist
|
|
52
|
-
/** @type {unknown} */ (perfectionist)
|
|
53
|
-
),
|
|
52
|
+
perfectionist,
|
|
54
53
|
promise,
|
|
55
54
|
redos,
|
|
56
55
|
regexp,
|
|
57
56
|
security,
|
|
58
|
-
|
|
57
|
+
// TODO [2025-10-01]: Remove assertion once an issue is opened at https://community.sonarsource.com/ and resolved (:/)
|
|
58
|
+
sonarjs: /** @type {ESLint.Plugin} */ (
|
|
59
|
+
sonarjs
|
|
60
|
+
),
|
|
59
61
|
tailwindcss,
|
|
60
62
|
unicorn,
|
|
61
63
|
...reactPlugins
|
package/rules/_exports.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export { default as dependRules } from "./depend.js";
|
|
2
2
|
export { default as eslintCommentsRules } from "./eslint-comments.js";
|
|
3
|
-
export { default as funcParamsArgsRules } from "./func-params-args.js";
|
|
4
3
|
// export { default as githubRules } from "./github.js";
|
|
5
4
|
export { default as importXRules } from "./import-x.js";
|
|
6
5
|
export { default as jsdocRules } from "./jsdoc.js";
|
|
@@ -14,6 +13,7 @@ export { default as perfectionistRules } from "./perfectionist.js";
|
|
|
14
13
|
export { default as possibleProblemsRules } from "./possible-problems.js";
|
|
15
14
|
export { default as reactRules } from "./react.js";
|
|
16
15
|
// export { default as redosRules } from "./redos.js";
|
|
16
|
+
export { default as commandRules } from "./command.js";
|
|
17
17
|
export { default as regexpRules } from "./regexp.js";
|
|
18
18
|
export { default as securityRules } from "./security.js";
|
|
19
19
|
export { default as sonarjsRules } from "./sonarjs.js";
|
package/rules/command.js
ADDED
package/rules/depend.js
CHANGED
package/rules/eslint-comments.js
CHANGED
package/rules/github.js
CHANGED
|
@@ -4,9 +4,9 @@ const helpfulWarningsRules = {
|
|
|
4
4
|
"import-x/no-empty-named-blocks": "error",
|
|
5
5
|
"import-x/no-extraneous-dependencies": "off",
|
|
6
6
|
"import-x/no-mutable-exports": "error",
|
|
7
|
-
"import-x/no-named-as-default": "
|
|
7
|
+
"import-x/no-named-as-default": "off",
|
|
8
8
|
"import-x/no-named-as-default-member": "error",
|
|
9
|
-
"import-x/no-rename-default": "
|
|
9
|
+
"import-x/no-rename-default": "off",
|
|
10
10
|
"import-x/no-unused-modules": [
|
|
11
11
|
"error",
|
|
12
12
|
{
|
|
@@ -57,7 +57,7 @@ const staticAnalysisRules = {
|
|
|
57
57
|
}
|
|
58
58
|
],
|
|
59
59
|
"import-x/no-self-import": "error",
|
|
60
|
-
// TODO [2025-
|
|
60
|
+
// TODO [2025-10-01]: Change to "error" when there is a resolver for deno (maybe https://github.com/redabacha/eslint-import-resolver-deno)
|
|
61
61
|
"import-x/no-unresolved": "off",
|
|
62
62
|
"import-x/no-useless-path-segments": [
|
|
63
63
|
"error",
|
|
@@ -4,7 +4,14 @@ const styleGuideRules = {
|
|
|
4
4
|
"import-x/consistent-type-specifier-style": "error",
|
|
5
5
|
"import-x/dynamic-import-chunkname": "off",
|
|
6
6
|
"import-x/exports-last": "error",
|
|
7
|
-
"import-x/extensions": [
|
|
7
|
+
"import-x/extensions": [
|
|
8
|
+
"error",
|
|
9
|
+
"ignorePackages",
|
|
10
|
+
{
|
|
11
|
+
checkTypeImports: true,
|
|
12
|
+
fix: true
|
|
13
|
+
}
|
|
14
|
+
],
|
|
8
15
|
"import-x/first": "error",
|
|
9
16
|
"import-x/group-exports": "error",
|
|
10
17
|
"import-x/max-dependencies": [
|
|
@@ -31,12 +38,7 @@ const styleGuideRules = {
|
|
|
31
38
|
"import-x/no-duplicates": "error",
|
|
32
39
|
"import-x/no-named-default": "error",
|
|
33
40
|
"import-x/no-named-export": "off",
|
|
34
|
-
"import-x/no-namespace":
|
|
35
|
-
"error",
|
|
36
|
-
{
|
|
37
|
-
ignore: ["{./**/,**/}_exports.?(*.)js", "@typescript-eslint/parser"]
|
|
38
|
-
}
|
|
39
|
-
],
|
|
41
|
+
"import-x/no-namespace": "off",
|
|
40
42
|
"import-x/no-unassigned-import": "error",
|
|
41
43
|
"import-x/order": [
|
|
42
44
|
"off",
|
|
@@ -80,7 +82,8 @@ const styleGuideRules = {
|
|
|
80
82
|
warnOnUnassignedImports: false
|
|
81
83
|
}
|
|
82
84
|
],
|
|
83
|
-
"import-x/prefer-default-export": ["error", { target: "single" }]
|
|
85
|
+
"import-x/prefer-default-export": ["error", { target: "single" }],
|
|
86
|
+
"import-x/prefer-namespace-import": ["error", { patterns: ["react"] }]
|
|
84
87
|
};
|
|
85
88
|
|
|
86
89
|
export default styleGuideRules;
|
package/rules/import-x.js
CHANGED
package/rules/jsdoc.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @import { Linter } from "eslint"
|
|
2
|
+
* @import { Linter } from "eslint";
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -144,7 +144,7 @@ const jsdocRules = {
|
|
|
144
144
|
}
|
|
145
145
|
],
|
|
146
146
|
"jsdoc/require-description-complete-sentence": "off",
|
|
147
|
-
"jsdoc/require-example": "
|
|
147
|
+
"jsdoc/require-example": "off",
|
|
148
148
|
"jsdoc/require-file-overview": [
|
|
149
149
|
"off",
|
|
150
150
|
{
|
|
@@ -163,31 +163,7 @@ const jsdocRules = {
|
|
|
163
163
|
}
|
|
164
164
|
],
|
|
165
165
|
"jsdoc/require-hyphen-before-param-description": ["warn", "always"],
|
|
166
|
-
"jsdoc/require-jsdoc":
|
|
167
|
-
"warn",
|
|
168
|
-
{
|
|
169
|
-
contexts: [
|
|
170
|
-
`
|
|
171
|
-
:not(
|
|
172
|
-
:matches(
|
|
173
|
-
ObjectExpression > Property,
|
|
174
|
-
ArrayExpression:has(Literal ~ ArrowFunctionExpression),
|
|
175
|
-
CallExpression,
|
|
176
|
-
Property > AssignmentPattern
|
|
177
|
-
)
|
|
178
|
-
) > ArrowFunctionExpression
|
|
179
|
-
`.replaceAll(/\s/gv, "")
|
|
180
|
-
],
|
|
181
|
-
require: {
|
|
182
|
-
ArrowFunctionExpression: false,
|
|
183
|
-
ClassDeclaration: true,
|
|
184
|
-
ClassExpression: true,
|
|
185
|
-
FunctionDeclaration: true,
|
|
186
|
-
FunctionExpression: true,
|
|
187
|
-
MethodDefinition: true
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
],
|
|
166
|
+
"jsdoc/require-jsdoc": "off",
|
|
191
167
|
"jsdoc/require-param": ["warn", { unnamedRootBase: ["options"] }],
|
|
192
168
|
"jsdoc/require-param-description": [
|
|
193
169
|
"warn",
|
package/rules/jsx-a11y.js
CHANGED
package/rules/no-secrets.js
CHANGED
package/rules/no-unsanitized.js
CHANGED
package/rules/perfectionist.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @import { Linter } from "eslint"
|
|
2
|
+
* @import { Linter } from "eslint";
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -9,7 +9,8 @@ const perfectionistRules = {
|
|
|
9
9
|
"perfectionist/sort-array-includes": [
|
|
10
10
|
"error",
|
|
11
11
|
{
|
|
12
|
-
groupKind: "
|
|
12
|
+
groupKind: "mixed",
|
|
13
|
+
groups: ["literal", "spread"]
|
|
13
14
|
}
|
|
14
15
|
],
|
|
15
16
|
"perfectionist/sort-classes": [
|
|
@@ -39,11 +40,14 @@ const perfectionistRules = {
|
|
|
39
40
|
["private-method", "private-function-property"],
|
|
40
41
|
"unknown"
|
|
41
42
|
],
|
|
42
|
-
partitionByComment: String.raw
|
|
43
|
+
partitionByComment: String.raw`\/\/`,
|
|
44
|
+
partitionByNewLine: false
|
|
43
45
|
}
|
|
44
46
|
],
|
|
45
|
-
"perfectionist/sort-
|
|
46
|
-
"perfectionist/sort-
|
|
47
|
+
"perfectionist/sort-decorators": "error",
|
|
48
|
+
"perfectionist/sort-enums": "error",
|
|
49
|
+
"perfectionist/sort-exports": "error",
|
|
50
|
+
"perfectionist/sort-heritage-clauses": "error",
|
|
47
51
|
"perfectionist/sort-imports": [
|
|
48
52
|
"error",
|
|
49
53
|
{
|
|
@@ -79,28 +83,25 @@ const perfectionistRules = {
|
|
|
79
83
|
"index",
|
|
80
84
|
"unknown"
|
|
81
85
|
],
|
|
82
|
-
internalPattern: ["
|
|
86
|
+
internalPattern: ["^@/.+"],
|
|
83
87
|
newlinesBetween: "always",
|
|
84
88
|
partitionByNewLine: false,
|
|
85
89
|
sortSideEffects: true
|
|
86
90
|
}
|
|
87
91
|
],
|
|
88
|
-
"perfectionist/sort-interfaces":
|
|
89
|
-
"perfectionist/sort-intersection-types":
|
|
92
|
+
"perfectionist/sort-interfaces": "error",
|
|
93
|
+
"perfectionist/sort-intersection-types": "error",
|
|
90
94
|
"perfectionist/sort-jsx-props": [
|
|
91
95
|
"error",
|
|
92
96
|
{
|
|
93
|
-
groups: [
|
|
94
|
-
"shorthand",
|
|
95
|
-
"unknown",
|
|
96
|
-
"multiline"
|
|
97
|
-
]
|
|
97
|
+
groups: ["shorthand", "unknown", "multiline"]
|
|
98
98
|
}
|
|
99
99
|
],
|
|
100
|
-
"perfectionist/sort-maps":
|
|
101
|
-
"perfectionist/sort-
|
|
100
|
+
"perfectionist/sort-maps": "error",
|
|
101
|
+
"perfectionist/sort-modules": "off",
|
|
102
|
+
"perfectionist/sort-named-exports": "error",
|
|
102
103
|
"perfectionist/sort-named-imports": ["error", { partitionByComment: false }],
|
|
103
|
-
"perfectionist/sort-object-types":
|
|
104
|
+
"perfectionist/sort-object-types": "error",
|
|
104
105
|
"perfectionist/sort-objects": [
|
|
105
106
|
"error",
|
|
106
107
|
{
|
|
@@ -109,11 +110,7 @@ const perfectionistRules = {
|
|
|
109
110
|
groupBeforeAfter1: ["^before.*"],
|
|
110
111
|
groupBeforeAfter2: ["^after.*"],
|
|
111
112
|
groupColor1: ["^r$", "^l$"],
|
|
112
|
-
groupColor2: [
|
|
113
|
-
"^g$",
|
|
114
|
-
"^c$",
|
|
115
|
-
"^a$"
|
|
116
|
-
],
|
|
113
|
+
groupColor2: ["^g$", "^c$", "^a$"],
|
|
117
114
|
groupColor3: ["^b$", "^h$"],
|
|
118
115
|
groupMinimumMaximum1: ["^minimum(([A-Z].*)|$)"],
|
|
119
116
|
groupMinimumMaximum2: ["^maximum(([A-Z].*)|$)"],
|
|
@@ -187,9 +184,9 @@ const perfectionistRules = {
|
|
|
187
184
|
]
|
|
188
185
|
}
|
|
189
186
|
],
|
|
190
|
-
"perfectionist/sort-sets":
|
|
191
|
-
"perfectionist/sort-switch-case":
|
|
192
|
-
"perfectionist/sort-union-types":
|
|
187
|
+
"perfectionist/sort-sets": "error",
|
|
188
|
+
"perfectionist/sort-switch-case": "error",
|
|
189
|
+
"perfectionist/sort-union-types": "error",
|
|
193
190
|
"perfectionist/sort-variable-declarations": ["error", { partitionByComment: false }]
|
|
194
191
|
};
|
|
195
192
|
|
package/rules/promise.js
CHANGED
|
@@ -1,20 +1,34 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @import { Linter } from "eslint"
|
|
2
|
+
* @import { Linter } from "eslint";
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @satisfies {Linter.RulesRecord}
|
|
7
7
|
*/
|
|
8
8
|
const promiseRules = {
|
|
9
|
-
"promise/always-return":
|
|
9
|
+
"promise/always-return": [
|
|
10
|
+
"error",
|
|
11
|
+
{
|
|
12
|
+
ignoreAssignmentVariable: ["globalThis"],
|
|
13
|
+
ignoreLastCallback: false
|
|
14
|
+
}
|
|
15
|
+
],
|
|
10
16
|
"promise/avoid-new": "off",
|
|
11
|
-
"promise/catch-or-return":
|
|
17
|
+
"promise/catch-or-return": [
|
|
18
|
+
"error",
|
|
19
|
+
{
|
|
20
|
+
allowFinally: false,
|
|
21
|
+
allowThen: false,
|
|
22
|
+
allowThenStrict: false,
|
|
23
|
+
terminationMethod: ["catch"]
|
|
24
|
+
}
|
|
25
|
+
],
|
|
12
26
|
"promise/no-callback-in-promise": "error",
|
|
13
27
|
"promise/no-multiple-resolved": "error",
|
|
14
28
|
"promise/no-native": "off",
|
|
15
29
|
"promise/no-nesting": "error",
|
|
16
30
|
"promise/no-new-statics": "error",
|
|
17
|
-
"promise/no-promise-in-callback": "error",
|
|
31
|
+
"promise/no-promise-in-callback": ["error", { timeoutsErr: false }],
|
|
18
32
|
"promise/no-return-in-finally": "error",
|
|
19
33
|
"promise/no-return-wrap": "error",
|
|
20
34
|
"promise/param-names": [
|
|
@@ -26,8 +40,9 @@ const promiseRules = {
|
|
|
26
40
|
],
|
|
27
41
|
"promise/prefer-await-to-callbacks": "error",
|
|
28
42
|
"promise/prefer-await-to-then": ["error", { strict: true }],
|
|
43
|
+
"promise/prefer-catch": "error",
|
|
29
44
|
"promise/spec-only": "error",
|
|
30
|
-
"promise/valid-params": "error"
|
|
45
|
+
"promise/valid-params": ["error", { exclude: [] }]
|
|
31
46
|
};
|
|
32
47
|
|
|
33
48
|
export default promiseRules;
|
package/rules/react.js
CHANGED
package/rules/redos.js
CHANGED
package/rules/regexp.js
CHANGED
package/rules/security.js
CHANGED
package/rules/sonarjs.js
CHANGED
|
@@ -38,25 +38,13 @@ const lineBreaksRules = {
|
|
|
38
38
|
blankLine: "always"
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
|
-
prev: [
|
|
42
|
-
"const",
|
|
43
|
-
"let",
|
|
44
|
-
"var"
|
|
45
|
-
],
|
|
41
|
+
prev: ["const", "let", "var"],
|
|
46
42
|
next: "*",
|
|
47
43
|
blankLine: "always"
|
|
48
44
|
},
|
|
49
45
|
{
|
|
50
|
-
prev: [
|
|
51
|
-
|
|
52
|
-
"let",
|
|
53
|
-
"var"
|
|
54
|
-
],
|
|
55
|
-
next: [
|
|
56
|
-
"const",
|
|
57
|
-
"let",
|
|
58
|
-
"var"
|
|
59
|
-
],
|
|
46
|
+
prev: ["const", "let", "var"],
|
|
47
|
+
next: ["const", "let", "var"],
|
|
60
48
|
blankLine: "any"
|
|
61
49
|
},
|
|
62
50
|
{
|