@adbayb/stack 2.29.0 → 2.31.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/configs/eslint/constants.js +31 -6
- package/configs/eslint/helpers.js +2 -3
- package/configs/eslint/index.js +14 -17
- package/configs/eslint/presets/eslint.js +28 -8
- package/configs/eslint/presets/import.js +12 -4
- package/configs/eslint/presets/jsdoc.js +73 -74
- package/configs/eslint/presets/markdown.js +1 -3
- package/configs/eslint/presets/node.js +41 -43
- package/configs/eslint/presets/prettier.js +1 -0
- package/configs/eslint/presets/react.js +83 -61
- package/configs/eslint/presets/sonar.js +16 -6
- package/configs/eslint/presets/stylistic.js +72 -73
- package/configs/eslint/presets/test.js +56 -65
- package/configs/eslint/presets/typescript.js +6 -8
- package/configs/eslint/presets/uncategorized.js +37 -38
- package/configs/eslint/presets/unicorn.js +128 -129
- package/dist/index.js +2 -2
- package/package.json +22 -22
- package/configs/eslint/presets/base.js +0 -26
- package/configs/eslint/presets/overridable.js +0 -28
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import sonarjsPlugin from "eslint-plugin-sonarjs";
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { createConfig } from "../helpers.js";
|
|
4
|
+
import { JAVASCRIPT_LIKE_FILES, RELAXED_LIKE_FILES } from "../constants.js";
|
|
4
5
|
|
|
5
|
-
export const config =
|
|
6
|
+
export const config = createConfig(
|
|
6
7
|
{
|
|
7
|
-
files:
|
|
8
|
+
files: JAVASCRIPT_LIKE_FILES,
|
|
8
9
|
plugins: {
|
|
9
10
|
sonarjs: sonarjsPlugin,
|
|
10
11
|
},
|
|
@@ -71,15 +72,18 @@ export const config = [
|
|
|
71
72
|
"sonarjs/no-array-delete": "error",
|
|
72
73
|
"sonarjs/no-associative-arrays": "error",
|
|
73
74
|
"sonarjs/no-async-constructor": "error",
|
|
75
|
+
"sonarjs/no-built-in-override": "error",
|
|
74
76
|
"sonarjs/no-case-label-in-switch": "error",
|
|
75
77
|
"sonarjs/no-clear-text-protocols": "error",
|
|
76
78
|
"sonarjs/no-code-after-done": "error",
|
|
79
|
+
"sonarjs/no-collapsible-if": "error",
|
|
77
80
|
"sonarjs/no-collection-size-mischeck": "error",
|
|
78
81
|
"sonarjs/no-commented-code": "error",
|
|
79
82
|
"sonarjs/no-control-regex": "error",
|
|
80
83
|
"sonarjs/no-dead-store": "error",
|
|
81
84
|
"sonarjs/no-delete-var": "error",
|
|
82
85
|
"sonarjs/no-duplicate-in-composite": "error",
|
|
86
|
+
"sonarjs/no-duplicate-string": ["error", { threshold: 5 }],
|
|
83
87
|
"sonarjs/no-duplicated-branches": "error",
|
|
84
88
|
"sonarjs/no-element-overwrite": "error",
|
|
85
89
|
"sonarjs/no-empty-after-reluctant": "error",
|
|
@@ -122,11 +126,11 @@ export const config = [
|
|
|
122
126
|
"sonarjs/no-misleading-character-class": "error",
|
|
123
127
|
"sonarjs/no-mixed-content": "error",
|
|
124
128
|
"sonarjs/no-nested-assignment": "error",
|
|
129
|
+
"sonarjs/no-nested-conditional": "error",
|
|
125
130
|
"sonarjs/no-nested-functions": "error",
|
|
126
131
|
"sonarjs/no-nested-incdec": "error",
|
|
127
132
|
"sonarjs/no-nested-switch": "error",
|
|
128
133
|
"sonarjs/no-nested-template-literals": "error",
|
|
129
|
-
"sonarjs/no-one-iteration-loop": "error",
|
|
130
134
|
"sonarjs/no-os-command-from-path": "error",
|
|
131
135
|
"sonarjs/no-parameter-reassignment": "error",
|
|
132
136
|
"sonarjs/no-primitive-wrappers": "error",
|
|
@@ -148,7 +152,6 @@ export const config = [
|
|
|
148
152
|
"sonarjs/no-useless-increment": "error",
|
|
149
153
|
"sonarjs/no-useless-intersection": "error",
|
|
150
154
|
"sonarjs/no-useless-react-setstate": "error",
|
|
151
|
-
"sonarjs/no-vue-bypass-sanitization": "error",
|
|
152
155
|
"sonarjs/no-weak-cipher": "error",
|
|
153
156
|
"sonarjs/no-weak-keys": "error",
|
|
154
157
|
"sonarjs/non-existent-operator": "error",
|
|
@@ -191,4 +194,11 @@ export const config = [
|
|
|
191
194
|
"sonarjs/xml-parser-xxe": "error",
|
|
192
195
|
},
|
|
193
196
|
},
|
|
194
|
-
|
|
197
|
+
{
|
|
198
|
+
files: RELAXED_LIKE_FILES,
|
|
199
|
+
rules: {
|
|
200
|
+
"sonarjs/file-name-differ-from-class": "off",
|
|
201
|
+
"sonarjs/sonar-no-magic-numbers": "off",
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
);
|
|
@@ -1,77 +1,76 @@
|
|
|
1
1
|
import stylistic from "@stylistic/eslint-plugin";
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { createConfig } from "../helpers.js";
|
|
4
|
+
import { JAVASCRIPT_LIKE_FILES } from "../constants.js";
|
|
4
5
|
|
|
5
|
-
export const config =
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
"@stylistic": stylistic,
|
|
10
|
-
},
|
|
11
|
-
rules: {
|
|
12
|
-
"@stylistic/jsx-pascal-case": "error",
|
|
13
|
-
"@stylistic/jsx-self-closing-comp": "error",
|
|
14
|
-
"@stylistic/jsx-sort-props": "error",
|
|
15
|
-
"@stylistic/lines-between-class-members": ["error", "always"],
|
|
16
|
-
"@stylistic/multiline-comment-style": ["error", "starred-block"],
|
|
17
|
-
"@stylistic/padding-line-between-statements": [
|
|
18
|
-
"error",
|
|
19
|
-
{
|
|
20
|
-
blankLine: "always",
|
|
21
|
-
next: "*",
|
|
22
|
-
prev: "*",
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
blankLine: "never",
|
|
26
|
-
next: ["const", "let", "var"],
|
|
27
|
-
prev: ["const", "let", "var"],
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
blankLine: "never",
|
|
31
|
-
next: ["case", "default"],
|
|
32
|
-
prev: ["case", "default"],
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
blankLine: "always",
|
|
36
|
-
next: ["const", "let", "var"],
|
|
37
|
-
prev: ["multiline-const", "multiline-let", "multiline-var"],
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
blankLine: "always",
|
|
41
|
-
next: ["multiline-const", "multiline-let", "multiline-var"],
|
|
42
|
-
prev: ["const", "let", "var"],
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
blankLine: "any",
|
|
46
|
-
next: ["expression"],
|
|
47
|
-
prev: ["expression"],
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
blankLine: "any",
|
|
51
|
-
next: ["const", "let", "var"],
|
|
52
|
-
prev: ["cjs-import"],
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
blankLine: "any",
|
|
56
|
-
next: ["cjs-import", "import"],
|
|
57
|
-
prev: ["cjs-import", "import"],
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
blankLine: "any",
|
|
61
|
-
next: ["cjs-export", "export"],
|
|
62
|
-
prev: ["cjs-export", "export"],
|
|
63
|
-
},
|
|
64
|
-
],
|
|
65
|
-
"@stylistic/quotes": [
|
|
66
|
-
"error",
|
|
67
|
-
"double",
|
|
68
|
-
{ allowTemplateLiterals: false, avoidEscape: true },
|
|
69
|
-
],
|
|
70
|
-
"@stylistic/spaced-comment": [
|
|
71
|
-
"error",
|
|
72
|
-
"always",
|
|
73
|
-
{ block: { balanced: true } },
|
|
74
|
-
],
|
|
75
|
-
},
|
|
6
|
+
export const config = createConfig({
|
|
7
|
+
files: JAVASCRIPT_LIKE_FILES,
|
|
8
|
+
plugins: {
|
|
9
|
+
"@stylistic": stylistic,
|
|
76
10
|
},
|
|
77
|
-
|
|
11
|
+
rules: {
|
|
12
|
+
"@stylistic/jsx-pascal-case": "error",
|
|
13
|
+
"@stylistic/jsx-self-closing-comp": "error",
|
|
14
|
+
"@stylistic/jsx-sort-props": "error",
|
|
15
|
+
"@stylistic/lines-between-class-members": ["error", "always"],
|
|
16
|
+
"@stylistic/multiline-comment-style": ["error", "starred-block"],
|
|
17
|
+
"@stylistic/padding-line-between-statements": [
|
|
18
|
+
"error",
|
|
19
|
+
{
|
|
20
|
+
blankLine: "always",
|
|
21
|
+
next: "*",
|
|
22
|
+
prev: "*",
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
blankLine: "never",
|
|
26
|
+
next: ["const", "let", "var"],
|
|
27
|
+
prev: ["const", "let", "var"],
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
blankLine: "never",
|
|
31
|
+
next: ["case", "default"],
|
|
32
|
+
prev: ["case", "default"],
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
blankLine: "always",
|
|
36
|
+
next: ["const", "let", "var"],
|
|
37
|
+
prev: ["multiline-const", "multiline-let", "multiline-var"],
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
blankLine: "always",
|
|
41
|
+
next: ["multiline-const", "multiline-let", "multiline-var"],
|
|
42
|
+
prev: ["const", "let", "var"],
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
blankLine: "any",
|
|
46
|
+
next: ["expression"],
|
|
47
|
+
prev: ["expression"],
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
blankLine: "any",
|
|
51
|
+
next: ["const", "let", "var"],
|
|
52
|
+
prev: ["cjs-import"],
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
blankLine: "any",
|
|
56
|
+
next: ["cjs-import", "import"],
|
|
57
|
+
prev: ["cjs-import", "import"],
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
blankLine: "any",
|
|
61
|
+
next: ["cjs-export", "export"],
|
|
62
|
+
prev: ["cjs-export", "export"],
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
"@stylistic/quotes": [
|
|
66
|
+
"error",
|
|
67
|
+
"double",
|
|
68
|
+
{ allowTemplateLiterals: "avoidEscape", avoidEscape: true },
|
|
69
|
+
],
|
|
70
|
+
"@stylistic/spaced-comment": [
|
|
71
|
+
"error",
|
|
72
|
+
"always",
|
|
73
|
+
{ block: { balanced: true } },
|
|
74
|
+
],
|
|
75
|
+
},
|
|
76
|
+
});
|
|
@@ -1,71 +1,62 @@
|
|
|
1
1
|
import jestFormattingPlugin from "eslint-plugin-jest-formatting";
|
|
2
2
|
import vitestPlugin from "@vitest/eslint-plugin";
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
import { createConfig } from "../helpers.js";
|
|
5
|
+
import { TEST_LIKE_FILES } from "../constants.js";
|
|
6
|
+
|
|
7
|
+
export const config = createConfig({
|
|
8
|
+
files: TEST_LIKE_FILES,
|
|
9
|
+
plugins: {
|
|
10
|
+
"jest-formatting": jestFormattingPlugin,
|
|
11
|
+
"vitest": vitestPlugin,
|
|
12
|
+
},
|
|
13
|
+
rules: {
|
|
14
|
+
"jest-formatting/padding-around-all": "error",
|
|
15
|
+
"vitest/consistent-test-it": [
|
|
16
|
+
"error",
|
|
17
|
+
{ fn: "test", withinDescribe: "test" },
|
|
9
18
|
],
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"vitest/prefer-to-have-length": "error",
|
|
52
|
-
"vitest/prefer-todo": "error",
|
|
53
|
-
"vitest/require-hook": "error",
|
|
54
|
-
"vitest/require-local-test-context-for-concurrent-snapshots":
|
|
55
|
-
"error",
|
|
56
|
-
"vitest/require-to-throw-message": "error",
|
|
57
|
-
"vitest/require-top-level-describe": "error",
|
|
58
|
-
"vitest/valid-describe-callback": "error",
|
|
59
|
-
"vitest/valid-expect": "error",
|
|
60
|
-
"vitest/valid-title": [
|
|
61
|
-
"error",
|
|
62
|
-
{ mustMatch: { test: ["^should "] } },
|
|
63
|
-
],
|
|
64
|
-
},
|
|
65
|
-
settings: {
|
|
66
|
-
vitest: {
|
|
67
|
-
typecheck: true,
|
|
68
|
-
},
|
|
19
|
+
"vitest/expect-expect": "error",
|
|
20
|
+
"vitest/max-nested-describe": ["error", { max: 1 }],
|
|
21
|
+
"vitest/no-alias-methods": "error",
|
|
22
|
+
"vitest/no-commented-out-tests": "error",
|
|
23
|
+
"vitest/no-conditional-expect": "error",
|
|
24
|
+
"vitest/no-conditional-in-test": "error",
|
|
25
|
+
"vitest/no-conditional-tests": "error",
|
|
26
|
+
"vitest/no-disabled-tests": "error",
|
|
27
|
+
"vitest/no-done-callback": "error",
|
|
28
|
+
"vitest/no-duplicate-hooks": "error",
|
|
29
|
+
"vitest/no-focused-tests": "error",
|
|
30
|
+
"vitest/no-identical-title": "error",
|
|
31
|
+
"vitest/no-import-node-test": "error",
|
|
32
|
+
"vitest/no-mocks-import": "error",
|
|
33
|
+
"vitest/no-standalone-expect": "error",
|
|
34
|
+
"vitest/no-test-return-statement": "error",
|
|
35
|
+
"vitest/prefer-called-with": "error",
|
|
36
|
+
"vitest/prefer-comparison-matcher": "error",
|
|
37
|
+
"vitest/prefer-each": "error",
|
|
38
|
+
"vitest/prefer-equality-matcher": "error",
|
|
39
|
+
"vitest/prefer-hooks-in-order": "error",
|
|
40
|
+
"vitest/prefer-hooks-on-top": "error",
|
|
41
|
+
"vitest/prefer-lowercase-title": ["error", { ignore: ["describe"] }],
|
|
42
|
+
"vitest/prefer-mock-promise-shorthand": "error",
|
|
43
|
+
"vitest/prefer-strict-equal": "error",
|
|
44
|
+
"vitest/prefer-to-be": "error",
|
|
45
|
+
"vitest/prefer-to-be-object": "error",
|
|
46
|
+
"vitest/prefer-to-contain": "error",
|
|
47
|
+
"vitest/prefer-to-have-length": "error",
|
|
48
|
+
"vitest/prefer-todo": "error",
|
|
49
|
+
"vitest/require-hook": "error",
|
|
50
|
+
"vitest/require-local-test-context-for-concurrent-snapshots": "error",
|
|
51
|
+
"vitest/require-to-throw-message": "error",
|
|
52
|
+
"vitest/require-top-level-describe": "error",
|
|
53
|
+
"vitest/valid-describe-callback": "error",
|
|
54
|
+
"vitest/valid-expect": "error",
|
|
55
|
+
"vitest/valid-title": ["error", { mustMatch: { test: ["^should "] } }],
|
|
56
|
+
},
|
|
57
|
+
settings: {
|
|
58
|
+
vitest: {
|
|
59
|
+
typecheck: true,
|
|
69
60
|
},
|
|
70
61
|
},
|
|
71
|
-
|
|
62
|
+
});
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import tseslint from "typescript-eslint";
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
JAVASCRIPT_LIKE_EXTENSIONS,
|
|
6
|
-
} from "../constants.js";
|
|
3
|
+
import { createConfig } from "../helpers.js";
|
|
4
|
+
import { JAVASCRIPT_FILES, JAVASCRIPT_LIKE_FILES } from "../constants.js";
|
|
7
5
|
|
|
8
|
-
export const config =
|
|
6
|
+
export const config = createConfig(
|
|
9
7
|
{
|
|
10
|
-
files:
|
|
8
|
+
files: JAVASCRIPT_LIKE_FILES,
|
|
11
9
|
languageOptions: {
|
|
12
10
|
parser: tseslint.parser,
|
|
13
11
|
parserOptions: {
|
|
@@ -195,7 +193,7 @@ export const config = [
|
|
|
195
193
|
},
|
|
196
194
|
},
|
|
197
195
|
{
|
|
198
|
-
files:
|
|
196
|
+
files: JAVASCRIPT_FILES,
|
|
199
197
|
...tseslint.configs.disableTypeChecked,
|
|
200
198
|
},
|
|
201
|
-
|
|
199
|
+
);
|
|
@@ -1,43 +1,42 @@
|
|
|
1
1
|
import sortKeysCustomOrderPlugin from "eslint-plugin-sort-keys-custom-order";
|
|
2
2
|
import dependPlugin from "eslint-plugin-depend";
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { createConfig } from "../helpers.js";
|
|
5
|
+
import { JAVASCRIPT_LIKE_FILES } from "../constants.js";
|
|
5
6
|
|
|
6
|
-
export const config =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"sort-keys-custom-order": sortKeysCustomOrderPlugin,
|
|
12
|
-
},
|
|
13
|
-
rules: {
|
|
14
|
-
"depend/ban-dependencies": "error",
|
|
15
|
-
"sort-keys-custom-order/object-keys": [
|
|
16
|
-
"error",
|
|
17
|
-
{
|
|
18
|
-
orderedKeys: [
|
|
19
|
-
"id",
|
|
20
|
-
"key",
|
|
21
|
-
"name",
|
|
22
|
-
"title",
|
|
23
|
-
"label",
|
|
24
|
-
"description",
|
|
25
|
-
],
|
|
26
|
-
},
|
|
27
|
-
],
|
|
28
|
-
"sort-keys-custom-order/type-keys": [
|
|
29
|
-
"error",
|
|
30
|
-
{
|
|
31
|
-
orderedKeys: [
|
|
32
|
-
"id",
|
|
33
|
-
"key",
|
|
34
|
-
"name",
|
|
35
|
-
"title",
|
|
36
|
-
"label",
|
|
37
|
-
"description",
|
|
38
|
-
],
|
|
39
|
-
},
|
|
40
|
-
],
|
|
41
|
-
},
|
|
7
|
+
export const config = createConfig({
|
|
8
|
+
files: JAVASCRIPT_LIKE_FILES,
|
|
9
|
+
plugins: {
|
|
10
|
+
"depend": dependPlugin,
|
|
11
|
+
"sort-keys-custom-order": sortKeysCustomOrderPlugin,
|
|
42
12
|
},
|
|
43
|
-
|
|
13
|
+
rules: {
|
|
14
|
+
"depend/ban-dependencies": "error",
|
|
15
|
+
"sort-keys-custom-order/object-keys": [
|
|
16
|
+
"error",
|
|
17
|
+
{
|
|
18
|
+
orderedKeys: [
|
|
19
|
+
"id",
|
|
20
|
+
"key",
|
|
21
|
+
"name",
|
|
22
|
+
"title",
|
|
23
|
+
"label",
|
|
24
|
+
"description",
|
|
25
|
+
],
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
"sort-keys-custom-order/type-keys": [
|
|
29
|
+
"error",
|
|
30
|
+
{
|
|
31
|
+
orderedKeys: [
|
|
32
|
+
"id",
|
|
33
|
+
"key",
|
|
34
|
+
"name",
|
|
35
|
+
"title",
|
|
36
|
+
"label",
|
|
37
|
+
"description",
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
},
|
|
42
|
+
});
|