@shayanthenerd/eslint-config 0.11.2 → 0.12.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/configs/base.mjs +13 -14
- package/dist/configs/css.mjs +2 -2
- package/dist/configs/cypress.mjs +2 -1
- package/dist/configs/html.mjs +3 -1
- package/dist/configs/importX.mjs +8 -5
- package/dist/configs/oxlintOverrides.mjs +8 -8
- package/dist/configs/perfectionist.mjs +1 -1
- package/dist/configs/playwright.mjs +2 -1
- package/dist/configs/storybook.mjs +1 -2
- package/dist/configs/stylistic.mjs +3 -3
- package/dist/configs/tailwind.mjs +15 -12
- package/dist/configs/typescript.mjs +13 -10
- package/dist/configs/vitest.mjs +1 -1
- package/dist/configs/vue.mjs +20 -8
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +23 -22
- package/dist/oxlint.config.jsonc +1 -0
- package/dist/rules/css.mjs +12 -3
- package/dist/rules/cypress.mjs +7 -3
- package/dist/rules/html.mjs +45 -23
- package/dist/rules/importX.mjs +23 -21
- package/dist/rules/javascript.mjs +167 -115
- package/dist/rules/playwright.mjs +40 -12
- package/dist/rules/storybook.mjs +13 -2
- package/dist/rules/stylistic.mjs +104 -55
- package/dist/rules/tailwind.mjs +13 -12
- package/dist/rules/typescript.mjs +117 -7
- package/dist/rules/vitest.mjs +57 -28
- package/dist/rules/vue.mjs +271 -96
- package/dist/rules/vueAccessibility.mjs +21 -7
- package/dist/types/eslint-schema.d.mts +24 -33
- package/package.json +23 -24
package/dist/rules/stylistic.mjs
CHANGED
|
@@ -4,66 +4,53 @@ import { defaultOptions } from "../utils/options/defaultOptions.mjs";
|
|
|
4
4
|
//#region src/rules/stylistic.ts
|
|
5
5
|
function getStylisticRules(options) {
|
|
6
6
|
const { stylistic } = options.configs;
|
|
7
|
-
const { semi, quotes, indent, useTabs, jsxQuotes, arrowParens, trailingComma, maxLineLength, memberDelimiterStyle, maxConsecutiveEmptyLines } = isEnabled(stylistic) ? stylistic : defaultOptions.configs.stylistic;
|
|
7
|
+
const { semi, quotes, indent, useTabs, jsxQuotes, arrowParens, trailingComma, maxLineLength, maxAttributesPerLine, memberDelimiterStyle, maxConsecutiveEmptyLines } = isEnabled(stylistic) ? stylistic : defaultOptions.configs.stylistic;
|
|
8
8
|
return {
|
|
9
|
-
"@stylistic/wrap-regex": "warn",
|
|
10
|
-
"@stylistic/semi-style": "warn",
|
|
11
|
-
"@stylistic/semi": ["warn", semi],
|
|
12
|
-
"@stylistic/no-extra-semi": "warn",
|
|
13
|
-
"@stylistic/spaced-comment": "off",
|
|
14
|
-
"@stylistic/exp-list-style": "warn",
|
|
15
|
-
"@stylistic/linebreak-style": "warn",
|
|
16
|
-
"@stylistic/quotes": ["warn", quotes],
|
|
17
|
-
"@stylistic/no-confusing-arrow": "warn",
|
|
18
|
-
"@stylistic/switch-colon-spacing": "warn",
|
|
19
|
-
"@stylistic/jsx-quotes": ["warn", jsxQuotes],
|
|
20
|
-
"@stylistic/type-annotation-spacing": "warn",
|
|
21
|
-
"@stylistic/no-tabs": useTabs ? "off" : "warn",
|
|
22
|
-
"@stylistic/lines-between-class-members": "off",
|
|
23
|
-
"@stylistic/arrow-parens": ["warn", arrowParens],
|
|
24
|
-
"@stylistic/comma-dangle": ["warn", trailingComma],
|
|
25
|
-
"@stylistic/generator-star-spacing": ["warn", "after"],
|
|
26
|
-
"@stylistic/nonblock-statement-body-position": "error",
|
|
27
9
|
"@stylistic/array-bracket-newline": ["warn", "consistent"],
|
|
28
|
-
"@stylistic/
|
|
29
|
-
"@stylistic/
|
|
30
|
-
"@stylistic/
|
|
31
|
-
"@stylistic/
|
|
10
|
+
"@stylistic/array-bracket-spacing": "warn",
|
|
11
|
+
"@stylistic/arrow-parens": ["warn", arrowParens],
|
|
12
|
+
"@stylistic/arrow-spacing": "warn",
|
|
13
|
+
"@stylistic/block-spacing": "warn",
|
|
32
14
|
"@stylistic/brace-style": [
|
|
33
15
|
"warn",
|
|
34
16
|
"1tbs",
|
|
35
17
|
{ allowSingleLine: true }
|
|
36
18
|
],
|
|
37
|
-
"@stylistic/
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"@stylistic/
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
],
|
|
47
|
-
"@stylistic/object-property-newline": ["warn", { allowAllPropertiesOnSameLine: true }],
|
|
19
|
+
"@stylistic/comma-dangle": ["warn", trailingComma],
|
|
20
|
+
"@stylistic/comma-spacing": "warn",
|
|
21
|
+
"@stylistic/comma-style": "warn",
|
|
22
|
+
"@stylistic/computed-property-spacing": "warn",
|
|
23
|
+
"@stylistic/eol-last": "warn",
|
|
24
|
+
"@stylistic/exp-list-style": "warn",
|
|
25
|
+
"@stylistic/function-call-argument-newline": ["warn", "consistent"],
|
|
26
|
+
"@stylistic/generator-star-spacing": ["warn", "after"],
|
|
27
|
+
"@stylistic/implicit-arrow-linebreak": ["warn", "beside"],
|
|
48
28
|
"@stylistic/indent": [
|
|
49
29
|
"warn",
|
|
50
30
|
useTabs ? "tab" : indent,
|
|
51
31
|
{ tabLength: indent }
|
|
52
32
|
],
|
|
53
|
-
"@stylistic/
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
"@stylistic/
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}],
|
|
33
|
+
"@stylistic/indent-binary-ops": ["warn", useTabs ? "tab" : indent],
|
|
34
|
+
"@stylistic/jsx-closing-bracket-location": "warn",
|
|
35
|
+
"@stylistic/jsx-closing-tag-location": "warn",
|
|
36
|
+
"@stylistic/jsx-curly-brace-presence": "warn",
|
|
37
|
+
"@stylistic/jsx-curly-newline": "warn",
|
|
38
|
+
"@stylistic/jsx-curly-spacing": "warn",
|
|
39
|
+
"@stylistic/jsx-equals-spacing": "warn",
|
|
40
|
+
"@stylistic/jsx-first-prop-new-line": "warn",
|
|
41
|
+
"@stylistic/jsx-function-call-newline": "warn",
|
|
42
|
+
"@stylistic/jsx-indent-props": ["warn", useTabs ? "tab" : indent],
|
|
43
|
+
"@stylistic/jsx-max-props-per-line": ["warn", { maximum: {
|
|
44
|
+
multi: 1,
|
|
45
|
+
single: maxAttributesPerLine
|
|
46
|
+
} }],
|
|
47
|
+
"@stylistic/jsx-one-expression-per-line": "warn",
|
|
48
|
+
"@stylistic/jsx-quotes": ["warn", jsxQuotes],
|
|
49
|
+
"@stylistic/jsx-tag-spacing": "warn",
|
|
50
|
+
"@stylistic/jsx-wrap-multilines": "warn",
|
|
51
|
+
"@stylistic/key-spacing": "warn",
|
|
52
|
+
"@stylistic/keyword-spacing": "warn",
|
|
53
|
+
"@stylistic/linebreak-style": "warn",
|
|
67
54
|
"@stylistic/lines-around-comment": ["warn", {
|
|
68
55
|
allowTypeStart: true,
|
|
69
56
|
allowEnumStart: true,
|
|
@@ -74,20 +61,53 @@ function getStylisticRules(options) {
|
|
|
74
61
|
allowObjectStart: true,
|
|
75
62
|
allowInterfaceStart: true
|
|
76
63
|
}],
|
|
77
|
-
"@stylistic/
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
64
|
+
"@stylistic/max-len": ["warn", {
|
|
65
|
+
tabWidth: indent,
|
|
66
|
+
code: maxLineLength,
|
|
67
|
+
ignoreUrls: true,
|
|
68
|
+
ignoreStrings: true,
|
|
69
|
+
ignoreComments: true,
|
|
70
|
+
ignoreRegExpLiterals: true,
|
|
71
|
+
ignoreTrailingComments: true,
|
|
72
|
+
ignoreTemplateLiterals: true
|
|
81
73
|
}],
|
|
82
|
-
"@stylistic/
|
|
74
|
+
"@stylistic/max-statements-per-line": "warn",
|
|
75
|
+
"@stylistic/member-delimiter-style": ["warn", {
|
|
83
76
|
singleline: { delimiter: memberDelimiterStyle },
|
|
84
77
|
multiline: {
|
|
85
78
|
delimiter: memberDelimiterStyle,
|
|
86
79
|
requireLast: trailingComma !== "never"
|
|
87
80
|
}
|
|
88
81
|
}],
|
|
82
|
+
"@stylistic/multiline-ternary": ["warn", "always-multiline"],
|
|
83
|
+
"@stylistic/new-parens": "warn",
|
|
84
|
+
"@stylistic/no-confusing-arrow": "warn",
|
|
85
|
+
"@stylistic/no-extra-semi": "warn",
|
|
86
|
+
"@stylistic/no-floating-decimal": "warn",
|
|
87
|
+
"@stylistic/no-mixed-operators": "warn",
|
|
88
|
+
"@stylistic/no-mixed-spaces-and-tabs": "warn",
|
|
89
|
+
"@stylistic/no-multi-spaces": "warn",
|
|
90
|
+
"@stylistic/no-multiple-empty-lines": ["warn", {
|
|
91
|
+
maxBOF: 0,
|
|
92
|
+
maxEOF: 0,
|
|
93
|
+
max: maxConsecutiveEmptyLines
|
|
94
|
+
}],
|
|
95
|
+
"@stylistic/no-tabs": useTabs ? "off" : "warn",
|
|
96
|
+
"@stylistic/no-trailing-spaces": "warn",
|
|
97
|
+
"@stylistic/no-whitespace-before-property": "warn",
|
|
98
|
+
"@stylistic/nonblock-statement-body-position": "warn",
|
|
99
|
+
"@stylistic/object-curly-newline": ["warn", {
|
|
100
|
+
multiline: true,
|
|
101
|
+
consistent: true
|
|
102
|
+
}],
|
|
103
|
+
"@stylistic/object-curly-spacing": [
|
|
104
|
+
"warn",
|
|
105
|
+
"always",
|
|
106
|
+
{ emptyObjects: "never" }
|
|
107
|
+
],
|
|
108
|
+
"@stylistic/object-property-newline": ["warn", { allowAllPropertiesOnSameLine: true }],
|
|
89
109
|
"@stylistic/operator-linebreak": [
|
|
90
|
-
"
|
|
110
|
+
"warn",
|
|
91
111
|
"none",
|
|
92
112
|
{ overrides: {
|
|
93
113
|
"=": "after",
|
|
@@ -97,6 +117,11 @@ function getStylisticRules(options) {
|
|
|
97
117
|
"&": "before"
|
|
98
118
|
} }
|
|
99
119
|
],
|
|
120
|
+
"@stylistic/padded-blocks": [
|
|
121
|
+
"warn",
|
|
122
|
+
"never",
|
|
123
|
+
{ allowSingleLineBlocks: true }
|
|
124
|
+
],
|
|
100
125
|
"@stylistic/padding-line-between-statements": [
|
|
101
126
|
"warn",
|
|
102
127
|
{
|
|
@@ -153,7 +178,31 @@ function getStylisticRules(options) {
|
|
|
153
178
|
next: "*",
|
|
154
179
|
blankLine: "always"
|
|
155
180
|
}
|
|
156
|
-
]
|
|
181
|
+
],
|
|
182
|
+
"@stylistic/quote-props": ["warn", "consistent-as-needed"],
|
|
183
|
+
"@stylistic/quotes": ["warn", quotes],
|
|
184
|
+
"@stylistic/rest-spread-spacing": "warn",
|
|
185
|
+
"@stylistic/semi": ["warn", semi],
|
|
186
|
+
"@stylistic/semi-spacing": "warn",
|
|
187
|
+
"@stylistic/semi-style": "warn",
|
|
188
|
+
"@stylistic/space-before-blocks": "warn",
|
|
189
|
+
"@stylistic/space-before-function-paren": ["warn", {
|
|
190
|
+
named: "never",
|
|
191
|
+
catch: "always",
|
|
192
|
+
anonymous: "always",
|
|
193
|
+
asyncArrow: "always"
|
|
194
|
+
}],
|
|
195
|
+
"@stylistic/space-in-parens": "warn",
|
|
196
|
+
"@stylistic/space-infix-ops": "warn",
|
|
197
|
+
"@stylistic/space-unary-ops": "warn",
|
|
198
|
+
"@stylistic/switch-colon-spacing": "warn",
|
|
199
|
+
"@stylistic/template-curly-spacing": "warn",
|
|
200
|
+
"@stylistic/template-tag-spacing": "warn",
|
|
201
|
+
"@stylistic/type-annotation-spacing": "warn",
|
|
202
|
+
"@stylistic/type-named-tuple-spacing": "warn",
|
|
203
|
+
"@stylistic/wrap-iife": "warn",
|
|
204
|
+
"@stylistic/wrap-regex": "warn",
|
|
205
|
+
"@stylistic/yield-star-spacing": "warn"
|
|
157
206
|
};
|
|
158
207
|
}
|
|
159
208
|
|
package/dist/rules/tailwind.mjs
CHANGED
|
@@ -7,26 +7,27 @@ function getTailwindRules(options) {
|
|
|
7
7
|
const { multilineSort, ignoredUnregisteredClasses: userIgnoredUnregisteredClasses } = isEnabled(tailwind) ? tailwind : defaultOptions.configs.tailwind;
|
|
8
8
|
const { indent, useTabs, maxLineLength } = isEnabled(stylistic) ? stylistic : defaultOptions.configs.stylistic;
|
|
9
9
|
const isTailwindV4 = isEnabled(tailwind) && tailwind.entryPoint;
|
|
10
|
-
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"better-tailwindcss/no-unnecessary-whitespace": "warn",
|
|
10
|
+
const tailwindRules = {
|
|
11
|
+
"better-tailwindcss/enforce-consistent-line-wrapping": [multilineSort ? "warn" : "off", {
|
|
12
|
+
preferSingleLine: true,
|
|
13
|
+
printWidth: maxLineLength,
|
|
14
|
+
indent: useTabs ? "tab" : indent
|
|
15
|
+
}],
|
|
17
16
|
"better-tailwindcss/enforce-consistent-class-order": "warn",
|
|
18
17
|
"better-tailwindcss/enforce-consistent-variable-syntax": "warn",
|
|
19
18
|
"better-tailwindcss/enforce-consistent-important-position": "warn",
|
|
19
|
+
"better-tailwindcss/enforce-shorthand-classes": "warn",
|
|
20
|
+
"better-tailwindcss/no-duplicate-classes": "error",
|
|
21
|
+
"better-tailwindcss/no-deprecated-classes": "error",
|
|
22
|
+
"better-tailwindcss/no-unnecessary-whitespace": "warn",
|
|
20
23
|
"better-tailwindcss/no-unregistered-classes": [isTailwindV4 ? "warn" : "off", {
|
|
21
24
|
detectComponentClasses: true,
|
|
22
25
|
ignore: userIgnoredUnregisteredClasses
|
|
23
26
|
}],
|
|
24
|
-
"better-tailwindcss/
|
|
25
|
-
preferSingleLine: true,
|
|
26
|
-
printWidth: maxLineLength,
|
|
27
|
-
indent: useTabs ? "tab" : indent
|
|
28
|
-
}]
|
|
27
|
+
"better-tailwindcss/no-conflicting-classes": "error"
|
|
29
28
|
};
|
|
29
|
+
if (isEnabled(stylistic)) tailwindRules["@stylistic/max-len"] = "off";
|
|
30
|
+
return tailwindRules;
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
//#endregion
|
|
@@ -6,27 +6,137 @@ function getTypeScriptRules(options) {
|
|
|
6
6
|
const { typescript } = options.configs;
|
|
7
7
|
const { typeDefinitionStyle, methodSignatureStyle } = isEnabled(typescript) ? typescript : defaultOptions.configs.typescript;
|
|
8
8
|
return {
|
|
9
|
+
"constructor-super": "off",
|
|
10
|
+
"default-param-last": "off",
|
|
11
|
+
"dot-notation": "off",
|
|
12
|
+
"getter-return": "off",
|
|
13
|
+
"no-array-constructor": "off",
|
|
14
|
+
"no-class-assign": "off",
|
|
15
|
+
"no-const-assign": "off",
|
|
16
|
+
"no-dupe-args": "off",
|
|
17
|
+
"no-dupe-class-members": "off",
|
|
18
|
+
"no-dupe-keys": "off",
|
|
19
|
+
"no-empty-function": "off",
|
|
20
|
+
"no-func-assign": "off",
|
|
21
|
+
"no-implied-eval": "off",
|
|
22
|
+
"no-import-assign": "off",
|
|
9
23
|
"no-loop-func": "off",
|
|
24
|
+
"no-new-native-nonconstructor": "off",
|
|
25
|
+
"no-obj-calls": "off",
|
|
26
|
+
"no-redeclare": "off",
|
|
27
|
+
"no-setter-return": "off",
|
|
28
|
+
"no-this-before-super": "off",
|
|
29
|
+
"no-throw-literal": "off",
|
|
30
|
+
"no-undef": "off",
|
|
31
|
+
"no-unreachable": "off",
|
|
32
|
+
"no-unsafe-negation": "off",
|
|
33
|
+
"no-unused-expressions": "off",
|
|
34
|
+
"no-unused-private-class-members": "off",
|
|
10
35
|
"no-unused-vars": "off",
|
|
11
|
-
"
|
|
36
|
+
"no-useless-constructor": "off",
|
|
37
|
+
"no-with": "off",
|
|
12
38
|
"prefer-destructuring": "off",
|
|
39
|
+
"prefer-promise-reject-errors": "off",
|
|
40
|
+
"@typescript-eslint/await-thenable": "error",
|
|
41
|
+
"@typescript-eslint/ban-ts-comment": "error",
|
|
42
|
+
"@typescript-eslint/no-array-constructor": "error",
|
|
43
|
+
"@typescript-eslint/no-array-delete": "error",
|
|
44
|
+
"@typescript-eslint/no-base-to-string": "error",
|
|
45
|
+
"@typescript-eslint/no-confusing-void-expression": "error",
|
|
46
|
+
"@typescript-eslint/no-deprecated": "error",
|
|
47
|
+
"@typescript-eslint/no-duplicate-enum-values": "error",
|
|
48
|
+
"@typescript-eslint/no-duplicate-type-constituents": "error",
|
|
49
|
+
"@typescript-eslint/no-dynamic-delete": "error",
|
|
50
|
+
"@typescript-eslint/no-empty-object-type": "error",
|
|
51
|
+
"@typescript-eslint/no-explicit-any": "error",
|
|
52
|
+
"@typescript-eslint/no-extra-non-null-assertion": "error",
|
|
53
|
+
"@typescript-eslint/no-extraneous-class": "error",
|
|
54
|
+
"@typescript-eslint/no-floating-promises": "error",
|
|
55
|
+
"@typescript-eslint/no-for-in-array": "error",
|
|
56
|
+
"@typescript-eslint/no-implied-eval": "error",
|
|
57
|
+
"@typescript-eslint/no-invalid-void-type": "error",
|
|
58
|
+
"@typescript-eslint/no-meaningless-void-operator": "error",
|
|
59
|
+
"@typescript-eslint/no-misused-new": "error",
|
|
60
|
+
"@typescript-eslint/no-misused-promises": "error",
|
|
61
|
+
"@typescript-eslint/no-misused-spread": "error",
|
|
62
|
+
"@typescript-eslint/no-mixed-enums": "error",
|
|
63
|
+
"@typescript-eslint/no-namespace": "error",
|
|
64
|
+
"@typescript-eslint/no-non-null-asserted-nullish-coalescing": "error",
|
|
65
|
+
"@typescript-eslint/no-non-null-asserted-optional-chain": "error",
|
|
66
|
+
"@typescript-eslint/no-non-null-assertion": "error",
|
|
67
|
+
"@typescript-eslint/no-redundant-type-constituents": "error",
|
|
68
|
+
"@typescript-eslint/no-require-imports": "error",
|
|
69
|
+
"@typescript-eslint/no-this-alias": "error",
|
|
70
|
+
"@typescript-eslint/no-unnecessary-boolean-literal-compare": "error",
|
|
71
|
+
"@typescript-eslint/no-unnecessary-condition": "error",
|
|
72
|
+
"@typescript-eslint/no-unnecessary-template-expression": "error",
|
|
73
|
+
"@typescript-eslint/no-unnecessary-type-arguments": "error",
|
|
74
|
+
"@typescript-eslint/no-unnecessary-type-assertion": "error",
|
|
75
|
+
"@typescript-eslint/no-unnecessary-type-constraint": "error",
|
|
76
|
+
"@typescript-eslint/no-unnecessary-type-conversion": "error",
|
|
77
|
+
"@typescript-eslint/no-unnecessary-type-parameters": "error",
|
|
78
|
+
"@typescript-eslint/no-unsafe-argument": "warn",
|
|
79
|
+
"@typescript-eslint/no-unsafe-assignment": "warn",
|
|
80
|
+
"@typescript-eslint/no-unsafe-call": "warn",
|
|
81
|
+
"@typescript-eslint/no-unsafe-declaration-merging": "warn",
|
|
82
|
+
"@typescript-eslint/no-unsafe-enum-comparison": "error",
|
|
83
|
+
"@typescript-eslint/no-unsafe-function-type": "warn",
|
|
84
|
+
"@typescript-eslint/no-unsafe-member-access": "warn",
|
|
85
|
+
"@typescript-eslint/no-unsafe-return": "error",
|
|
86
|
+
"@typescript-eslint/no-unsafe-unary-minus": "error",
|
|
87
|
+
"@typescript-eslint/no-unused-expressions": "error",
|
|
88
|
+
"@typescript-eslint/no-unused-vars": "error",
|
|
89
|
+
"@typescript-eslint/no-useless-constructor": "error",
|
|
90
|
+
"@typescript-eslint/no-wrapper-object-types": "error",
|
|
91
|
+
"@typescript-eslint/only-throw-error": "error",
|
|
92
|
+
"@typescript-eslint/prefer-as-const": "warn",
|
|
93
|
+
"@typescript-eslint/prefer-literal-enum-member": "warn",
|
|
94
|
+
"@typescript-eslint/prefer-namespace-keyword": "error",
|
|
95
|
+
"@typescript-eslint/prefer-promise-reject-errors": "error",
|
|
96
|
+
"@typescript-eslint/prefer-reduce-type-parameter": "error",
|
|
97
|
+
"@typescript-eslint/prefer-return-this-type": "error",
|
|
98
|
+
"@typescript-eslint/related-getter-setter-pairs": "error",
|
|
99
|
+
"@typescript-eslint/require-await": "error",
|
|
100
|
+
"@typescript-eslint/restrict-plus-operands": "error",
|
|
101
|
+
"@typescript-eslint/restrict-template-expressions": "error",
|
|
102
|
+
"@typescript-eslint/triple-slash-reference": "error",
|
|
103
|
+
"@typescript-eslint/unified-signatures": "error",
|
|
104
|
+
"@typescript-eslint/use-unknown-in-catch-callback-variable": "error",
|
|
105
|
+
"@typescript-eslint/adjacent-overload-signatures": "warn",
|
|
106
|
+
"@typescript-eslint/array-type": "warn",
|
|
107
|
+
"@typescript-eslint/ban-tslint-comment": "error",
|
|
108
|
+
"@typescript-eslint/class-literal-property-style": "warn",
|
|
109
|
+
"@typescript-eslint/consistent-generic-constructors": "warn",
|
|
110
|
+
"@typescript-eslint/consistent-indexed-object-style": "warn",
|
|
111
|
+
"@typescript-eslint/consistent-type-assertions": "warn",
|
|
112
|
+
"@typescript-eslint/consistent-type-definitions": ["warn", typeDefinitionStyle],
|
|
113
|
+
"@typescript-eslint/dot-notation": "warn",
|
|
114
|
+
"@typescript-eslint/no-confusing-non-null-assertion": "warn",
|
|
115
|
+
"@typescript-eslint/no-empty-function": "error",
|
|
116
|
+
"@typescript-eslint/no-inferrable-types": "warn",
|
|
117
|
+
"@typescript-eslint/non-nullable-type-assertion-style": "error",
|
|
118
|
+
"@typescript-eslint/prefer-find": "warn",
|
|
119
|
+
"@typescript-eslint/prefer-for-of": "warn",
|
|
120
|
+
"@typescript-eslint/prefer-function-type": "warn",
|
|
121
|
+
"@typescript-eslint/prefer-includes": "warn",
|
|
122
|
+
"@typescript-eslint/prefer-nullish-coalescing": "warn",
|
|
123
|
+
"@typescript-eslint/prefer-optional-chain": "error",
|
|
124
|
+
"@typescript-eslint/prefer-regexp-exec": "warn",
|
|
125
|
+
"@typescript-eslint/prefer-string-starts-ends-with": "warn",
|
|
13
126
|
"@typescript-eslint/no-loop-func": "error",
|
|
14
|
-
"@typescript-eslint/unbound-method": "off",
|
|
15
127
|
"@typescript-eslint/default-param-last": "warn",
|
|
16
|
-
"@typescript-eslint/no-unsafe-assignment": "warn",
|
|
17
128
|
"@typescript-eslint/prefer-destructuring": "warn",
|
|
18
129
|
"@typescript-eslint/promise-function-async": "error",
|
|
19
|
-
"@typescript-eslint/no-unsafe-member-access": "warn",
|
|
20
130
|
"@typescript-eslint/consistent-type-imports": "warn",
|
|
21
131
|
"@typescript-eslint/no-useless-empty-export": "error",
|
|
22
132
|
"@typescript-eslint/no-unsafe-type-assertion": "warn",
|
|
23
133
|
"@typescript-eslint/prefer-enum-initializers": "error",
|
|
24
|
-
"@typescript-eslint/no-unnecessary-qualifier": "
|
|
134
|
+
"@typescript-eslint/no-unnecessary-qualifier": "warn",
|
|
25
135
|
"@typescript-eslint/switch-exhaustiveness-check": "warn",
|
|
26
136
|
"@typescript-eslint/explicit-module-boundary-types": "warn",
|
|
137
|
+
"@typescript-eslint/no-unused-private-class-members": "error",
|
|
27
138
|
"@typescript-eslint/no-unnecessary-parameter-property-assignment": "warn",
|
|
28
|
-
"@typescript-eslint/method-signature-style": ["
|
|
29
|
-
"@typescript-eslint/consistent-type-definitions": ["warn", typeDefinitionStyle],
|
|
139
|
+
"@typescript-eslint/method-signature-style": ["warn", methodSignatureStyle],
|
|
30
140
|
"@typescript-eslint/naming-convention": [
|
|
31
141
|
"warn",
|
|
32
142
|
{
|
package/dist/rules/vitest.mjs
CHANGED
|
@@ -2,42 +2,71 @@
|
|
|
2
2
|
function getVitestRules(options) {
|
|
3
3
|
const { testFunction, maxNestedDescribe } = options.configs.test;
|
|
4
4
|
return {
|
|
5
|
-
"vitest/
|
|
6
|
-
"vitest/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"vitest/
|
|
5
|
+
"vitest/consistent-test-filename": "warn",
|
|
6
|
+
"vitest/consistent-test-it": ["warn", {
|
|
7
|
+
fn: testFunction,
|
|
8
|
+
withinDescribe: testFunction
|
|
9
|
+
}],
|
|
10
|
+
"vitest/consistent-vitest-vi": "warn",
|
|
11
|
+
"vitest/expect-expect": "error",
|
|
12
|
+
"vitest/hoisted-apis-on-top": "warn",
|
|
13
|
+
"vitest/max-nested-describe": ["warn", { max: maxNestedDescribe }],
|
|
11
14
|
"vitest/no-alias-methods": "error",
|
|
12
|
-
"vitest/no-
|
|
13
|
-
"vitest/
|
|
15
|
+
"vitest/no-commented-out-tests": "warn",
|
|
16
|
+
"vitest/no-conditional-expect": "error",
|
|
17
|
+
"vitest/no-conditional-in-test": "error",
|
|
18
|
+
"vitest/no-conditional-tests": "error",
|
|
14
19
|
"vitest/no-disabled-tests": "error",
|
|
15
|
-
"vitest/prefer-called-with": "warn",
|
|
16
|
-
"vitest/prefer-to-be-falsy": "warn",
|
|
17
20
|
"vitest/no-duplicate-hooks": "error",
|
|
18
|
-
"vitest/
|
|
19
|
-
"vitest/
|
|
20
|
-
"vitest/
|
|
21
|
-
"vitest/no-
|
|
21
|
+
"vitest/no-focused-tests": "error",
|
|
22
|
+
"vitest/no-identical-title": "warn",
|
|
23
|
+
"vitest/no-import-node-test": "error",
|
|
24
|
+
"vitest/no-interpolation-in-snapshots": "warn",
|
|
25
|
+
"vitest/no-mocks-import": "error",
|
|
22
26
|
"vitest/no-standalone-expect": "error",
|
|
23
|
-
"vitest/
|
|
24
|
-
"vitest/prefer-hooks-in-order": "warn",
|
|
25
|
-
"vitest/no-conditional-expect": "error",
|
|
26
|
-
"vitest/prefer-lowercase-title": "warn",
|
|
27
|
-
"vitest/no-conditional-in-test": "error",
|
|
28
|
-
"vitest/prefer-equality-matcher": "warn",
|
|
29
|
-
"vitest/consistent-test-filename": "warn",
|
|
27
|
+
"vitest/no-test-prefixes": "error",
|
|
30
28
|
"vitest/no-test-return-statement": "error",
|
|
31
|
-
"vitest/
|
|
29
|
+
"vitest/padding-around-after-all-blocks": "warn",
|
|
30
|
+
"vitest/padding-around-after-each-blocks": "warn",
|
|
31
|
+
"vitest/padding-around-before-all-blocks": "warn",
|
|
32
|
+
"vitest/padding-around-before-each-blocks": "warn",
|
|
33
|
+
"vitest/padding-around-describe-blocks": "warn",
|
|
34
|
+
"vitest/prefer-called-exactly-once-with": "warn",
|
|
35
|
+
"vitest/prefer-called-once": "warn",
|
|
36
|
+
"vitest/prefer-called-with": "warn",
|
|
32
37
|
"vitest/prefer-comparison-matcher": "warn",
|
|
38
|
+
"vitest/prefer-each": "warn",
|
|
39
|
+
"vitest/prefer-equality-matcher": "warn",
|
|
40
|
+
"vitest/prefer-expect-resolves": "warn",
|
|
41
|
+
"vitest/prefer-expect-type-of": "warn",
|
|
42
|
+
"vitest/prefer-hooks-in-order": "warn",
|
|
43
|
+
"vitest/prefer-hooks-on-top": "warn",
|
|
44
|
+
"vitest/prefer-import-in-mock": "warn",
|
|
45
|
+
"vitest/prefer-importing-vitest-globals": "warn",
|
|
46
|
+
"vitest/prefer-lowercase-title": "warn",
|
|
33
47
|
"vitest/prefer-mock-promise-shorthand": "warn",
|
|
34
|
-
"vitest/no-interpolation-in-snapshots": "error",
|
|
35
48
|
"vitest/prefer-snapshot-hint": ["warn", "always"],
|
|
36
|
-
"vitest/
|
|
37
|
-
"vitest/
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
49
|
+
"vitest/prefer-spy-on": "warn",
|
|
50
|
+
"vitest/prefer-strict-boolean-matchers": "warn",
|
|
51
|
+
"vitest/prefer-strict-equal": "warn",
|
|
52
|
+
"vitest/prefer-to-be": "warn",
|
|
53
|
+
"vitest/prefer-to-be-falsy": "warn",
|
|
54
|
+
"vitest/prefer-to-be-object": "warn",
|
|
55
|
+
"vitest/prefer-to-be-truthy": "warn",
|
|
56
|
+
"vitest/prefer-to-contain": "warn",
|
|
57
|
+
"vitest/prefer-to-have-length": "warn",
|
|
58
|
+
"vitest/prefer-todo": "warn",
|
|
59
|
+
"vitest/prefer-vi-mocked": "warn",
|
|
60
|
+
"vitest/require-awaited-expect-poll": "error",
|
|
61
|
+
"vitest/require-hook": "error",
|
|
62
|
+
"vitest/require-local-test-context-for-concurrent-snapshots": "error",
|
|
63
|
+
"vitest/require-mock-type-parameters": "warn",
|
|
64
|
+
"vitest/require-to-throw-message": "warn",
|
|
65
|
+
"vitest/valid-describe-callback": "error",
|
|
66
|
+
"vitest/valid-expect": "error",
|
|
67
|
+
"vitest/valid-expect-in-promise": "error",
|
|
68
|
+
"vitest/warn-todo": "error",
|
|
69
|
+
"vitest/valid-title": ["error", { allowArguments: true }]
|
|
41
70
|
};
|
|
42
71
|
}
|
|
43
72
|
|