@vitest/eslint-plugin 1.1.23 → 1.1.24

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.cjs CHANGED
@@ -23,7 +23,7 @@ function _interopNamespaceCompat(e) {
23
23
  const path__namespace = /*#__PURE__*/_interopNamespaceCompat(path);
24
24
  const ts__default = /*#__PURE__*/_interopDefaultCompat(ts);
25
25
 
26
- const version = "1.1.22";
26
+ const version = "1.1.23";
27
27
 
28
28
  function createEslintRule(rule) {
29
29
  const createRule = utils.ESLintUtils.RuleCreator(
@@ -4884,7 +4884,6 @@ const plugin = {
4884
4884
  name: "vitest",
4885
4885
  version
4886
4886
  },
4887
- configs: {},
4888
4887
  rules: {
4889
4888
  [RULE_NAME$Z]: lowerCaseTitle,
4890
4889
  [RULE_NAME$Y]: maxNestedDescribe,
@@ -4970,42 +4969,46 @@ const plugin = {
4970
4969
  onTestFinished: true
4971
4970
  }
4972
4971
  }
4973
- }
4974
- };
4975
- plugin.configs = {
4976
- "legacy-recommended": createConfigLegacy(recommended),
4977
- "legacy-all": createConfigLegacy(allRules),
4978
- "recommended": {
4979
- plugins: {
4980
- ["vitest"]: plugin
4981
- },
4982
- rules: createConfig(recommended)
4983
4972
  },
4984
- "all": {
4985
- plugins: {
4986
- ["vitest"]: plugin
4973
+ configs: {
4974
+ "legacy-recommended": createConfigLegacy(recommended),
4975
+ "legacy-all": createConfigLegacy(allRules),
4976
+ "recommended": {
4977
+ plugins: {
4978
+ get vitest() {
4979
+ return plugin;
4980
+ }
4981
+ },
4982
+ rules: createConfig(recommended)
4987
4983
  },
4988
- rules: createConfig(allRules)
4989
- },
4990
- "env": {
4991
- languageOptions: {
4992
- globals: {
4993
- suite: "writable",
4994
- test: "writable",
4995
- describe: "writable",
4996
- it: "writable",
4997
- expectTypeOf: "writable",
4998
- assertType: "writable",
4999
- expect: "writable",
5000
- assert: "writable",
5001
- vitest: "writable",
5002
- vi: "writable",
5003
- beforeAll: "writable",
5004
- afterAll: "writable",
5005
- beforeEach: "writable",
5006
- afterEach: "writable",
5007
- onTestFailed: "writable",
5008
- onTestFinished: "writable"
4984
+ "all": {
4985
+ plugins: {
4986
+ get vitest() {
4987
+ return plugin;
4988
+ }
4989
+ },
4990
+ rules: createConfig(allRules)
4991
+ },
4992
+ "env": {
4993
+ languageOptions: {
4994
+ globals: {
4995
+ suite: "writable",
4996
+ test: "writable",
4997
+ describe: "writable",
4998
+ it: "writable",
4999
+ expectTypeOf: "writable",
5000
+ assertType: "writable",
5001
+ expect: "writable",
5002
+ assert: "writable",
5003
+ vitest: "writable",
5004
+ vi: "writable",
5005
+ beforeAll: "writable",
5006
+ afterAll: "writable",
5007
+ beforeEach: "writable",
5008
+ afterEach: "writable",
5009
+ onTestFailed: "writable",
5010
+ onTestFinished: "writable"
5011
+ }
5009
5012
  }
5010
5013
  }
5011
5014
  }
package/dist/index.d.cts CHANGED
@@ -1,14 +1,213 @@
1
- import { Linter, RuleModule } from '@typescript-eslint/utils/ts-eslint';
1
+ import * as eslint from 'eslint';
2
+ import { ESLint } from 'eslint';
2
3
 
3
- interface VitestPlugin extends Linter.Plugin {
4
+ declare const plugin: {
4
5
  meta: {
5
6
  name: string;
6
7
  version: string;
7
8
  };
8
- rules: Record<string, RuleModule<any, any>>;
9
- configs: Record<string, any>;
10
- environments?: Record<string, any>;
11
- }
12
- declare const plugin: VitestPlugin;
9
+ rules: {
10
+ "prefer-lowercase-title": eslint.Rule.RuleModule;
11
+ "max-nested-describe": eslint.Rule.RuleModule;
12
+ "no-identical-title": eslint.Rule.RuleModule;
13
+ "no-focused-tests": eslint.Rule.RuleModule;
14
+ "no-conditional-tests": eslint.Rule.RuleModule;
15
+ "expect-expect": eslint.Rule.RuleModule;
16
+ "consistent-test-it": eslint.Rule.RuleModule;
17
+ "prefer-to-be": eslint.Rule.RuleModule;
18
+ "no-hooks": eslint.Rule.RuleModule;
19
+ "no-restricted-vi-methods": eslint.Rule.RuleModule;
20
+ "consistent-test-filename": eslint.Rule.RuleModule;
21
+ "max-expects": eslint.Rule.RuleModule;
22
+ "no-alias-methods": eslint.Rule.RuleModule;
23
+ "no-commented-out-tests": eslint.Rule.RuleModule;
24
+ "no-conditional-expect": eslint.Rule.RuleModule;
25
+ "no-conditional-in-test": eslint.Rule.RuleModule;
26
+ "no-disabled-tests": eslint.Rule.RuleModule;
27
+ "no-done-callback": eslint.Rule.RuleModule;
28
+ "no-duplicate-hooks": eslint.Rule.RuleModule;
29
+ "no-large-snapshots": eslint.Rule.RuleModule;
30
+ "no-interpolation-in-snapshots": eslint.Rule.RuleModule;
31
+ "no-mocks-import": eslint.Rule.RuleModule;
32
+ "no-restricted-matchers": eslint.Rule.RuleModule;
33
+ "no-standalone-expect": eslint.Rule.RuleModule;
34
+ "no-test-prefixes": eslint.Rule.RuleModule;
35
+ "no-test-return-statement": eslint.Rule.RuleModule;
36
+ "no-import-node-test": eslint.Rule.RuleModule;
37
+ "prefer-called-with": eslint.Rule.RuleModule;
38
+ "valid-title": eslint.Rule.RuleModule;
39
+ "valid-expect": eslint.Rule.RuleModule;
40
+ "prefer-to-be-falsy": eslint.Rule.RuleModule;
41
+ "prefer-to-be-object": eslint.Rule.RuleModule;
42
+ "prefer-to-be-truthy": eslint.Rule.RuleModule;
43
+ "prefer-to-have-length": eslint.Rule.RuleModule;
44
+ "prefer-equality-matcher": eslint.Rule.RuleModule;
45
+ "prefer-strict-equal": eslint.Rule.RuleModule;
46
+ "prefer-expect-resolves": eslint.Rule.RuleModule;
47
+ "prefer-each": eslint.Rule.RuleModule;
48
+ "prefer-hooks-on-top": eslint.Rule.RuleModule;
49
+ "prefer-hooks-in-order": eslint.Rule.RuleModule;
50
+ "require-local-test-context-for-concurrent-snapshots": eslint.Rule.RuleModule;
51
+ "prefer-mock-promise-shorthand": eslint.Rule.RuleModule;
52
+ "prefer-vi-mocked": eslint.Rule.RuleModule;
53
+ "prefer-snapshot-hint": eslint.Rule.RuleModule;
54
+ "valid-describe-callback": eslint.Rule.RuleModule;
55
+ "require-top-level-describe": eslint.Rule.RuleModule;
56
+ "require-to-throw-message": eslint.Rule.RuleModule;
57
+ "require-hook": eslint.Rule.RuleModule;
58
+ "prefer-todo": eslint.Rule.RuleModule;
59
+ "prefer-spy-on": eslint.Rule.RuleModule;
60
+ "prefer-comparison-matcher": eslint.Rule.RuleModule;
61
+ "prefer-to-contain": eslint.Rule.RuleModule;
62
+ "prefer-expect-assertions": eslint.Rule.RuleModule;
63
+ "padding-around-after-all-blocks": eslint.Rule.RuleModule;
64
+ "padding-around-after-each-blocks": eslint.Rule.RuleModule;
65
+ "padding-around-all": eslint.Rule.RuleModule;
66
+ "padding-around-before-all-blocks": eslint.Rule.RuleModule;
67
+ "padding-around-before-each-blocks": eslint.Rule.RuleModule;
68
+ "padding-around-describe-blocks": eslint.Rule.RuleModule;
69
+ "padding-around-expect-groups": eslint.Rule.RuleModule;
70
+ "padding-around-test-blocks": eslint.Rule.RuleModule;
71
+ "valid-expect-in-promise": eslint.Rule.RuleModule;
72
+ };
73
+ environments: {
74
+ env: {
75
+ globals: {
76
+ suite: true;
77
+ test: true;
78
+ describe: true;
79
+ it: true;
80
+ expectTypeOf: true;
81
+ assertType: true;
82
+ expect: true;
83
+ assert: true;
84
+ vitest: true;
85
+ vi: true;
86
+ beforeAll: true;
87
+ afterAll: true;
88
+ beforeEach: true;
89
+ afterEach: true;
90
+ onTestFailed: true;
91
+ onTestFinished: true;
92
+ };
93
+ };
94
+ };
95
+ configs: {
96
+ 'legacy-recommended': {
97
+ plugins: string[];
98
+ rules: {};
99
+ };
100
+ 'legacy-all': {
101
+ plugins: string[];
102
+ rules: {};
103
+ };
104
+ recommended: {
105
+ plugins: {
106
+ readonly vitest: ESLint.Plugin;
107
+ };
108
+ rules: {
109
+ readonly "vitest/expect-expect": "error";
110
+ readonly "vitest/no-identical-title": "error";
111
+ readonly "vitest/no-commented-out-tests": "error";
112
+ readonly "vitest/valid-title": "error";
113
+ readonly "vitest/valid-expect": "error";
114
+ readonly "vitest/valid-describe-callback": "error";
115
+ readonly "vitest/require-local-test-context-for-concurrent-snapshots": "error";
116
+ readonly "vitest/no-import-node-test": "error";
117
+ };
118
+ };
119
+ all: {
120
+ plugins: {
121
+ readonly vitest: ESLint.Plugin;
122
+ };
123
+ rules: {
124
+ readonly "vitest/prefer-lowercase-title": "warn";
125
+ readonly "vitest/max-nested-describe": "warn";
126
+ readonly "vitest/no-focused-tests": "warn";
127
+ readonly "vitest/no-conditional-tests": "warn";
128
+ readonly "vitest/consistent-test-it": "warn";
129
+ readonly "vitest/no-hooks": "warn";
130
+ readonly "vitest/no-restricted-vi-methods": "warn";
131
+ readonly "vitest/consistent-test-filename": "warn";
132
+ readonly "vitest/max-expects": "warn";
133
+ readonly "vitest/no-alias-methods": "warn";
134
+ readonly "vitest/no-conditional-expect": "warn";
135
+ readonly "vitest/no-conditional-in-test": "warn";
136
+ readonly "vitest/no-disabled-tests": "warn";
137
+ readonly "vitest/no-done-callback": "warn";
138
+ readonly "vitest/no-duplicate-hooks": "warn";
139
+ readonly "vitest/no-large-snapshots": "warn";
140
+ readonly "vitest/no-interpolation-in-snapshots": "warn";
141
+ readonly "vitest/no-mocks-import": "warn";
142
+ readonly "vitest/no-restricted-matchers": "warn";
143
+ readonly "vitest/no-standalone-expect": "warn";
144
+ readonly "vitest/no-test-prefixes": "warn";
145
+ readonly "vitest/no-test-return-statement": "warn";
146
+ readonly "vitest/prefer-called-with": "warn";
147
+ readonly "vitest/prefer-to-be-falsy": "warn";
148
+ readonly "vitest/prefer-to-be-object": "warn";
149
+ readonly "vitest/prefer-to-be-truthy": "warn";
150
+ readonly "vitest/prefer-to-have-length": "warn";
151
+ readonly "vitest/prefer-equality-matcher": "warn";
152
+ readonly "vitest/prefer-strict-equal": "warn";
153
+ readonly "vitest/prefer-expect-resolves": "warn";
154
+ readonly "vitest/prefer-each": "warn";
155
+ readonly "vitest/prefer-hooks-on-top": "warn";
156
+ readonly "vitest/prefer-hooks-in-order": "warn";
157
+ readonly "vitest/prefer-mock-promise-shorthand": "warn";
158
+ readonly "vitest/prefer-vi-mocked": "warn";
159
+ readonly "vitest/prefer-snapshot-hint": "warn";
160
+ readonly "vitest/require-top-level-describe": "warn";
161
+ readonly "vitest/require-to-throw-message": "warn";
162
+ readonly "vitest/require-hook": "warn";
163
+ readonly "vitest/prefer-todo": "warn";
164
+ readonly "vitest/prefer-spy-on": "warn";
165
+ readonly "vitest/prefer-comparison-matcher": "warn";
166
+ readonly "vitest/prefer-to-contain": "warn";
167
+ readonly "vitest/prefer-expect-assertions": "warn";
168
+ readonly "vitest/prefer-to-be": "warn";
169
+ readonly "vitest/padding-around-after-all-blocks": "warn";
170
+ readonly "vitest/padding-around-after-each-blocks": "warn";
171
+ readonly "vitest/padding-around-all": "warn";
172
+ readonly "vitest/padding-around-before-all-blocks": "warn";
173
+ readonly "vitest/padding-around-before-each-blocks": "warn";
174
+ readonly "vitest/padding-around-describe-blocks": "warn";
175
+ readonly "vitest/padding-around-expect-groups": "warn";
176
+ readonly "vitest/padding-around-test-blocks": "warn";
177
+ readonly "vitest/valid-expect-in-promise": "warn";
178
+ readonly "vitest/expect-expect": "warn";
179
+ readonly "vitest/no-identical-title": "warn";
180
+ readonly "vitest/no-commented-out-tests": "warn";
181
+ readonly "vitest/valid-title": "warn";
182
+ readonly "vitest/valid-expect": "warn";
183
+ readonly "vitest/valid-describe-callback": "warn";
184
+ readonly "vitest/require-local-test-context-for-concurrent-snapshots": "warn";
185
+ readonly "vitest/no-import-node-test": "warn";
186
+ };
187
+ };
188
+ env: {
189
+ languageOptions: {
190
+ globals: {
191
+ suite: "writable";
192
+ test: "writable";
193
+ describe: "writable";
194
+ it: "writable";
195
+ expectTypeOf: "writable";
196
+ assertType: "writable";
197
+ expect: "writable";
198
+ assert: "writable";
199
+ vitest: "writable";
200
+ vi: "writable";
201
+ beforeAll: "writable";
202
+ afterAll: "writable";
203
+ beforeEach: "writable";
204
+ afterEach: "writable";
205
+ onTestFailed: "writable";
206
+ onTestFinished: "writable";
207
+ };
208
+ };
209
+ };
210
+ };
211
+ };
13
212
 
14
213
  export { plugin as default };
package/dist/index.d.mts CHANGED
@@ -1,14 +1,213 @@
1
- import { Linter, RuleModule } from '@typescript-eslint/utils/ts-eslint';
1
+ import * as eslint from 'eslint';
2
+ import { ESLint } from 'eslint';
2
3
 
3
- interface VitestPlugin extends Linter.Plugin {
4
+ declare const plugin: {
4
5
  meta: {
5
6
  name: string;
6
7
  version: string;
7
8
  };
8
- rules: Record<string, RuleModule<any, any>>;
9
- configs: Record<string, any>;
10
- environments?: Record<string, any>;
11
- }
12
- declare const plugin: VitestPlugin;
9
+ rules: {
10
+ "prefer-lowercase-title": eslint.Rule.RuleModule;
11
+ "max-nested-describe": eslint.Rule.RuleModule;
12
+ "no-identical-title": eslint.Rule.RuleModule;
13
+ "no-focused-tests": eslint.Rule.RuleModule;
14
+ "no-conditional-tests": eslint.Rule.RuleModule;
15
+ "expect-expect": eslint.Rule.RuleModule;
16
+ "consistent-test-it": eslint.Rule.RuleModule;
17
+ "prefer-to-be": eslint.Rule.RuleModule;
18
+ "no-hooks": eslint.Rule.RuleModule;
19
+ "no-restricted-vi-methods": eslint.Rule.RuleModule;
20
+ "consistent-test-filename": eslint.Rule.RuleModule;
21
+ "max-expects": eslint.Rule.RuleModule;
22
+ "no-alias-methods": eslint.Rule.RuleModule;
23
+ "no-commented-out-tests": eslint.Rule.RuleModule;
24
+ "no-conditional-expect": eslint.Rule.RuleModule;
25
+ "no-conditional-in-test": eslint.Rule.RuleModule;
26
+ "no-disabled-tests": eslint.Rule.RuleModule;
27
+ "no-done-callback": eslint.Rule.RuleModule;
28
+ "no-duplicate-hooks": eslint.Rule.RuleModule;
29
+ "no-large-snapshots": eslint.Rule.RuleModule;
30
+ "no-interpolation-in-snapshots": eslint.Rule.RuleModule;
31
+ "no-mocks-import": eslint.Rule.RuleModule;
32
+ "no-restricted-matchers": eslint.Rule.RuleModule;
33
+ "no-standalone-expect": eslint.Rule.RuleModule;
34
+ "no-test-prefixes": eslint.Rule.RuleModule;
35
+ "no-test-return-statement": eslint.Rule.RuleModule;
36
+ "no-import-node-test": eslint.Rule.RuleModule;
37
+ "prefer-called-with": eslint.Rule.RuleModule;
38
+ "valid-title": eslint.Rule.RuleModule;
39
+ "valid-expect": eslint.Rule.RuleModule;
40
+ "prefer-to-be-falsy": eslint.Rule.RuleModule;
41
+ "prefer-to-be-object": eslint.Rule.RuleModule;
42
+ "prefer-to-be-truthy": eslint.Rule.RuleModule;
43
+ "prefer-to-have-length": eslint.Rule.RuleModule;
44
+ "prefer-equality-matcher": eslint.Rule.RuleModule;
45
+ "prefer-strict-equal": eslint.Rule.RuleModule;
46
+ "prefer-expect-resolves": eslint.Rule.RuleModule;
47
+ "prefer-each": eslint.Rule.RuleModule;
48
+ "prefer-hooks-on-top": eslint.Rule.RuleModule;
49
+ "prefer-hooks-in-order": eslint.Rule.RuleModule;
50
+ "require-local-test-context-for-concurrent-snapshots": eslint.Rule.RuleModule;
51
+ "prefer-mock-promise-shorthand": eslint.Rule.RuleModule;
52
+ "prefer-vi-mocked": eslint.Rule.RuleModule;
53
+ "prefer-snapshot-hint": eslint.Rule.RuleModule;
54
+ "valid-describe-callback": eslint.Rule.RuleModule;
55
+ "require-top-level-describe": eslint.Rule.RuleModule;
56
+ "require-to-throw-message": eslint.Rule.RuleModule;
57
+ "require-hook": eslint.Rule.RuleModule;
58
+ "prefer-todo": eslint.Rule.RuleModule;
59
+ "prefer-spy-on": eslint.Rule.RuleModule;
60
+ "prefer-comparison-matcher": eslint.Rule.RuleModule;
61
+ "prefer-to-contain": eslint.Rule.RuleModule;
62
+ "prefer-expect-assertions": eslint.Rule.RuleModule;
63
+ "padding-around-after-all-blocks": eslint.Rule.RuleModule;
64
+ "padding-around-after-each-blocks": eslint.Rule.RuleModule;
65
+ "padding-around-all": eslint.Rule.RuleModule;
66
+ "padding-around-before-all-blocks": eslint.Rule.RuleModule;
67
+ "padding-around-before-each-blocks": eslint.Rule.RuleModule;
68
+ "padding-around-describe-blocks": eslint.Rule.RuleModule;
69
+ "padding-around-expect-groups": eslint.Rule.RuleModule;
70
+ "padding-around-test-blocks": eslint.Rule.RuleModule;
71
+ "valid-expect-in-promise": eslint.Rule.RuleModule;
72
+ };
73
+ environments: {
74
+ env: {
75
+ globals: {
76
+ suite: true;
77
+ test: true;
78
+ describe: true;
79
+ it: true;
80
+ expectTypeOf: true;
81
+ assertType: true;
82
+ expect: true;
83
+ assert: true;
84
+ vitest: true;
85
+ vi: true;
86
+ beforeAll: true;
87
+ afterAll: true;
88
+ beforeEach: true;
89
+ afterEach: true;
90
+ onTestFailed: true;
91
+ onTestFinished: true;
92
+ };
93
+ };
94
+ };
95
+ configs: {
96
+ 'legacy-recommended': {
97
+ plugins: string[];
98
+ rules: {};
99
+ };
100
+ 'legacy-all': {
101
+ plugins: string[];
102
+ rules: {};
103
+ };
104
+ recommended: {
105
+ plugins: {
106
+ readonly vitest: ESLint.Plugin;
107
+ };
108
+ rules: {
109
+ readonly "vitest/expect-expect": "error";
110
+ readonly "vitest/no-identical-title": "error";
111
+ readonly "vitest/no-commented-out-tests": "error";
112
+ readonly "vitest/valid-title": "error";
113
+ readonly "vitest/valid-expect": "error";
114
+ readonly "vitest/valid-describe-callback": "error";
115
+ readonly "vitest/require-local-test-context-for-concurrent-snapshots": "error";
116
+ readonly "vitest/no-import-node-test": "error";
117
+ };
118
+ };
119
+ all: {
120
+ plugins: {
121
+ readonly vitest: ESLint.Plugin;
122
+ };
123
+ rules: {
124
+ readonly "vitest/prefer-lowercase-title": "warn";
125
+ readonly "vitest/max-nested-describe": "warn";
126
+ readonly "vitest/no-focused-tests": "warn";
127
+ readonly "vitest/no-conditional-tests": "warn";
128
+ readonly "vitest/consistent-test-it": "warn";
129
+ readonly "vitest/no-hooks": "warn";
130
+ readonly "vitest/no-restricted-vi-methods": "warn";
131
+ readonly "vitest/consistent-test-filename": "warn";
132
+ readonly "vitest/max-expects": "warn";
133
+ readonly "vitest/no-alias-methods": "warn";
134
+ readonly "vitest/no-conditional-expect": "warn";
135
+ readonly "vitest/no-conditional-in-test": "warn";
136
+ readonly "vitest/no-disabled-tests": "warn";
137
+ readonly "vitest/no-done-callback": "warn";
138
+ readonly "vitest/no-duplicate-hooks": "warn";
139
+ readonly "vitest/no-large-snapshots": "warn";
140
+ readonly "vitest/no-interpolation-in-snapshots": "warn";
141
+ readonly "vitest/no-mocks-import": "warn";
142
+ readonly "vitest/no-restricted-matchers": "warn";
143
+ readonly "vitest/no-standalone-expect": "warn";
144
+ readonly "vitest/no-test-prefixes": "warn";
145
+ readonly "vitest/no-test-return-statement": "warn";
146
+ readonly "vitest/prefer-called-with": "warn";
147
+ readonly "vitest/prefer-to-be-falsy": "warn";
148
+ readonly "vitest/prefer-to-be-object": "warn";
149
+ readonly "vitest/prefer-to-be-truthy": "warn";
150
+ readonly "vitest/prefer-to-have-length": "warn";
151
+ readonly "vitest/prefer-equality-matcher": "warn";
152
+ readonly "vitest/prefer-strict-equal": "warn";
153
+ readonly "vitest/prefer-expect-resolves": "warn";
154
+ readonly "vitest/prefer-each": "warn";
155
+ readonly "vitest/prefer-hooks-on-top": "warn";
156
+ readonly "vitest/prefer-hooks-in-order": "warn";
157
+ readonly "vitest/prefer-mock-promise-shorthand": "warn";
158
+ readonly "vitest/prefer-vi-mocked": "warn";
159
+ readonly "vitest/prefer-snapshot-hint": "warn";
160
+ readonly "vitest/require-top-level-describe": "warn";
161
+ readonly "vitest/require-to-throw-message": "warn";
162
+ readonly "vitest/require-hook": "warn";
163
+ readonly "vitest/prefer-todo": "warn";
164
+ readonly "vitest/prefer-spy-on": "warn";
165
+ readonly "vitest/prefer-comparison-matcher": "warn";
166
+ readonly "vitest/prefer-to-contain": "warn";
167
+ readonly "vitest/prefer-expect-assertions": "warn";
168
+ readonly "vitest/prefer-to-be": "warn";
169
+ readonly "vitest/padding-around-after-all-blocks": "warn";
170
+ readonly "vitest/padding-around-after-each-blocks": "warn";
171
+ readonly "vitest/padding-around-all": "warn";
172
+ readonly "vitest/padding-around-before-all-blocks": "warn";
173
+ readonly "vitest/padding-around-before-each-blocks": "warn";
174
+ readonly "vitest/padding-around-describe-blocks": "warn";
175
+ readonly "vitest/padding-around-expect-groups": "warn";
176
+ readonly "vitest/padding-around-test-blocks": "warn";
177
+ readonly "vitest/valid-expect-in-promise": "warn";
178
+ readonly "vitest/expect-expect": "warn";
179
+ readonly "vitest/no-identical-title": "warn";
180
+ readonly "vitest/no-commented-out-tests": "warn";
181
+ readonly "vitest/valid-title": "warn";
182
+ readonly "vitest/valid-expect": "warn";
183
+ readonly "vitest/valid-describe-callback": "warn";
184
+ readonly "vitest/require-local-test-context-for-concurrent-snapshots": "warn";
185
+ readonly "vitest/no-import-node-test": "warn";
186
+ };
187
+ };
188
+ env: {
189
+ languageOptions: {
190
+ globals: {
191
+ suite: "writable";
192
+ test: "writable";
193
+ describe: "writable";
194
+ it: "writable";
195
+ expectTypeOf: "writable";
196
+ assertType: "writable";
197
+ expect: "writable";
198
+ assert: "writable";
199
+ vitest: "writable";
200
+ vi: "writable";
201
+ beforeAll: "writable";
202
+ afterAll: "writable";
203
+ beforeEach: "writable";
204
+ afterEach: "writable";
205
+ onTestFailed: "writable";
206
+ onTestFinished: "writable";
207
+ };
208
+ };
209
+ };
210
+ };
211
+ };
13
212
 
14
213
  export { plugin as default };
package/dist/index.d.ts CHANGED
@@ -1,14 +1,213 @@
1
- import { Linter, RuleModule } from '@typescript-eslint/utils/ts-eslint';
1
+ import * as eslint from 'eslint';
2
+ import { ESLint } from 'eslint';
2
3
 
3
- interface VitestPlugin extends Linter.Plugin {
4
+ declare const plugin: {
4
5
  meta: {
5
6
  name: string;
6
7
  version: string;
7
8
  };
8
- rules: Record<string, RuleModule<any, any>>;
9
- configs: Record<string, any>;
10
- environments?: Record<string, any>;
11
- }
12
- declare const plugin: VitestPlugin;
9
+ rules: {
10
+ "prefer-lowercase-title": eslint.Rule.RuleModule;
11
+ "max-nested-describe": eslint.Rule.RuleModule;
12
+ "no-identical-title": eslint.Rule.RuleModule;
13
+ "no-focused-tests": eslint.Rule.RuleModule;
14
+ "no-conditional-tests": eslint.Rule.RuleModule;
15
+ "expect-expect": eslint.Rule.RuleModule;
16
+ "consistent-test-it": eslint.Rule.RuleModule;
17
+ "prefer-to-be": eslint.Rule.RuleModule;
18
+ "no-hooks": eslint.Rule.RuleModule;
19
+ "no-restricted-vi-methods": eslint.Rule.RuleModule;
20
+ "consistent-test-filename": eslint.Rule.RuleModule;
21
+ "max-expects": eslint.Rule.RuleModule;
22
+ "no-alias-methods": eslint.Rule.RuleModule;
23
+ "no-commented-out-tests": eslint.Rule.RuleModule;
24
+ "no-conditional-expect": eslint.Rule.RuleModule;
25
+ "no-conditional-in-test": eslint.Rule.RuleModule;
26
+ "no-disabled-tests": eslint.Rule.RuleModule;
27
+ "no-done-callback": eslint.Rule.RuleModule;
28
+ "no-duplicate-hooks": eslint.Rule.RuleModule;
29
+ "no-large-snapshots": eslint.Rule.RuleModule;
30
+ "no-interpolation-in-snapshots": eslint.Rule.RuleModule;
31
+ "no-mocks-import": eslint.Rule.RuleModule;
32
+ "no-restricted-matchers": eslint.Rule.RuleModule;
33
+ "no-standalone-expect": eslint.Rule.RuleModule;
34
+ "no-test-prefixes": eslint.Rule.RuleModule;
35
+ "no-test-return-statement": eslint.Rule.RuleModule;
36
+ "no-import-node-test": eslint.Rule.RuleModule;
37
+ "prefer-called-with": eslint.Rule.RuleModule;
38
+ "valid-title": eslint.Rule.RuleModule;
39
+ "valid-expect": eslint.Rule.RuleModule;
40
+ "prefer-to-be-falsy": eslint.Rule.RuleModule;
41
+ "prefer-to-be-object": eslint.Rule.RuleModule;
42
+ "prefer-to-be-truthy": eslint.Rule.RuleModule;
43
+ "prefer-to-have-length": eslint.Rule.RuleModule;
44
+ "prefer-equality-matcher": eslint.Rule.RuleModule;
45
+ "prefer-strict-equal": eslint.Rule.RuleModule;
46
+ "prefer-expect-resolves": eslint.Rule.RuleModule;
47
+ "prefer-each": eslint.Rule.RuleModule;
48
+ "prefer-hooks-on-top": eslint.Rule.RuleModule;
49
+ "prefer-hooks-in-order": eslint.Rule.RuleModule;
50
+ "require-local-test-context-for-concurrent-snapshots": eslint.Rule.RuleModule;
51
+ "prefer-mock-promise-shorthand": eslint.Rule.RuleModule;
52
+ "prefer-vi-mocked": eslint.Rule.RuleModule;
53
+ "prefer-snapshot-hint": eslint.Rule.RuleModule;
54
+ "valid-describe-callback": eslint.Rule.RuleModule;
55
+ "require-top-level-describe": eslint.Rule.RuleModule;
56
+ "require-to-throw-message": eslint.Rule.RuleModule;
57
+ "require-hook": eslint.Rule.RuleModule;
58
+ "prefer-todo": eslint.Rule.RuleModule;
59
+ "prefer-spy-on": eslint.Rule.RuleModule;
60
+ "prefer-comparison-matcher": eslint.Rule.RuleModule;
61
+ "prefer-to-contain": eslint.Rule.RuleModule;
62
+ "prefer-expect-assertions": eslint.Rule.RuleModule;
63
+ "padding-around-after-all-blocks": eslint.Rule.RuleModule;
64
+ "padding-around-after-each-blocks": eslint.Rule.RuleModule;
65
+ "padding-around-all": eslint.Rule.RuleModule;
66
+ "padding-around-before-all-blocks": eslint.Rule.RuleModule;
67
+ "padding-around-before-each-blocks": eslint.Rule.RuleModule;
68
+ "padding-around-describe-blocks": eslint.Rule.RuleModule;
69
+ "padding-around-expect-groups": eslint.Rule.RuleModule;
70
+ "padding-around-test-blocks": eslint.Rule.RuleModule;
71
+ "valid-expect-in-promise": eslint.Rule.RuleModule;
72
+ };
73
+ environments: {
74
+ env: {
75
+ globals: {
76
+ suite: true;
77
+ test: true;
78
+ describe: true;
79
+ it: true;
80
+ expectTypeOf: true;
81
+ assertType: true;
82
+ expect: true;
83
+ assert: true;
84
+ vitest: true;
85
+ vi: true;
86
+ beforeAll: true;
87
+ afterAll: true;
88
+ beforeEach: true;
89
+ afterEach: true;
90
+ onTestFailed: true;
91
+ onTestFinished: true;
92
+ };
93
+ };
94
+ };
95
+ configs: {
96
+ 'legacy-recommended': {
97
+ plugins: string[];
98
+ rules: {};
99
+ };
100
+ 'legacy-all': {
101
+ plugins: string[];
102
+ rules: {};
103
+ };
104
+ recommended: {
105
+ plugins: {
106
+ readonly vitest: ESLint.Plugin;
107
+ };
108
+ rules: {
109
+ readonly "vitest/expect-expect": "error";
110
+ readonly "vitest/no-identical-title": "error";
111
+ readonly "vitest/no-commented-out-tests": "error";
112
+ readonly "vitest/valid-title": "error";
113
+ readonly "vitest/valid-expect": "error";
114
+ readonly "vitest/valid-describe-callback": "error";
115
+ readonly "vitest/require-local-test-context-for-concurrent-snapshots": "error";
116
+ readonly "vitest/no-import-node-test": "error";
117
+ };
118
+ };
119
+ all: {
120
+ plugins: {
121
+ readonly vitest: ESLint.Plugin;
122
+ };
123
+ rules: {
124
+ readonly "vitest/prefer-lowercase-title": "warn";
125
+ readonly "vitest/max-nested-describe": "warn";
126
+ readonly "vitest/no-focused-tests": "warn";
127
+ readonly "vitest/no-conditional-tests": "warn";
128
+ readonly "vitest/consistent-test-it": "warn";
129
+ readonly "vitest/no-hooks": "warn";
130
+ readonly "vitest/no-restricted-vi-methods": "warn";
131
+ readonly "vitest/consistent-test-filename": "warn";
132
+ readonly "vitest/max-expects": "warn";
133
+ readonly "vitest/no-alias-methods": "warn";
134
+ readonly "vitest/no-conditional-expect": "warn";
135
+ readonly "vitest/no-conditional-in-test": "warn";
136
+ readonly "vitest/no-disabled-tests": "warn";
137
+ readonly "vitest/no-done-callback": "warn";
138
+ readonly "vitest/no-duplicate-hooks": "warn";
139
+ readonly "vitest/no-large-snapshots": "warn";
140
+ readonly "vitest/no-interpolation-in-snapshots": "warn";
141
+ readonly "vitest/no-mocks-import": "warn";
142
+ readonly "vitest/no-restricted-matchers": "warn";
143
+ readonly "vitest/no-standalone-expect": "warn";
144
+ readonly "vitest/no-test-prefixes": "warn";
145
+ readonly "vitest/no-test-return-statement": "warn";
146
+ readonly "vitest/prefer-called-with": "warn";
147
+ readonly "vitest/prefer-to-be-falsy": "warn";
148
+ readonly "vitest/prefer-to-be-object": "warn";
149
+ readonly "vitest/prefer-to-be-truthy": "warn";
150
+ readonly "vitest/prefer-to-have-length": "warn";
151
+ readonly "vitest/prefer-equality-matcher": "warn";
152
+ readonly "vitest/prefer-strict-equal": "warn";
153
+ readonly "vitest/prefer-expect-resolves": "warn";
154
+ readonly "vitest/prefer-each": "warn";
155
+ readonly "vitest/prefer-hooks-on-top": "warn";
156
+ readonly "vitest/prefer-hooks-in-order": "warn";
157
+ readonly "vitest/prefer-mock-promise-shorthand": "warn";
158
+ readonly "vitest/prefer-vi-mocked": "warn";
159
+ readonly "vitest/prefer-snapshot-hint": "warn";
160
+ readonly "vitest/require-top-level-describe": "warn";
161
+ readonly "vitest/require-to-throw-message": "warn";
162
+ readonly "vitest/require-hook": "warn";
163
+ readonly "vitest/prefer-todo": "warn";
164
+ readonly "vitest/prefer-spy-on": "warn";
165
+ readonly "vitest/prefer-comparison-matcher": "warn";
166
+ readonly "vitest/prefer-to-contain": "warn";
167
+ readonly "vitest/prefer-expect-assertions": "warn";
168
+ readonly "vitest/prefer-to-be": "warn";
169
+ readonly "vitest/padding-around-after-all-blocks": "warn";
170
+ readonly "vitest/padding-around-after-each-blocks": "warn";
171
+ readonly "vitest/padding-around-all": "warn";
172
+ readonly "vitest/padding-around-before-all-blocks": "warn";
173
+ readonly "vitest/padding-around-before-each-blocks": "warn";
174
+ readonly "vitest/padding-around-describe-blocks": "warn";
175
+ readonly "vitest/padding-around-expect-groups": "warn";
176
+ readonly "vitest/padding-around-test-blocks": "warn";
177
+ readonly "vitest/valid-expect-in-promise": "warn";
178
+ readonly "vitest/expect-expect": "warn";
179
+ readonly "vitest/no-identical-title": "warn";
180
+ readonly "vitest/no-commented-out-tests": "warn";
181
+ readonly "vitest/valid-title": "warn";
182
+ readonly "vitest/valid-expect": "warn";
183
+ readonly "vitest/valid-describe-callback": "warn";
184
+ readonly "vitest/require-local-test-context-for-concurrent-snapshots": "warn";
185
+ readonly "vitest/no-import-node-test": "warn";
186
+ };
187
+ };
188
+ env: {
189
+ languageOptions: {
190
+ globals: {
191
+ suite: "writable";
192
+ test: "writable";
193
+ describe: "writable";
194
+ it: "writable";
195
+ expectTypeOf: "writable";
196
+ assertType: "writable";
197
+ expect: "writable";
198
+ assert: "writable";
199
+ vitest: "writable";
200
+ vi: "writable";
201
+ beforeAll: "writable";
202
+ afterAll: "writable";
203
+ beforeEach: "writable";
204
+ afterEach: "writable";
205
+ onTestFailed: "writable";
206
+ onTestFinished: "writable";
207
+ };
208
+ };
209
+ };
210
+ };
211
+ };
13
212
 
14
213
  export { plugin as default };
package/dist/index.mjs CHANGED
@@ -4,7 +4,7 @@ import { isAbsolute, posix } from 'node:path';
4
4
  import ts from 'typescript';
5
5
  import { createRequire } from 'node:module';
6
6
 
7
- const version = "1.1.22";
7
+ const version = "1.1.23";
8
8
 
9
9
  function createEslintRule(rule) {
10
10
  const createRule = ESLintUtils.RuleCreator(
@@ -4865,7 +4865,6 @@ const plugin = {
4865
4865
  name: "vitest",
4866
4866
  version
4867
4867
  },
4868
- configs: {},
4869
4868
  rules: {
4870
4869
  [RULE_NAME$Z]: lowerCaseTitle,
4871
4870
  [RULE_NAME$Y]: maxNestedDescribe,
@@ -4951,42 +4950,46 @@ const plugin = {
4951
4950
  onTestFinished: true
4952
4951
  }
4953
4952
  }
4954
- }
4955
- };
4956
- plugin.configs = {
4957
- "legacy-recommended": createConfigLegacy(recommended),
4958
- "legacy-all": createConfigLegacy(allRules),
4959
- "recommended": {
4960
- plugins: {
4961
- ["vitest"]: plugin
4962
- },
4963
- rules: createConfig(recommended)
4964
4953
  },
4965
- "all": {
4966
- plugins: {
4967
- ["vitest"]: plugin
4954
+ configs: {
4955
+ "legacy-recommended": createConfigLegacy(recommended),
4956
+ "legacy-all": createConfigLegacy(allRules),
4957
+ "recommended": {
4958
+ plugins: {
4959
+ get vitest() {
4960
+ return plugin;
4961
+ }
4962
+ },
4963
+ rules: createConfig(recommended)
4968
4964
  },
4969
- rules: createConfig(allRules)
4970
- },
4971
- "env": {
4972
- languageOptions: {
4973
- globals: {
4974
- suite: "writable",
4975
- test: "writable",
4976
- describe: "writable",
4977
- it: "writable",
4978
- expectTypeOf: "writable",
4979
- assertType: "writable",
4980
- expect: "writable",
4981
- assert: "writable",
4982
- vitest: "writable",
4983
- vi: "writable",
4984
- beforeAll: "writable",
4985
- afterAll: "writable",
4986
- beforeEach: "writable",
4987
- afterEach: "writable",
4988
- onTestFailed: "writable",
4989
- onTestFinished: "writable"
4965
+ "all": {
4966
+ plugins: {
4967
+ get vitest() {
4968
+ return plugin;
4969
+ }
4970
+ },
4971
+ rules: createConfig(allRules)
4972
+ },
4973
+ "env": {
4974
+ languageOptions: {
4975
+ globals: {
4976
+ suite: "writable",
4977
+ test: "writable",
4978
+ describe: "writable",
4979
+ it: "writable",
4980
+ expectTypeOf: "writable",
4981
+ assertType: "writable",
4982
+ expect: "writable",
4983
+ assert: "writable",
4984
+ vitest: "writable",
4985
+ vi: "writable",
4986
+ beforeAll: "writable",
4987
+ afterAll: "writable",
4988
+ beforeEach: "writable",
4989
+ afterEach: "writable",
4990
+ onTestFailed: "writable",
4991
+ onTestFinished: "writable"
4992
+ }
4990
4993
  }
4991
4994
  }
4992
4995
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vitest/eslint-plugin",
3
- "version": "1.1.23",
3
+ "version": "1.1.24",
4
4
  "license": "MIT",
5
5
  "description": "Eslint plugin for vitest",
6
6
  "repository": "vitest-dev/eslint-plugin-vitest",