@w5s/eslint-config 3.2.0 → 3.3.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/index.d.ts +366 -153
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/package.json +40 -14
- package/src/typegen/jsdoc.d.ts +27 -0
- package/src/typegen/node.d.ts +14 -0
- package/src/typegen/style.d.ts +23 -6
- package/src/typegen/test.d.ts +111 -5
- package/src/typegen/ts.d.ts +30 -0
- package/src/typegen/unicorn.d.ts +161 -142
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@w5s/eslint-config",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.3.0",
|
|
4
4
|
"description": "ESLint configuration presets",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -21,10 +21,6 @@
|
|
|
21
21
|
"type": "module",
|
|
22
22
|
"exports": {
|
|
23
23
|
".": {
|
|
24
|
-
"require": {
|
|
25
|
-
"types": "./dist/index.d.cts",
|
|
26
|
-
"default": "./dist/index.cjs"
|
|
27
|
-
},
|
|
28
24
|
"import": {
|
|
29
25
|
"types": "./dist/index.d.ts",
|
|
30
26
|
"default": "./dist/index.js"
|
|
@@ -42,26 +38,55 @@
|
|
|
42
38
|
"!**/__tests__/**"
|
|
43
39
|
],
|
|
44
40
|
"scripts": {
|
|
45
|
-
"
|
|
41
|
+
"build": "npx run-p \"build:*\"",
|
|
42
|
+
"build:tsc": "node --experimental-strip-types scripts/typegen.ts && tsup",
|
|
43
|
+
"clean": "npx run-p \"clean:*\"",
|
|
44
|
+
"clean:tsc": "rm -rf dist",
|
|
45
|
+
"docs": "node ../../markdown.mjs",
|
|
46
|
+
"format": "npx run-p \"format:*\"",
|
|
47
|
+
"format:src": "eslint . --fix",
|
|
48
|
+
"lint": "npx run-p \"lint:*\"",
|
|
49
|
+
"lint:src": "eslint .",
|
|
50
|
+
"postpack": "npx clean-package restore",
|
|
51
|
+
"prepack": "npx clean-package",
|
|
52
|
+
"prepare": "npx run-p \"prepare:*\"",
|
|
53
|
+
"prepare:empty": ":",
|
|
54
|
+
"prepublishOnly": "npm run clean;npm run build",
|
|
55
|
+
"spellcheck": "cspell --no-progress '**'",
|
|
56
|
+
"test": "npx run-p \"test:*\"",
|
|
57
|
+
"test:script": "scripts/test",
|
|
58
|
+
"test_:rule-coverage": "eslint-find-rules --unused"
|
|
46
59
|
},
|
|
47
60
|
"dependencies": {
|
|
48
61
|
"@stylistic/eslint-plugin": "^5.0.0",
|
|
49
62
|
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
50
63
|
"@typescript-eslint/parser": "^8.0.0",
|
|
51
64
|
"@vitest/eslint-plugin": "^1.0.0",
|
|
52
|
-
"@w5s/dev": "^3.1.
|
|
53
|
-
"@w5s/prettier-config": "^3.0.
|
|
65
|
+
"@w5s/dev": "^3.1.2",
|
|
66
|
+
"@w5s/prettier-config": "^3.0.4",
|
|
54
67
|
"eslint-plugin-import": "^2.25.0",
|
|
55
|
-
"eslint-plugin-jsdoc": "^
|
|
68
|
+
"eslint-plugin-jsdoc": "^62.0.0",
|
|
56
69
|
"eslint-plugin-jsonc": "^2.4.0",
|
|
57
70
|
"eslint-plugin-n": "^17.0.0",
|
|
58
|
-
"eslint-plugin-unicorn": "^
|
|
59
|
-
"eslint-plugin-yml": "^
|
|
71
|
+
"eslint-plugin-unicorn": "^62.0.0",
|
|
72
|
+
"eslint-plugin-yml": "^2.0.0",
|
|
60
73
|
"find-up": "^8.0.0",
|
|
61
|
-
"globals": "^
|
|
74
|
+
"globals": "^17.0.0",
|
|
62
75
|
"jsonc-eslint-parser": "^2.0.0",
|
|
63
76
|
"parse-gitignore": "^2.0.0",
|
|
64
|
-
"yaml-eslint-parser": "^
|
|
77
|
+
"yaml-eslint-parser": "^2.0.0"
|
|
78
|
+
},
|
|
79
|
+
"devDependencies": {
|
|
80
|
+
"@types/eslint": "9.6.1",
|
|
81
|
+
"@types/parse-gitignore": "1.0.2",
|
|
82
|
+
"@types/react": "19.2.14",
|
|
83
|
+
"@typescript-eslint/parser": "8.55.0",
|
|
84
|
+
"eslint": "9.39.2",
|
|
85
|
+
"eslint-find-rules": "5.0.0",
|
|
86
|
+
"eslint-typegen": "2.3.0",
|
|
87
|
+
"react": "19.2.4",
|
|
88
|
+
"vite": "7.3.1",
|
|
89
|
+
"vitest": "4.0.18"
|
|
65
90
|
},
|
|
66
91
|
"peerDependencies": {
|
|
67
92
|
"eslint": "9.x",
|
|
@@ -75,6 +100,7 @@
|
|
|
75
100
|
"optional": true
|
|
76
101
|
}
|
|
77
102
|
},
|
|
103
|
+
"clean-package": "../../clean-package.config.mjs",
|
|
78
104
|
"engines": {
|
|
79
105
|
"node": ">=20.0.0"
|
|
80
106
|
},
|
|
@@ -82,5 +108,5 @@
|
|
|
82
108
|
"access": "public"
|
|
83
109
|
},
|
|
84
110
|
"sideEffect": false,
|
|
85
|
-
"gitHead": "
|
|
111
|
+
"gitHead": "1339ba15448ca7c3aea9f0afa0ece486f4693961"
|
|
86
112
|
}
|
package/src/typegen/jsdoc.d.ts
CHANGED
|
@@ -264,6 +264,11 @@ export interface RuleOptions {
|
|
|
264
264
|
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-property-type.md#repos-sticky-header
|
|
265
265
|
*/
|
|
266
266
|
'jsdoc/require-property-type'?: Linter.RuleEntry<[]>
|
|
267
|
+
/**
|
|
268
|
+
* Requires that Promise rejections are documented with `@rejects` tags.
|
|
269
|
+
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-rejects.md#repos-sticky-header
|
|
270
|
+
*/
|
|
271
|
+
'jsdoc/require-rejects'?: Linter.RuleEntry<JsdocRequireRejects>
|
|
267
272
|
/**
|
|
268
273
|
* Requires that returns are documented with `@returns`.
|
|
269
274
|
* @see https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-returns.md#repos-sticky-header
|
|
@@ -412,6 +417,8 @@ type JsdocCheckExamples = []|[{
|
|
|
412
417
|
// ----- jsdoc/check-indentation -----
|
|
413
418
|
type JsdocCheckIndentation = []|[{
|
|
414
419
|
|
|
420
|
+
allowIndentedSections?: boolean
|
|
421
|
+
|
|
415
422
|
excludeTags?: string[]
|
|
416
423
|
}]
|
|
417
424
|
// ----- jsdoc/check-line-alignment -----
|
|
@@ -797,6 +804,8 @@ type JsdocRequireHyphenBeforeParamDescription = []|[("always" | "never")]|[("alw
|
|
|
797
804
|
// ----- jsdoc/require-jsdoc -----
|
|
798
805
|
type JsdocRequireJsdoc = []|[{
|
|
799
806
|
|
|
807
|
+
checkAllFunctionExpressions?: boolean
|
|
808
|
+
|
|
800
809
|
checkConstructors?: boolean
|
|
801
810
|
|
|
802
811
|
checkGetters?: (boolean | "no-setter")
|
|
@@ -917,6 +926,16 @@ type JsdocRequireParamType = []|[{
|
|
|
917
926
|
|
|
918
927
|
setDefaultDestructuredRootType?: boolean
|
|
919
928
|
}]
|
|
929
|
+
// ----- jsdoc/require-rejects -----
|
|
930
|
+
type JsdocRequireRejects = []|[{
|
|
931
|
+
|
|
932
|
+
contexts?: (string | {
|
|
933
|
+
comment?: string
|
|
934
|
+
context?: string
|
|
935
|
+
})[]
|
|
936
|
+
|
|
937
|
+
exemptedBy?: string[]
|
|
938
|
+
}]
|
|
920
939
|
// ----- jsdoc/require-returns -----
|
|
921
940
|
type JsdocRequireReturns = []|[{
|
|
922
941
|
|
|
@@ -1041,6 +1060,10 @@ type JsdocSortTags = []|[{
|
|
|
1041
1060
|
|
|
1042
1061
|
reportTagGroupSpacing?: boolean
|
|
1043
1062
|
|
|
1063
|
+
tagExceptions?: {
|
|
1064
|
+
[k: string]: number
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1044
1067
|
tagSequence?: {
|
|
1045
1068
|
|
|
1046
1069
|
tags?: string[]
|
|
@@ -1133,6 +1156,8 @@ type JsdocTypeFormatting = []|[{
|
|
|
1133
1156
|
|
|
1134
1157
|
objectFieldSeparatorTrailingPunctuation?: boolean
|
|
1135
1158
|
|
|
1159
|
+
objectTypeBracketSpacing?: string
|
|
1160
|
+
|
|
1136
1161
|
parameterDefaultValueSpacing?: string
|
|
1137
1162
|
|
|
1138
1163
|
postMethodNameSpacing?: string
|
|
@@ -1143,6 +1168,8 @@ type JsdocTypeFormatting = []|[{
|
|
|
1143
1168
|
|
|
1144
1169
|
stringQuotes?: ("double" | "single")
|
|
1145
1170
|
|
|
1171
|
+
trailingPunctuationMultilineOnly?: boolean
|
|
1172
|
+
|
|
1146
1173
|
typeBracketSpacing?: string
|
|
1147
1174
|
|
|
1148
1175
|
unionSpacing?: string
|
package/src/typegen/node.d.ts
CHANGED
|
@@ -165,6 +165,11 @@ export interface RuleOptions {
|
|
|
165
165
|
* @see https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/prefer-global/console.md
|
|
166
166
|
*/
|
|
167
167
|
'node/prefer-global/console'?: Linter.RuleEntry<NodePreferGlobalConsole>
|
|
168
|
+
/**
|
|
169
|
+
* enforce either `crypto` or `require("crypto").webcrypto`
|
|
170
|
+
* @see https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/prefer-global/crypto.md
|
|
171
|
+
*/
|
|
172
|
+
'node/prefer-global/crypto'?: Linter.RuleEntry<NodePreferGlobalCrypto>
|
|
168
173
|
/**
|
|
169
174
|
* enforce either `process` or `require("process")`
|
|
170
175
|
* @see https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/prefer-global/process.md
|
|
@@ -180,6 +185,11 @@ export interface RuleOptions {
|
|
|
180
185
|
* @see https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/prefer-global/text-encoder.md
|
|
181
186
|
*/
|
|
182
187
|
'node/prefer-global/text-encoder'?: Linter.RuleEntry<NodePreferGlobalTextEncoder>
|
|
188
|
+
/**
|
|
189
|
+
* enforce either global timer functions or `require("timers")`
|
|
190
|
+
* @see https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/prefer-global/timers.md
|
|
191
|
+
*/
|
|
192
|
+
'node/prefer-global/timers'?: Linter.RuleEntry<NodePreferGlobalTimers>
|
|
183
193
|
/**
|
|
184
194
|
* enforce either `URL` or `require("url").URL`
|
|
185
195
|
* @see https://github.com/eslint-community/eslint-plugin-n/blob/HEAD/docs/rules/prefer-global/url.md
|
|
@@ -488,12 +498,16 @@ type NodeNoUnsupportedFeaturesNodeBuiltins = []|[{
|
|
|
488
498
|
type NodePreferGlobalBuffer = []|[("always" | "never")]
|
|
489
499
|
// ----- node/prefer-global/console -----
|
|
490
500
|
type NodePreferGlobalConsole = []|[("always" | "never")]
|
|
501
|
+
// ----- node/prefer-global/crypto -----
|
|
502
|
+
type NodePreferGlobalCrypto = []|[("always" | "never")]
|
|
491
503
|
// ----- node/prefer-global/process -----
|
|
492
504
|
type NodePreferGlobalProcess = []|[("always" | "never")]
|
|
493
505
|
// ----- node/prefer-global/text-decoder -----
|
|
494
506
|
type NodePreferGlobalTextDecoder = []|[("always" | "never")]
|
|
495
507
|
// ----- node/prefer-global/text-encoder -----
|
|
496
508
|
type NodePreferGlobalTextEncoder = []|[("always" | "never")]
|
|
509
|
+
// ----- node/prefer-global/timers -----
|
|
510
|
+
type NodePreferGlobalTimers = []|[("always" | "never")]
|
|
497
511
|
// ----- node/prefer-global/url -----
|
|
498
512
|
type NodePreferGlobalUrl = []|[("always" | "never")]
|
|
499
513
|
// ----- node/prefer-global/url-search-params -----
|
package/src/typegen/style.d.ts
CHANGED
|
@@ -79,6 +79,11 @@ export interface RuleOptions {
|
|
|
79
79
|
* @see https://eslint.style/rules/eol-last
|
|
80
80
|
*/
|
|
81
81
|
'style/eol-last'?: Linter.RuleEntry<StyleEolLast>
|
|
82
|
+
/**
|
|
83
|
+
* Enforce consistent line break styles for JSX props
|
|
84
|
+
* @see https://eslint.style/rules/jsx-props-style
|
|
85
|
+
*/
|
|
86
|
+
'style/exp-jsx-props-style'?: Linter.RuleEntry<StyleExpJsxPropsStyle>
|
|
82
87
|
/**
|
|
83
88
|
* Enforce consistent spacing and line break styles inside brackets.
|
|
84
89
|
* @see https://eslint.style/rules/list-style
|
|
@@ -214,6 +219,7 @@ export interface RuleOptions {
|
|
|
214
219
|
/**
|
|
215
220
|
* Enforce props alphabetical sorting
|
|
216
221
|
* @see https://eslint.style/rules/jsx-sort-props
|
|
222
|
+
* @deprecated
|
|
217
223
|
*/
|
|
218
224
|
'style/jsx-sort-props'?: Linter.RuleEntry<StyleJsxSortProps>
|
|
219
225
|
/**
|
|
@@ -675,15 +681,25 @@ type StyleCurlyNewline = []|[(("always" | "never") | {
|
|
|
675
681
|
type StyleDotLocation = []|[("object" | "property")]
|
|
676
682
|
// ----- style/eol-last -----
|
|
677
683
|
type StyleEolLast = []|[("always" | "never" | "unix" | "windows")]
|
|
684
|
+
// ----- style/exp-jsx-props-style -----
|
|
685
|
+
type StyleExpJsxPropsStyle = []|[{
|
|
686
|
+
singleLine?: {
|
|
687
|
+
maxItems?: number
|
|
688
|
+
}
|
|
689
|
+
multiLine?: {
|
|
690
|
+
minItems?: number
|
|
691
|
+
maxItemsPerLine?: number
|
|
692
|
+
}
|
|
693
|
+
}]
|
|
678
694
|
// ----- style/exp-list-style -----
|
|
679
695
|
type StyleExpListStyle = []|[{
|
|
680
696
|
singleLine?: _StyleExpListStyle_SingleLineConfig
|
|
681
697
|
multiLine?: _StyleExpListStyle_MultiLineConfig
|
|
682
698
|
overrides?: {
|
|
699
|
+
"()"?: _StyleExpListStyle_BaseConfig
|
|
683
700
|
"[]"?: _StyleExpListStyle_BaseConfig
|
|
684
701
|
"{}"?: _StyleExpListStyle_BaseConfig
|
|
685
702
|
"<>"?: _StyleExpListStyle_BaseConfig
|
|
686
|
-
"()"?: _StyleExpListStyle_BaseConfig
|
|
687
703
|
ArrayExpression?: _StyleExpListStyle_BaseConfig
|
|
688
704
|
ArrayPattern?: _StyleExpListStyle_BaseConfig
|
|
689
705
|
ArrowFunctionExpression?: _StyleExpListStyle_BaseConfig
|
|
@@ -691,21 +707,22 @@ type StyleExpListStyle = []|[{
|
|
|
691
707
|
ExportNamedDeclaration?: _StyleExpListStyle_BaseConfig
|
|
692
708
|
FunctionDeclaration?: _StyleExpListStyle_BaseConfig
|
|
693
709
|
FunctionExpression?: _StyleExpListStyle_BaseConfig
|
|
694
|
-
|
|
710
|
+
IfStatement?: _StyleExpListStyle_BaseConfig
|
|
695
711
|
ImportAttributes?: _StyleExpListStyle_BaseConfig
|
|
712
|
+
ImportDeclaration?: _StyleExpListStyle_BaseConfig
|
|
713
|
+
JSONArrayExpression?: _StyleExpListStyle_BaseConfig
|
|
714
|
+
JSONObjectExpression?: _StyleExpListStyle_BaseConfig
|
|
696
715
|
NewExpression?: _StyleExpListStyle_BaseConfig
|
|
697
716
|
ObjectExpression?: _StyleExpListStyle_BaseConfig
|
|
698
717
|
ObjectPattern?: _StyleExpListStyle_BaseConfig
|
|
699
718
|
TSDeclareFunction?: _StyleExpListStyle_BaseConfig
|
|
719
|
+
TSEnumBody?: _StyleExpListStyle_BaseConfig
|
|
700
720
|
TSFunctionType?: _StyleExpListStyle_BaseConfig
|
|
701
721
|
TSInterfaceBody?: _StyleExpListStyle_BaseConfig
|
|
702
|
-
TSEnumBody?: _StyleExpListStyle_BaseConfig
|
|
703
722
|
TSTupleType?: _StyleExpListStyle_BaseConfig
|
|
704
723
|
TSTypeLiteral?: _StyleExpListStyle_BaseConfig
|
|
705
724
|
TSTypeParameterDeclaration?: _StyleExpListStyle_BaseConfig
|
|
706
725
|
TSTypeParameterInstantiation?: _StyleExpListStyle_BaseConfig
|
|
707
|
-
JSONArrayExpression?: _StyleExpListStyle_BaseConfig
|
|
708
|
-
JSONObjectExpression?: _StyleExpListStyle_BaseConfig
|
|
709
726
|
}
|
|
710
727
|
}]
|
|
711
728
|
interface _StyleExpListStyle_SingleLineConfig {
|
|
@@ -1718,7 +1735,7 @@ type StyleTypeAnnotationSpacing = []|[{
|
|
|
1718
1735
|
after?: boolean
|
|
1719
1736
|
overrides?: {
|
|
1720
1737
|
colon?: _StyleTypeAnnotationSpacing_SpacingConfig
|
|
1721
|
-
arrow?: _StyleTypeAnnotationSpacing_SpacingConfig
|
|
1738
|
+
arrow?: ("ignore" | _StyleTypeAnnotationSpacing_SpacingConfig)
|
|
1722
1739
|
variable?: _StyleTypeAnnotationSpacing_SpacingConfig
|
|
1723
1740
|
parameter?: _StyleTypeAnnotationSpacing_SpacingConfig
|
|
1724
1741
|
property?: _StyleTypeAnnotationSpacing_SpacingConfig
|
package/src/typegen/test.d.ts
CHANGED
|
@@ -10,7 +10,12 @@ declare module 'eslint' {
|
|
|
10
10
|
|
|
11
11
|
export interface RuleOptions {
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
13
|
+
* enforce using `.each` or `.for` consistently
|
|
14
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/consistent-each-for.md
|
|
15
|
+
*/
|
|
16
|
+
'test/consistent-each-for'?: Linter.RuleEntry<TestConsistentEachFor>
|
|
17
|
+
/**
|
|
18
|
+
* require test file pattern
|
|
14
19
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/consistent-test-filename.md
|
|
15
20
|
*/
|
|
16
21
|
'test/consistent-test-filename'?: Linter.RuleEntry<TestConsistentTestFilename>
|
|
@@ -19,11 +24,21 @@ export interface RuleOptions {
|
|
|
19
24
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/consistent-test-it.md
|
|
20
25
|
*/
|
|
21
26
|
'test/consistent-test-it'?: Linter.RuleEntry<TestConsistentTestIt>
|
|
27
|
+
/**
|
|
28
|
+
* enforce using vitest or vi but not both
|
|
29
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/consistent-vitest-vi.md
|
|
30
|
+
*/
|
|
31
|
+
'test/consistent-vitest-vi'?: Linter.RuleEntry<TestConsistentVitestVi>
|
|
22
32
|
/**
|
|
23
33
|
* enforce having expectation in test body
|
|
24
34
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/expect-expect.md
|
|
25
35
|
*/
|
|
26
36
|
'test/expect-expect'?: Linter.RuleEntry<TestExpectExpect>
|
|
37
|
+
/**
|
|
38
|
+
* enforce hoisted APIs to be on top of the file
|
|
39
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/hoisted-apis-on-top.md
|
|
40
|
+
*/
|
|
41
|
+
'test/hoisted-apis-on-top'?: Linter.RuleEntry<[]>
|
|
27
42
|
/**
|
|
28
43
|
* enforce a maximum number of expect per test
|
|
29
44
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/max-expects.md
|
|
@@ -48,7 +63,7 @@ export interface RuleOptions {
|
|
|
48
63
|
* disallow conditional expects
|
|
49
64
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-conditional-expect.md
|
|
50
65
|
*/
|
|
51
|
-
'test/no-conditional-expect'?: Linter.RuleEntry<
|
|
66
|
+
'test/no-conditional-expect'?: Linter.RuleEntry<TestNoConditionalExpect>
|
|
52
67
|
/**
|
|
53
68
|
* disallow conditional tests
|
|
54
69
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-conditional-in-test.md
|
|
@@ -95,6 +110,11 @@ export interface RuleOptions {
|
|
|
95
110
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-import-node-test.md
|
|
96
111
|
*/
|
|
97
112
|
'test/no-import-node-test'?: Linter.RuleEntry<[]>
|
|
113
|
+
/**
|
|
114
|
+
* disallow importing Vitest globals
|
|
115
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-importing-vitest-globals.md
|
|
116
|
+
*/
|
|
117
|
+
'test/no-importing-vitest-globals'?: Linter.RuleEntry<[]>
|
|
98
118
|
/**
|
|
99
119
|
* disallow string interpolation in snapshots
|
|
100
120
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-interpolation-in-snapshots.md
|
|
@@ -126,7 +146,7 @@ export interface RuleOptions {
|
|
|
126
146
|
*/
|
|
127
147
|
'test/no-standalone-expect'?: Linter.RuleEntry<TestNoStandaloneExpect>
|
|
128
148
|
/**
|
|
129
|
-
* disallow using `
|
|
149
|
+
* disallow using the `f` and `x` prefixes in favour of `.only` and `.skip`
|
|
130
150
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-test-prefixes.md
|
|
131
151
|
*/
|
|
132
152
|
'test/no-test-prefixes'?: Linter.RuleEntry<[]>
|
|
@@ -135,6 +155,11 @@ export interface RuleOptions {
|
|
|
135
155
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-test-return-statement.md
|
|
136
156
|
*/
|
|
137
157
|
'test/no-test-return-statement'?: Linter.RuleEntry<[]>
|
|
158
|
+
/**
|
|
159
|
+
* Disallow unnecessary async function wrapper for expected promises
|
|
160
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-unneeded-async-expect-function.md
|
|
161
|
+
*/
|
|
162
|
+
'test/no-unneeded-async-expect-function'?: Linter.RuleEntry<[]>
|
|
138
163
|
/**
|
|
139
164
|
* Enforce padding around `afterAll` blocks
|
|
140
165
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-after-all-blocks.md
|
|
@@ -175,6 +200,21 @@ export interface RuleOptions {
|
|
|
175
200
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-test-blocks.md
|
|
176
201
|
*/
|
|
177
202
|
'test/padding-around-test-blocks'?: Linter.RuleEntry<[]>
|
|
203
|
+
/**
|
|
204
|
+
* Prefer `toHaveBeenCalledExactlyOnceWith` over `toHaveBeenCalledOnce` and `toHaveBeenCalledWith`
|
|
205
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-called-exactly-once-with.md
|
|
206
|
+
*/
|
|
207
|
+
'test/prefer-called-exactly-once-with'?: Linter.RuleEntry<[]>
|
|
208
|
+
/**
|
|
209
|
+
* enforce using `toBeCalledOnce()` or `toHaveBeenCalledOnce()`
|
|
210
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-called-once.md
|
|
211
|
+
*/
|
|
212
|
+
'test/prefer-called-once'?: Linter.RuleEntry<[]>
|
|
213
|
+
/**
|
|
214
|
+
* enforce using `toBeCalledTimes(1)` or `toHaveBeenCalledTimes(1)`
|
|
215
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-called-times.md
|
|
216
|
+
*/
|
|
217
|
+
'test/prefer-called-times'?: Linter.RuleEntry<[]>
|
|
178
218
|
/**
|
|
179
219
|
* enforce using `toBeCalledWith()` or `toHaveBeenCalledWith()`
|
|
180
220
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-called-with.md
|
|
@@ -185,13 +225,18 @@ export interface RuleOptions {
|
|
|
185
225
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-comparison-matcher.md
|
|
186
226
|
*/
|
|
187
227
|
'test/prefer-comparison-matcher'?: Linter.RuleEntry<[]>
|
|
228
|
+
/**
|
|
229
|
+
* enforce using a function as a describe title over an equivalent string
|
|
230
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-describe-function-title.md
|
|
231
|
+
*/
|
|
232
|
+
'test/prefer-describe-function-title'?: Linter.RuleEntry<[]>
|
|
188
233
|
/**
|
|
189
234
|
* enforce using `each` rather than manual loops
|
|
190
235
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-each.md
|
|
191
236
|
*/
|
|
192
237
|
'test/prefer-each'?: Linter.RuleEntry<[]>
|
|
193
238
|
/**
|
|
194
|
-
* enforce using the built-in
|
|
239
|
+
* enforce using the built-in equality matchers
|
|
195
240
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-equality-matcher.md
|
|
196
241
|
*/
|
|
197
242
|
'test/prefer-equality-matcher'?: Linter.RuleEntry<[]>
|
|
@@ -205,6 +250,11 @@ export interface RuleOptions {
|
|
|
205
250
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-expect-resolves.md
|
|
206
251
|
*/
|
|
207
252
|
'test/prefer-expect-resolves'?: Linter.RuleEntry<[]>
|
|
253
|
+
/**
|
|
254
|
+
* enforce using `expectTypeOf` instead of `expect(typeof ...)`
|
|
255
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-expect-type-of.md
|
|
256
|
+
*/
|
|
257
|
+
'test/prefer-expect-type-of'?: Linter.RuleEntry<[]>
|
|
208
258
|
/**
|
|
209
259
|
* enforce having hooks in consistent order
|
|
210
260
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-hooks-in-order.md
|
|
@@ -215,6 +265,16 @@ export interface RuleOptions {
|
|
|
215
265
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-hooks-on-top.md
|
|
216
266
|
*/
|
|
217
267
|
'test/prefer-hooks-on-top'?: Linter.RuleEntry<[]>
|
|
268
|
+
/**
|
|
269
|
+
* prefer dynamic import in mock
|
|
270
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-import-in-mock.md
|
|
271
|
+
*/
|
|
272
|
+
'test/prefer-import-in-mock'?: Linter.RuleEntry<TestPreferImportInMock>
|
|
273
|
+
/**
|
|
274
|
+
* enforce importing Vitest globals
|
|
275
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-importing-vitest-globals.md
|
|
276
|
+
*/
|
|
277
|
+
'test/prefer-importing-vitest-globals'?: Linter.RuleEntry<[]>
|
|
218
278
|
/**
|
|
219
279
|
* enforce lowercase titles
|
|
220
280
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-lowercase-title.md
|
|
@@ -225,6 +285,11 @@ export interface RuleOptions {
|
|
|
225
285
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-mock-promise-shorthand.md
|
|
226
286
|
*/
|
|
227
287
|
'test/prefer-mock-promise-shorthand'?: Linter.RuleEntry<[]>
|
|
288
|
+
/**
|
|
289
|
+
* Prefer mock return shorthands
|
|
290
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-mock-return-shorthand.md
|
|
291
|
+
*/
|
|
292
|
+
'test/prefer-mock-return-shorthand'?: Linter.RuleEntry<[]>
|
|
228
293
|
/**
|
|
229
294
|
* enforce including a hint with external snapshots
|
|
230
295
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-snapshot-hint.md
|
|
@@ -270,6 +335,11 @@ export interface RuleOptions {
|
|
|
270
335
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-contain.md
|
|
271
336
|
*/
|
|
272
337
|
'test/prefer-to-contain'?: Linter.RuleEntry<[]>
|
|
338
|
+
/**
|
|
339
|
+
* Suggest using `toHaveBeenCalledTimes()`
|
|
340
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-have-been-called-times.md
|
|
341
|
+
*/
|
|
342
|
+
'test/prefer-to-have-been-called-times'?: Linter.RuleEntry<[]>
|
|
273
343
|
/**
|
|
274
344
|
* enforce using toHaveLength()
|
|
275
345
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-have-length.md
|
|
@@ -285,6 +355,11 @@ export interface RuleOptions {
|
|
|
285
355
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-vi-mocked.md
|
|
286
356
|
*/
|
|
287
357
|
'test/prefer-vi-mocked'?: Linter.RuleEntry<[]>
|
|
358
|
+
/**
|
|
359
|
+
* ensure that every `expect.poll` call is awaited
|
|
360
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-awaited-expect-poll.md
|
|
361
|
+
*/
|
|
362
|
+
'test/require-awaited-expect-poll'?: Linter.RuleEntry<[]>
|
|
288
363
|
/**
|
|
289
364
|
* require setup and teardown to be within a hook
|
|
290
365
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-hook.md
|
|
@@ -300,6 +375,11 @@ export interface RuleOptions {
|
|
|
300
375
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-mock-type-parameters.md
|
|
301
376
|
*/
|
|
302
377
|
'test/require-mock-type-parameters'?: Linter.RuleEntry<TestRequireMockTypeParameters>
|
|
378
|
+
/**
|
|
379
|
+
* require tests to declare a timeout
|
|
380
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-test-timeout.md
|
|
381
|
+
*/
|
|
382
|
+
'test/require-test-timeout'?: Linter.RuleEntry<[]>
|
|
303
383
|
/**
|
|
304
384
|
* require toThrow() to be called with an error message
|
|
305
385
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-to-throw-message.md
|
|
@@ -330,9 +410,21 @@ export interface RuleOptions {
|
|
|
330
410
|
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/valid-title.md
|
|
331
411
|
*/
|
|
332
412
|
'test/valid-title'?: Linter.RuleEntry<TestValidTitle>
|
|
413
|
+
/**
|
|
414
|
+
* disallow `.todo` usage
|
|
415
|
+
* @see https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/warn-todo.md
|
|
416
|
+
*/
|
|
417
|
+
'test/warn-todo'?: Linter.RuleEntry<[]>
|
|
333
418
|
}
|
|
334
419
|
|
|
335
420
|
/* ======= Declarations ======= */
|
|
421
|
+
// ----- test/consistent-each-for -----
|
|
422
|
+
type TestConsistentEachFor = []|[{
|
|
423
|
+
test?: ("each" | "for")
|
|
424
|
+
it?: ("each" | "for")
|
|
425
|
+
describe?: ("each" | "for")
|
|
426
|
+
suite?: ("each" | "for")
|
|
427
|
+
}]
|
|
336
428
|
// ----- test/consistent-test-filename -----
|
|
337
429
|
type TestConsistentTestFilename = []|[{
|
|
338
430
|
pattern?: string
|
|
@@ -343,6 +435,10 @@ type TestConsistentTestIt = []|[{
|
|
|
343
435
|
fn?: ("test" | "it")
|
|
344
436
|
withinDescribe?: ("test" | "it")
|
|
345
437
|
}]
|
|
438
|
+
// ----- test/consistent-vitest-vi -----
|
|
439
|
+
type TestConsistentVitestVi = []|[{
|
|
440
|
+
fn?: ("vi" | "vitest")
|
|
441
|
+
}]
|
|
346
442
|
// ----- test/expect-expect -----
|
|
347
443
|
type TestExpectExpect = []|[{
|
|
348
444
|
assertFunctionNames?: string[]
|
|
@@ -356,13 +452,19 @@ type TestMaxExpects = []|[{
|
|
|
356
452
|
type TestMaxNestedDescribe = []|[{
|
|
357
453
|
max?: number
|
|
358
454
|
}]
|
|
455
|
+
// ----- test/no-conditional-expect -----
|
|
456
|
+
type TestNoConditionalExpect = []|[{
|
|
457
|
+
|
|
458
|
+
expectAssertions?: boolean
|
|
459
|
+
}]
|
|
359
460
|
// ----- test/no-focused-tests -----
|
|
360
461
|
type TestNoFocusedTests = []|[{
|
|
361
462
|
fixable?: boolean
|
|
362
463
|
}]
|
|
363
464
|
// ----- test/no-hooks -----
|
|
364
465
|
type TestNoHooks = []|[{
|
|
365
|
-
|
|
466
|
+
|
|
467
|
+
allow?: ("beforeAll" | "beforeEach" | "afterAll" | "afterEach")[]
|
|
366
468
|
}]
|
|
367
469
|
// ----- test/no-large-snapshots -----
|
|
368
470
|
type TestNoLargeSnapshots = []|[{
|
|
@@ -390,6 +492,10 @@ type TestPreferExpectAssertions = []|[{
|
|
|
390
492
|
onlyFunctionsWithExpectInLoop?: boolean
|
|
391
493
|
onlyFunctionsWithExpectInCallback?: boolean
|
|
392
494
|
}]
|
|
495
|
+
// ----- test/prefer-import-in-mock -----
|
|
496
|
+
type TestPreferImportInMock = []|[{
|
|
497
|
+
fixable?: boolean
|
|
498
|
+
}]
|
|
393
499
|
// ----- test/prefer-lowercase-title -----
|
|
394
500
|
type TestPreferLowercaseTitle = []|[{
|
|
395
501
|
ignore?: ("describe" | "test" | "it")[]
|
package/src/typegen/ts.d.ts
CHANGED
|
@@ -452,6 +452,11 @@ export interface RuleOptions {
|
|
|
452
452
|
* @see https://typescript-eslint.io/rules/no-unused-expressions
|
|
453
453
|
*/
|
|
454
454
|
'ts/no-unused-expressions'?: Linter.RuleEntry<TsNoUnusedExpressions>
|
|
455
|
+
/**
|
|
456
|
+
* Disallow unused private class members
|
|
457
|
+
* @see https://typescript-eslint.io/rules/no-unused-private-class-members
|
|
458
|
+
*/
|
|
459
|
+
'ts/no-unused-private-class-members'?: Linter.RuleEntry<[]>
|
|
455
460
|
/**
|
|
456
461
|
* Disallow unused variables
|
|
457
462
|
* @see https://typescript-eslint.io/rules/no-unused-vars
|
|
@@ -467,6 +472,11 @@ export interface RuleOptions {
|
|
|
467
472
|
* @see https://typescript-eslint.io/rules/no-useless-constructor
|
|
468
473
|
*/
|
|
469
474
|
'ts/no-useless-constructor'?: Linter.RuleEntry<[]>
|
|
475
|
+
/**
|
|
476
|
+
* Disallow default values that will never be used
|
|
477
|
+
* @see https://typescript-eslint.io/rules/no-useless-default-assignment
|
|
478
|
+
*/
|
|
479
|
+
'ts/no-useless-default-assignment'?: Linter.RuleEntry<TsNoUselessDefaultAssignment>
|
|
470
480
|
/**
|
|
471
481
|
* Disallow empty exports that don't change anything in a module file
|
|
472
482
|
* @see https://typescript-eslint.io/rules/no-useless-empty-export
|
|
@@ -640,6 +650,11 @@ export interface RuleOptions {
|
|
|
640
650
|
* @see https://typescript-eslint.io/rules/strict-boolean-expressions
|
|
641
651
|
*/
|
|
642
652
|
'ts/strict-boolean-expressions'?: Linter.RuleEntry<TsStrictBooleanExpressions>
|
|
653
|
+
/**
|
|
654
|
+
* Disallow passing a value-returning function in a position accepting a void function
|
|
655
|
+
* @see https://typescript-eslint.io/rules/strict-void-return
|
|
656
|
+
*/
|
|
657
|
+
'ts/strict-void-return'?: Linter.RuleEntry<TsStrictVoidReturn>
|
|
643
658
|
/**
|
|
644
659
|
* Require switch-case statements to be exhaustive
|
|
645
660
|
* @see https://typescript-eslint.io/rules/switch-exhaustiveness-check
|
|
@@ -1534,6 +1549,11 @@ type TsNoUnusedVars = []|[(("all" | "local") | {
|
|
|
1534
1549
|
|
|
1535
1550
|
destructuredArrayIgnorePattern?: string
|
|
1536
1551
|
|
|
1552
|
+
enableAutofixRemoval?: {
|
|
1553
|
+
|
|
1554
|
+
imports?: boolean
|
|
1555
|
+
}
|
|
1556
|
+
|
|
1537
1557
|
ignoreClassWithStaticInitBlock?: boolean
|
|
1538
1558
|
|
|
1539
1559
|
ignoreRestSiblings?: boolean
|
|
@@ -1563,6 +1583,11 @@ type TsNoUseBeforeDefine = []|[("nofunc" | {
|
|
|
1563
1583
|
|
|
1564
1584
|
variables?: boolean
|
|
1565
1585
|
})]
|
|
1586
|
+
// ----- ts/no-useless-default-assignment -----
|
|
1587
|
+
type TsNoUselessDefaultAssignment = []|[{
|
|
1588
|
+
|
|
1589
|
+
allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing?: boolean
|
|
1590
|
+
}]
|
|
1566
1591
|
// ----- ts/no-var-requires -----
|
|
1567
1592
|
type TsNoVarRequires = []|[{
|
|
1568
1593
|
|
|
@@ -1818,6 +1843,11 @@ type TsStrictBooleanExpressions = []|[{
|
|
|
1818
1843
|
|
|
1819
1844
|
allowString?: boolean
|
|
1820
1845
|
}]
|
|
1846
|
+
// ----- ts/strict-void-return -----
|
|
1847
|
+
type TsStrictVoidReturn = []|[{
|
|
1848
|
+
|
|
1849
|
+
allowReturnAny?: boolean
|
|
1850
|
+
}]
|
|
1821
1851
|
// ----- ts/switch-exhaustiveness-check -----
|
|
1822
1852
|
type TsSwitchExhaustivenessCheck = []|[{
|
|
1823
1853
|
|