@egy186/eslint-config 2.2.0 → 2.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/README.md CHANGED
@@ -57,3 +57,12 @@ import { jest } from '@egy186/eslint-config/jest';
57
57
 
58
58
  export default [base, jest];
59
59
  ```
60
+
61
+ Vitest:
62
+
63
+ ```js
64
+ import { base } from '@egy186/eslint-config';
65
+ import { vitest } from '@egy186/eslint-config/vitest';
66
+
67
+ export default [base, vitest];
68
+ ```
package/dist/jest.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { Linter } from 'eslint';
2
2
  declare const config: {
3
- readonly files: ["**/*.{js,jsx,mjs,cjs}", "**/*.{ts,tsx,mts,cts}"];
3
+ readonly files: ["**/*.{spec,test}.{js,jsx,mjs,cjs}", "**/*.{spec,test}.{ts,tsx,mts,cts}"];
4
4
  readonly languageOptions: {
5
5
  readonly globals: {
6
6
  readonly afterAll: false;
package/dist/jest.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import globals from 'globals';
2
2
  import jest from 'eslint-plugin-jest';
3
3
  const config = {
4
- files: ['**/*.{js,jsx,mjs,cjs}', '**/*.{ts,tsx,mts,cts}'],
4
+ files: ['**/*.{spec,test}.{js,jsx,mjs,cjs}', '**/*.{spec,test}.{ts,tsx,mts,cts}'],
5
5
  languageOptions: {
6
6
  globals: {
7
7
  ...globals.jest
@@ -0,0 +1,269 @@
1
+ declare const config: {
2
+ readonly files: ["**/*.{spec,test}.{js,jsx,mjs,cjs}", "**/*.{spec,test}.{ts,tsx,mts,cts}"];
3
+ readonly plugins: {
4
+ readonly vitest: {
5
+ meta: {
6
+ name: string;
7
+ version: string;
8
+ };
9
+ rules: {
10
+ "prefer-lowercase-title": import("eslint").Rule.RuleModule;
11
+ "max-nested-describe": import("eslint").Rule.RuleModule;
12
+ "no-identical-title": import("eslint").Rule.RuleModule;
13
+ "no-focused-tests": import("eslint").Rule.RuleModule;
14
+ "no-conditional-tests": import("eslint").Rule.RuleModule;
15
+ "expect-expect": import("eslint").Rule.RuleModule;
16
+ "consistent-test-it": import("eslint").Rule.RuleModule;
17
+ "prefer-to-be": import("eslint").Rule.RuleModule;
18
+ "no-hooks": import("eslint").Rule.RuleModule;
19
+ "no-restricted-vi-methods": import("eslint").Rule.RuleModule;
20
+ "consistent-test-filename": import("eslint").Rule.RuleModule;
21
+ "max-expects": import("eslint").Rule.RuleModule;
22
+ "no-alias-methods": import("eslint").Rule.RuleModule;
23
+ "no-commented-out-tests": import("eslint").Rule.RuleModule;
24
+ "no-conditional-expect": import("eslint").Rule.RuleModule;
25
+ "no-conditional-in-test": import("eslint").Rule.RuleModule;
26
+ "no-disabled-tests": import("eslint").Rule.RuleModule;
27
+ "no-done-callback": import("eslint").Rule.RuleModule;
28
+ "no-duplicate-hooks": import("eslint").Rule.RuleModule;
29
+ "no-large-snapshots": import("eslint").Rule.RuleModule;
30
+ "no-interpolation-in-snapshots": import("eslint").Rule.RuleModule;
31
+ "no-mocks-import": import("eslint").Rule.RuleModule;
32
+ "no-restricted-matchers": import("eslint").Rule.RuleModule;
33
+ "no-standalone-expect": import("eslint").Rule.RuleModule;
34
+ "no-test-prefixes": import("eslint").Rule.RuleModule;
35
+ "no-test-return-statement": import("eslint").Rule.RuleModule;
36
+ "no-import-node-test": import("eslint").Rule.RuleModule;
37
+ "prefer-called-with": import("eslint").Rule.RuleModule;
38
+ "valid-title": import("eslint").Rule.RuleModule;
39
+ "valid-expect": import("eslint").Rule.RuleModule;
40
+ "prefer-to-be-falsy": import("eslint").Rule.RuleModule;
41
+ "prefer-to-be-object": import("eslint").Rule.RuleModule;
42
+ "prefer-to-be-truthy": import("eslint").Rule.RuleModule;
43
+ "prefer-to-have-length": import("eslint").Rule.RuleModule;
44
+ "prefer-equality-matcher": import("eslint").Rule.RuleModule;
45
+ "prefer-strict-equal": import("eslint").Rule.RuleModule;
46
+ "prefer-expect-resolves": import("eslint").Rule.RuleModule;
47
+ "prefer-each": import("eslint").Rule.RuleModule;
48
+ "prefer-hooks-on-top": import("eslint").Rule.RuleModule;
49
+ "prefer-hooks-in-order": import("eslint").Rule.RuleModule;
50
+ "require-local-test-context-for-concurrent-snapshots": import("eslint").Rule.RuleModule;
51
+ "prefer-mock-promise-shorthand": import("eslint").Rule.RuleModule;
52
+ "prefer-vi-mocked": import("eslint").Rule.RuleModule;
53
+ "prefer-snapshot-hint": import("eslint").Rule.RuleModule;
54
+ "valid-describe-callback": import("eslint").Rule.RuleModule;
55
+ "require-top-level-describe": import("eslint").Rule.RuleModule;
56
+ "require-to-throw-message": import("eslint").Rule.RuleModule;
57
+ "require-hook": import("eslint").Rule.RuleModule;
58
+ "prefer-todo": import("eslint").Rule.RuleModule;
59
+ "prefer-spy-on": import("eslint").Rule.RuleModule;
60
+ "prefer-comparison-matcher": import("eslint").Rule.RuleModule;
61
+ "prefer-to-contain": import("eslint").Rule.RuleModule;
62
+ "prefer-expect-assertions": import("eslint").Rule.RuleModule;
63
+ "padding-around-after-all-blocks": import("eslint").Rule.RuleModule;
64
+ "padding-around-after-each-blocks": import("eslint").Rule.RuleModule;
65
+ "padding-around-all": import("eslint").Rule.RuleModule;
66
+ "padding-around-before-all-blocks": import("eslint").Rule.RuleModule;
67
+ "padding-around-before-each-blocks": import("eslint").Rule.RuleModule;
68
+ "padding-around-describe-blocks": import("eslint").Rule.RuleModule;
69
+ "padding-around-expect-groups": import("eslint").Rule.RuleModule;
70
+ "padding-around-test-blocks": import("eslint").Rule.RuleModule;
71
+ "valid-expect-in-promise": import("eslint").Rule.RuleModule;
72
+ };
73
+ configs: {
74
+ "legacy-recommended": {
75
+ plugins: string[];
76
+ rules: {};
77
+ };
78
+ "legacy-all": {
79
+ plugins: string[];
80
+ rules: {};
81
+ };
82
+ recommended: {
83
+ plugins: {
84
+ readonly vitest: import("eslint").ESLint.Plugin;
85
+ };
86
+ rules: {
87
+ readonly "vitest/expect-expect": "error";
88
+ readonly "vitest/no-identical-title": "error";
89
+ readonly "vitest/no-commented-out-tests": "error";
90
+ readonly "vitest/valid-title": "error";
91
+ readonly "vitest/valid-expect": "error";
92
+ readonly "vitest/valid-describe-callback": "error";
93
+ readonly "vitest/require-local-test-context-for-concurrent-snapshots": "error";
94
+ readonly "vitest/no-import-node-test": "error";
95
+ };
96
+ };
97
+ all: {
98
+ plugins: {
99
+ readonly vitest: import("eslint").ESLint.Plugin;
100
+ };
101
+ rules: {
102
+ readonly "vitest/prefer-lowercase-title": "warn";
103
+ readonly "vitest/max-nested-describe": "warn";
104
+ readonly "vitest/no-focused-tests": "warn";
105
+ readonly "vitest/no-conditional-tests": "warn";
106
+ readonly "vitest/consistent-test-it": "warn";
107
+ readonly "vitest/no-hooks": "warn";
108
+ readonly "vitest/no-restricted-vi-methods": "warn";
109
+ readonly "vitest/consistent-test-filename": "warn";
110
+ readonly "vitest/max-expects": "warn";
111
+ readonly "vitest/no-alias-methods": "warn";
112
+ readonly "vitest/no-conditional-expect": "warn";
113
+ readonly "vitest/no-conditional-in-test": "warn";
114
+ readonly "vitest/no-disabled-tests": "warn";
115
+ readonly "vitest/no-done-callback": "warn";
116
+ readonly "vitest/no-duplicate-hooks": "warn";
117
+ readonly "vitest/no-large-snapshots": "warn";
118
+ readonly "vitest/no-interpolation-in-snapshots": "warn";
119
+ readonly "vitest/no-mocks-import": "warn";
120
+ readonly "vitest/no-restricted-matchers": "warn";
121
+ readonly "vitest/no-standalone-expect": "warn";
122
+ readonly "vitest/no-test-prefixes": "warn";
123
+ readonly "vitest/no-test-return-statement": "warn";
124
+ readonly "vitest/prefer-called-with": "warn";
125
+ readonly "vitest/prefer-to-be-falsy": "warn";
126
+ readonly "vitest/prefer-to-be-object": "warn";
127
+ readonly "vitest/prefer-to-be-truthy": "warn";
128
+ readonly "vitest/prefer-to-have-length": "warn";
129
+ readonly "vitest/prefer-equality-matcher": "warn";
130
+ readonly "vitest/prefer-strict-equal": "warn";
131
+ readonly "vitest/prefer-expect-resolves": "warn";
132
+ readonly "vitest/prefer-each": "warn";
133
+ readonly "vitest/prefer-hooks-on-top": "warn";
134
+ readonly "vitest/prefer-hooks-in-order": "warn";
135
+ readonly "vitest/prefer-mock-promise-shorthand": "warn";
136
+ readonly "vitest/prefer-vi-mocked": "warn";
137
+ readonly "vitest/prefer-snapshot-hint": "warn";
138
+ readonly "vitest/require-top-level-describe": "warn";
139
+ readonly "vitest/require-to-throw-message": "warn";
140
+ readonly "vitest/require-hook": "warn";
141
+ readonly "vitest/prefer-todo": "warn";
142
+ readonly "vitest/prefer-spy-on": "warn";
143
+ readonly "vitest/prefer-comparison-matcher": "warn";
144
+ readonly "vitest/prefer-to-contain": "warn";
145
+ readonly "vitest/prefer-expect-assertions": "warn";
146
+ readonly "vitest/prefer-to-be": "warn";
147
+ readonly "vitest/padding-around-after-all-blocks": "warn";
148
+ readonly "vitest/padding-around-after-each-blocks": "warn";
149
+ readonly "vitest/padding-around-all": "warn";
150
+ readonly "vitest/padding-around-before-all-blocks": "warn";
151
+ readonly "vitest/padding-around-before-each-blocks": "warn";
152
+ readonly "vitest/padding-around-describe-blocks": "warn";
153
+ readonly "vitest/padding-around-expect-groups": "warn";
154
+ readonly "vitest/padding-around-test-blocks": "warn";
155
+ readonly "vitest/valid-expect-in-promise": "warn";
156
+ };
157
+ };
158
+ env: {
159
+ languageOptions: {
160
+ globals: {
161
+ suite: "writable";
162
+ test: "writable";
163
+ describe: "writable";
164
+ it: "writable";
165
+ expect: "writable";
166
+ assert: "writable";
167
+ vitest: "writable";
168
+ vi: "writable";
169
+ beforeAll: "writable";
170
+ afterAll: "writable";
171
+ beforeEach: "writable";
172
+ afterEach: "writable";
173
+ };
174
+ };
175
+ };
176
+ };
177
+ environments: {
178
+ env: {
179
+ globals: {
180
+ suite: true;
181
+ test: true;
182
+ describe: true;
183
+ it: true;
184
+ expect: true;
185
+ assert: true;
186
+ vitest: true;
187
+ vi: true;
188
+ beforeAll: true;
189
+ afterAll: true;
190
+ beforeEach: true;
191
+ afterEach: true;
192
+ };
193
+ };
194
+ };
195
+ };
196
+ };
197
+ readonly rules: {
198
+ readonly 'max-lines-per-function': "off";
199
+ readonly 'max-statements': "off";
200
+ readonly 'n/no-unpublished-import': ["error", {
201
+ readonly allowModules: readonly ["vitest"];
202
+ }];
203
+ readonly 'vitest/consistent-test-filename': "error";
204
+ readonly 'vitest/consistent-test-it': "error";
205
+ readonly 'vitest/expect-expect': "error";
206
+ readonly 'vitest/max-expects': "error";
207
+ readonly 'vitest/max-nested-describe': "error";
208
+ readonly 'vitest/no-alias-methods': "error";
209
+ readonly 'vitest/no-commented-out-tests': "error";
210
+ readonly 'vitest/no-conditional-expect': "error";
211
+ readonly 'vitest/no-conditional-in-test': "error";
212
+ readonly 'vitest/no-conditional-tests': "error";
213
+ readonly 'vitest/no-disabled-tests': "error";
214
+ readonly 'vitest/no-duplicate-hooks': "error";
215
+ readonly 'vitest/no-focused-tests': "error";
216
+ readonly 'vitest/no-hooks': "off";
217
+ readonly 'vitest/no-identical-title': "error";
218
+ readonly 'vitest/no-import-node-test': "error";
219
+ readonly 'vitest/no-interpolation-in-snapshots': "error";
220
+ readonly 'vitest/no-large-snapshots': "error";
221
+ readonly 'vitest/no-mocks-import': "error";
222
+ readonly 'vitest/no-restricted-matchers': "error";
223
+ readonly 'vitest/no-restricted-vi-methods': "error";
224
+ readonly 'vitest/no-standalone-expect': "error";
225
+ readonly 'vitest/no-test-prefixes': "error";
226
+ readonly 'vitest/no-test-return-statement': "error";
227
+ readonly 'vitest/padding-around-after-all-blocks': "error";
228
+ readonly 'vitest/padding-around-after-each-blocks': "error";
229
+ readonly 'vitest/padding-around-all': "error";
230
+ readonly 'vitest/padding-around-before-all-blocks': "error";
231
+ readonly 'vitest/padding-around-before-each-blocks': "error";
232
+ readonly 'vitest/padding-around-describe-blocks': "error";
233
+ readonly 'vitest/padding-around-expect-groups': "error";
234
+ readonly 'vitest/padding-around-test-blocks': "error";
235
+ readonly 'vitest/prefer-called-with': "error";
236
+ readonly 'vitest/prefer-comparison-matcher': "error";
237
+ readonly 'vitest/prefer-each': "error";
238
+ readonly 'vitest/prefer-equality-matcher': "error";
239
+ readonly 'vitest/prefer-expect-assertions': ["error", {
240
+ readonly onlyFunctionsWithAsyncKeyword: true;
241
+ }];
242
+ readonly 'vitest/prefer-expect-resolves': "error";
243
+ readonly 'vitest/prefer-hooks-in-order': "error";
244
+ readonly 'vitest/prefer-hooks-on-top': "error";
245
+ readonly 'vitest/prefer-lowercase-title': "error";
246
+ readonly 'vitest/prefer-mock-promise-shorthand': "error";
247
+ readonly 'vitest/prefer-snapshot-hint': "error";
248
+ readonly 'vitest/prefer-spy-on': "error";
249
+ readonly 'vitest/prefer-strict-equal': "error";
250
+ readonly 'vitest/prefer-to-be': "error";
251
+ readonly 'vitest/prefer-to-be-falsy': "off";
252
+ readonly 'vitest/prefer-to-be-object': "error";
253
+ readonly 'vitest/prefer-to-be-truthy': "off";
254
+ readonly 'vitest/prefer-to-contain': "error";
255
+ readonly 'vitest/prefer-to-have-length': "error";
256
+ readonly 'vitest/prefer-todo': "error";
257
+ readonly 'vitest/prefer-vi-mocked': "error";
258
+ readonly 'vitest/require-hook': "error";
259
+ readonly 'vitest/require-local-test-context-for-concurrent-snapshots': "error";
260
+ readonly 'vitest/require-to-throw-message': "error";
261
+ readonly 'vitest/require-top-level-describe': "error";
262
+ readonly 'vitest/valid-describe-callback': "error";
263
+ readonly 'vitest/valid-expect': "error";
264
+ readonly 'vitest/valid-expect-in-promise': "error";
265
+ readonly 'vitest/valid-title': "error";
266
+ };
267
+ };
268
+ export { config as vitest };
269
+ export default config;
package/dist/vitest.js ADDED
@@ -0,0 +1,78 @@
1
+ import vitest from '@vitest/eslint-plugin';
2
+ const config = {
3
+ files: ['**/*.{spec,test}.{js,jsx,mjs,cjs}', '**/*.{spec,test}.{ts,tsx,mts,cts}'],
4
+ plugins: { vitest },
5
+ rules: {
6
+ 'max-lines-per-function': 'off',
7
+ 'max-statements': 'off',
8
+ 'n/no-unpublished-import': [
9
+ 'error',
10
+ {
11
+ allowModules: ['vitest']
12
+ }
13
+ ],
14
+ 'vitest/consistent-test-filename': 'error',
15
+ 'vitest/consistent-test-it': 'error',
16
+ 'vitest/expect-expect': 'error',
17
+ 'vitest/max-expects': 'error',
18
+ 'vitest/max-nested-describe': 'error',
19
+ 'vitest/no-alias-methods': 'error',
20
+ 'vitest/no-commented-out-tests': 'error',
21
+ 'vitest/no-conditional-expect': 'error',
22
+ 'vitest/no-conditional-in-test': 'error',
23
+ 'vitest/no-conditional-tests': 'error',
24
+ 'vitest/no-disabled-tests': 'error',
25
+ 'vitest/no-duplicate-hooks': 'error',
26
+ 'vitest/no-focused-tests': 'error',
27
+ 'vitest/no-hooks': 'off',
28
+ 'vitest/no-identical-title': 'error',
29
+ 'vitest/no-import-node-test': 'error',
30
+ 'vitest/no-interpolation-in-snapshots': 'error',
31
+ 'vitest/no-large-snapshots': 'error',
32
+ 'vitest/no-mocks-import': 'error',
33
+ 'vitest/no-restricted-matchers': 'error',
34
+ 'vitest/no-restricted-vi-methods': 'error',
35
+ 'vitest/no-standalone-expect': 'error',
36
+ 'vitest/no-test-prefixes': 'error',
37
+ 'vitest/no-test-return-statement': 'error',
38
+ 'vitest/padding-around-after-all-blocks': 'error',
39
+ 'vitest/padding-around-after-each-blocks': 'error',
40
+ 'vitest/padding-around-all': 'error',
41
+ 'vitest/padding-around-before-all-blocks': 'error',
42
+ 'vitest/padding-around-before-each-blocks': 'error',
43
+ 'vitest/padding-around-describe-blocks': 'error',
44
+ 'vitest/padding-around-expect-groups': 'error',
45
+ 'vitest/padding-around-test-blocks': 'error',
46
+ 'vitest/prefer-called-with': 'error',
47
+ 'vitest/prefer-comparison-matcher': 'error',
48
+ 'vitest/prefer-each': 'error',
49
+ 'vitest/prefer-equality-matcher': 'error',
50
+ 'vitest/prefer-expect-assertions': ['error', { onlyFunctionsWithAsyncKeyword: true }],
51
+ 'vitest/prefer-expect-resolves': 'error',
52
+ 'vitest/prefer-hooks-in-order': 'error',
53
+ 'vitest/prefer-hooks-on-top': 'error',
54
+ 'vitest/prefer-lowercase-title': 'error',
55
+ 'vitest/prefer-mock-promise-shorthand': 'error',
56
+ 'vitest/prefer-snapshot-hint': 'error',
57
+ 'vitest/prefer-spy-on': 'error',
58
+ 'vitest/prefer-strict-equal': 'error',
59
+ 'vitest/prefer-to-be': 'error',
60
+ 'vitest/prefer-to-be-falsy': 'off',
61
+ 'vitest/prefer-to-be-object': 'error',
62
+ 'vitest/prefer-to-be-truthy': 'off',
63
+ 'vitest/prefer-to-contain': 'error',
64
+ 'vitest/prefer-to-have-length': 'error',
65
+ 'vitest/prefer-todo': 'error',
66
+ 'vitest/prefer-vi-mocked': 'error',
67
+ 'vitest/require-hook': 'error',
68
+ 'vitest/require-local-test-context-for-concurrent-snapshots': 'error',
69
+ 'vitest/require-to-throw-message': 'error',
70
+ 'vitest/require-top-level-describe': 'error',
71
+ 'vitest/valid-describe-callback': 'error',
72
+ 'vitest/valid-expect': 'error',
73
+ 'vitest/valid-expect-in-promise': 'error',
74
+ 'vitest/valid-title': 'error'
75
+ }
76
+ };
77
+ export { config as vitest };
78
+ export default config;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@egy186/eslint-config",
3
3
  "description": "Eslint shareable config",
4
- "version": "2.2.0",
4
+ "version": "2.3.0",
5
5
  "author": "egy186",
6
6
  "bugs": {
7
7
  "url": "https://github.com/egy186/eslint-config/issues"
@@ -17,6 +17,7 @@
17
17
  "@eslint-stylistic/metadata": "~2.11.0",
18
18
  "@eslint/js": "~9.15.0",
19
19
  "@types/node": "^22.9.0",
20
+ "@vitest/eslint-plugin": "~1.1.10",
20
21
  "eslint": "~9.15.0",
21
22
  "eslint-import-resolver-typescript": "~3.6.3",
22
23
  "eslint-plugin-jest": "~28.9.0",
@@ -46,6 +47,10 @@
46
47
  "./typescript": {
47
48
  "types": "./dist/typescript.d.ts",
48
49
  "default": "./dist/typescript.js"
50
+ },
51
+ "./vitest": {
52
+ "types": "./dist/vitest.d.ts",
53
+ "default": "./dist/vitest.js"
49
54
  }
50
55
  },
51
56
  "files": [
@@ -59,6 +64,7 @@
59
64
  "license": "MIT",
60
65
  "main": "./dist/index.js",
61
66
  "peerDependencies": {
67
+ "@vitest/eslint-plugin": "^1.1.10",
62
68
  "eslint": "^9.11.1",
63
69
  "eslint-import-resolver-typescript": "^3.6.1",
64
70
  "eslint-plugin-jest": "^28.8.3",
@@ -68,6 +74,9 @@
68
74
  "typescript-eslint": "^8.15.0"
69
75
  },
70
76
  "peerDependenciesMeta": {
77
+ "@vitest/eslint-plugin": {
78
+ "optional": true
79
+ },
71
80
  "@eslint/compat": {
72
81
  "optional": true
73
82
  },