@wistia/oxlint-config 0.2.0 → 0.3.1

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.
Files changed (35) hide show
  1. package/configs/javascript.mjs +13 -0
  2. package/configs/node.mjs +8 -0
  3. package/configs/playwright.mjs +7 -0
  4. package/configs/react.mjs +11 -0
  5. package/configs/storybook.mjs +7 -0
  6. package/configs/styled-components.mjs +7 -0
  7. package/configs/testing-library.mjs +7 -0
  8. package/configs/typescript.mjs +20 -0
  9. package/configs/vitest.mjs +8 -0
  10. package/index.mjs +24 -0
  11. package/package.json +10 -16
  12. package/rules/{base.jsonc → base.mjs} +179 -184
  13. package/rules/{import.jsonc → import.mjs} +30 -32
  14. package/rules/{node.jsonc → node.mjs} +37 -39
  15. package/rules/{playwright.jsonc → playwright.mjs} +52 -54
  16. package/rules/{promise.jsonc → promise.mjs} +20 -22
  17. package/rules/{react-a11y.jsonc → react-a11y.mjs} +48 -50
  18. package/rules/{react.jsonc → react.mjs} +55 -57
  19. package/rules/{storybook.jsonc → storybook.mjs} +20 -22
  20. package/rules/styled-components.mjs +151 -0
  21. package/rules/{testing-library.jsonc → testing-library.mjs} +48 -50
  22. package/rules/{typescript.jsonc → typescript.mjs} +134 -136
  23. package/rules/{vitest.jsonc → vitest.mjs} +87 -89
  24. package/configs/javascript.jsonc +0 -4
  25. package/configs/node.jsonc +0 -4
  26. package/configs/playwright.jsonc +0 -4
  27. package/configs/react.jsonc +0 -4
  28. package/configs/storybook.jsonc +0 -4
  29. package/configs/styled-components.jsonc +0 -4
  30. package/configs/testing-library.jsonc +0 -4
  31. package/configs/typescript.jsonc +0 -4
  32. package/configs/vitest.jsonc +0 -4
  33. package/jsoncLoader.d.mts +0 -10
  34. package/jsoncLoader.mjs +0 -27
  35. package/rules/styled-components.jsonc +0 -153
@@ -1,324 +1,322 @@
1
- {
2
- // NOTE: oxlint splits vitest-related rules across two plugin namespaces:
3
- // - "vitest/" for rules that are vitest-specific (no Jest equivalent)
4
- // - "jest/" for rules that originated in eslint-plugin-jest and are shared with vitest
5
- // Both namespaces are used here for VITEST projects only. Despite the "jest/" prefix,
6
- // these rules apply to vitest code. This is an oxlint naming convention, not a dependency on Jest.
7
- "$schema": "../node_modules/oxlint/configuration_schema.json",
8
- "plugins": ["vitest", "jest"],
9
- "jsPlugins": [
10
- { "name": "vitest-js", "specifier": "@vitest/eslint-plugin" },
11
- "eslint-plugin-no-only-tests",
1
+ // NOTE: oxlint splits vitest-related rules across two plugin namespaces:
2
+ // - "vitest/" for rules that are vitest-specific (no Jest equivalent)
3
+ // - "jest/" for rules that originated in eslint-plugin-jest and are shared with vitest
4
+ // Both namespaces are used here for VITEST projects only. Despite the "jest/" prefix,
5
+ // these rules apply to vitest code. This is an oxlint naming convention, not a dependency on Jest.
6
+ export const vitestRules = {
7
+ plugins: ['vitest', 'jest'],
8
+ jsPlugins: [
9
+ { name: 'vitest-js', specifier: '@vitest/eslint-plugin' },
10
+ 'eslint-plugin-no-only-tests',
12
11
  ],
13
- "categories": {},
14
- "rules": {
12
+ rules: {
15
13
  // -- vitest-specific rules (no Jest equivalent) --
16
14
 
17
15
  // Require .test test file pattern
18
16
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/consistent-test-filename.md
19
- "vitest/consistent-test-filename": "error",
17
+ 'vitest/consistent-test-filename': 'error',
20
18
 
21
19
  // Enforce consistent usage of each with for...of
22
20
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/consistent-each-for.md
23
- "vitest/consistent-each-for": "error",
21
+ 'vitest/consistent-each-for': 'error',
24
22
 
25
23
  // Enforce consistent usage of vi vs vitest
26
24
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/consistent-vitest-vi.md
27
- "vitest/consistent-vitest-vi": "error",
25
+ 'vitest/consistent-vitest-vi': 'error',
28
26
 
29
27
  // Ensure hoisted APIs (vi.mock, vi.hoisted, etc.) are at the top
30
28
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/hoisted-apis-on-top.md
31
- "vitest/hoisted-apis-on-top": "error",
29
+ 'vitest/hoisted-apis-on-top': 'error',
32
30
 
33
31
  // Disallow conditional tests
34
32
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-conditional-tests.md
35
- "vitest/no-conditional-tests": "error",
33
+ 'vitest/no-conditional-tests': 'error',
36
34
 
37
35
  // Disallow importing node:test
38
36
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-import-node-test.md
39
- "vitest/no-import-node-test": "error",
37
+ 'vitest/no-import-node-test': 'error',
40
38
 
41
39
  // Prefer toHaveBeenCalledOnce() over toHaveBeenCalledTimes(1)
42
40
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-called-once.md
43
41
  // decision: conflicts with prefer-called-times (jest plugin), which is enabled
44
- "vitest/prefer-called-once": "off",
42
+ 'vitest/prefer-called-once': 'off',
45
43
 
46
44
  // Prefer toHaveBeenCalledTimes over multiple assertions
47
45
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-called-times.md
48
- "vitest/prefer-called-times": "error",
46
+ 'vitest/prefer-called-times': 'error',
49
47
 
50
48
  // Enforce describe titles to match function names
51
49
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-describe-function-title.md
52
- "vitest/prefer-describe-function-title": "error",
50
+ 'vitest/prefer-describe-function-title': 'error',
53
51
 
54
52
  // Prefer expect.typeOf() usage
55
53
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-expect-type-of.md
56
- "vitest/prefer-expect-type-of": "error",
54
+ 'vitest/prefer-expect-type-of': 'error',
57
55
 
58
56
  // Prefer vi.importActual/vi.importMock in vi.mock factories
59
57
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-import-in-mock.md
60
58
  // decision: potentially helpful but causes too many type errors
61
- "vitest/prefer-import-in-mock": "off",
59
+ 'vitest/prefer-import-in-mock': 'off',
62
60
 
63
61
  // Prefer strict boolean matchers (toBe(true) over toBeTruthy())
64
62
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-strict-boolean-matchers.md
65
- "vitest/prefer-strict-boolean-matchers": "error",
63
+ 'vitest/prefer-strict-boolean-matchers': 'error',
66
64
 
67
65
  // Suggest using toBeFalsy()
68
66
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-be-falsy.md
69
67
  // decision: not necessary to be prescriptive here
70
- "vitest/prefer-to-be-falsy": "off",
68
+ 'vitest/prefer-to-be-falsy': 'off',
71
69
 
72
70
  // Prefer toBeObject()
73
71
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-be-object.md
74
- "vitest/prefer-to-be-object": "error",
72
+ 'vitest/prefer-to-be-object': 'error',
75
73
 
76
74
  // Suggest using toBeTruthy
77
75
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-be-truthy.md
78
76
  // decision: not necessary to be prescriptive here
79
- "vitest/prefer-to-be-truthy": "off",
77
+ 'vitest/prefer-to-be-truthy': 'off',
80
78
 
81
79
  // Require local Test Context for concurrent snapshot tests
82
80
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-local-test-context-for-concurrent-snapshots.md
83
- "vitest/require-local-test-context-for-concurrent-snapshots": "error",
81
+ 'vitest/require-local-test-context-for-concurrent-snapshots': 'error',
84
82
 
85
83
  // -- Shared vitest/jest rules (oxlint uses the "jest/" prefix for these) --
86
84
 
87
85
  // Prefer test or it but not both
88
86
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/consistent-test-it.md
89
- "jest/consistent-test-it": "error",
87
+ 'jest/consistent-test-it': 'error',
90
88
 
91
89
  // Enforce having expectation in test body
92
90
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/expect-expect.md
93
- "jest/expect-expect": "error",
91
+ 'jest/expect-expect': 'error',
94
92
 
95
93
  // Enforce a maximum number of expect per test
96
94
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/max-expects.md
97
- "jest/max-expects": [
98
- "error",
95
+ 'jest/max-expects': [
96
+ 'error',
99
97
  {
100
- "max": 15,
98
+ max: 15,
101
99
  },
102
100
  ],
103
101
 
104
102
  // Nested describe block should be less than set max value or default value
105
103
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/max-nested-describe.md
106
- "jest/max-nested-describe": "error",
104
+ 'jest/max-nested-describe': 'error',
107
105
 
108
106
  // Disallow alias methods
109
107
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-alias-methods.md
110
- "jest/no-alias-methods": "error",
108
+ 'jest/no-alias-methods': 'error',
111
109
 
112
110
  // Disallow commented out tests
113
111
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-commented-out-tests.md
114
- "jest/no-commented-out-tests": "error",
112
+ 'jest/no-commented-out-tests': 'error',
115
113
 
116
114
  // Disallow conditional expects
117
115
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-conditional-expect.md
118
- "jest/no-conditional-expect": "error",
116
+ 'jest/no-conditional-expect': 'error',
119
117
 
120
118
  // Disallow conditional tests
121
119
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-conditional-in-test.md
122
120
  // decision: disabled in oxlint — the native jest/ prefix doesn't match existing
123
121
  // `eslint-disable vitest/no-conditional-in-test` comments, and the jsPlugin vitest-js/
124
122
  // alias has the same problem. Eslint still enforces this rule.
125
- "jest/no-conditional-in-test": "off",
123
+ 'jest/no-conditional-in-test': 'off',
126
124
 
127
125
  // Disallow disabled tests
128
126
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-disabled-tests.md
129
127
  // decision: it is often useful to be allowed to add a .skip
130
- "jest/no-disabled-tests": "off",
128
+ 'jest/no-disabled-tests': 'off',
131
129
 
132
130
  // Disallow duplicate hooks and teardown hooks
133
131
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-duplicate-hooks.md
134
- "jest/no-duplicate-hooks": "error",
132
+ 'jest/no-duplicate-hooks': 'error',
135
133
 
136
134
  // Disallow focused tests
137
135
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-focused-tests.md
138
- "jest/no-focused-tests": "error",
136
+ 'jest/no-focused-tests': 'error',
139
137
 
140
138
  // Disallow setup and teardown hooks
141
139
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-hooks.md
142
- "jest/no-hooks": "off",
140
+ 'jest/no-hooks': 'off',
143
141
 
144
142
  // Disallow identical titles
145
143
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-identical-title.md
146
- "jest/no-identical-title": "error",
144
+ 'jest/no-identical-title': 'error',
147
145
 
148
146
  // Disallow string interpolation in snapshots
149
147
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-interpolation-in-snapshots.md
150
- "jest/no-interpolation-in-snapshots": "error",
148
+ 'jest/no-interpolation-in-snapshots': 'error',
151
149
 
152
150
  // Disallow large snapshots
153
151
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-large-snapshots.md
154
- "jest/no-large-snapshots": [
155
- "error",
152
+ 'jest/no-large-snapshots': [
153
+ 'error',
156
154
  {
157
- "maxSize": 500,
155
+ maxSize: 500,
158
156
  },
159
157
  ],
160
158
 
161
159
  // Disallow importing from mocks directory
162
160
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-mocks-import.md
163
- "jest/no-mocks-import": "error",
161
+ 'jest/no-mocks-import': 'error',
164
162
 
165
163
  // Disallow the use of certain matchers
166
164
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-restricted-matchers.md
167
- "jest/no-restricted-matchers": "error",
165
+ 'jest/no-restricted-matchers': 'error',
168
166
 
169
167
  // Disallow using expect outside of it or test blocks
170
168
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-standalone-expect.md
171
- "jest/no-standalone-expect": "error",
169
+ 'jest/no-standalone-expect': 'error',
172
170
 
173
171
  // Disallow using test as a prefix
174
172
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-test-prefixes.md
175
- "jest/no-test-prefixes": "error",
173
+ 'jest/no-test-prefixes': 'error',
176
174
 
177
175
  // Disallow return statements in tests
178
176
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-test-return-statement.md
179
- "jest/no-test-return-statement": "error",
177
+ 'jest/no-test-return-statement': 'error',
180
178
 
181
179
  // Disallow unnecessary async in expect functions
182
180
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-unneeded-async-expect-function.md
183
- "jest/no-unneeded-async-expect-function": "error",
181
+ 'jest/no-unneeded-async-expect-function': 'error',
184
182
 
185
183
  // Enforce padding around test blocks
186
184
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-test-blocks.md
187
- "jest/padding-around-test-blocks": "error",
185
+ 'jest/padding-around-test-blocks': 'error',
188
186
 
189
187
  // Suggest using toBeCalledWith() or toHaveBeenCalledWith()
190
188
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-called-with.md
191
- "jest/prefer-called-with": "error",
189
+ 'jest/prefer-called-with': 'error',
192
190
 
193
191
  // Suggest using the built-in comparison matchers
194
192
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-comparison-matcher.md
195
- "jest/prefer-comparison-matcher": "error",
193
+ 'jest/prefer-comparison-matcher': 'error',
196
194
 
197
195
  // Prefer each rather than manual loops
198
196
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-each.md
199
- "jest/prefer-each": "error",
197
+ 'jest/prefer-each': 'error',
200
198
 
201
199
  // Suggest using the built-in equality matchers
202
200
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-equality-matcher.md
203
- "jest/prefer-equality-matcher": "error",
201
+ 'jest/prefer-equality-matcher': 'error',
204
202
 
205
203
  // Suggest using expect().resolves over expect(await ...) syntax
206
204
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-expect-resolves.md
207
- "jest/prefer-expect-resolves": "error",
205
+ 'jest/prefer-expect-resolves': 'error',
208
206
 
209
207
  // Prefer having hooks in consistent order
210
208
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-hooks-in-order.md
211
- "jest/prefer-hooks-in-order": "error",
209
+ 'jest/prefer-hooks-in-order': 'error',
212
210
 
213
211
  // Suggest having hooks before any test cases
214
212
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-hooks-on-top.md
215
- "jest/prefer-hooks-on-top": "error",
213
+ 'jest/prefer-hooks-on-top': 'error',
216
214
 
217
215
  // Enforce lowercase titles
218
216
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-lowercase-title.md
219
- "vitest/prefer-lowercase-title": "off",
217
+ 'vitest/prefer-lowercase-title': 'off',
220
218
 
221
219
  // Prefer mock resolved/rejected shorthands for promises
222
220
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-mock-promise-shorthand.md
223
- "jest/prefer-mock-promise-shorthand": "error",
221
+ 'jest/prefer-mock-promise-shorthand': 'error',
224
222
 
225
223
  // Prefer mock return shorthands
226
224
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-mock-return-shorthand.md
227
- "jest/prefer-mock-return-shorthand": "error",
225
+ 'jest/prefer-mock-return-shorthand': 'error',
228
226
 
229
227
  // Suggest using vi.spyOn
230
228
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-spy-on.md
231
- "jest/prefer-spy-on": "error",
229
+ 'jest/prefer-spy-on': 'error',
232
230
 
233
231
  // Prefer strict equal over equal
234
232
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-strict-equal.md
235
- "jest/prefer-strict-equal": "error",
233
+ 'jest/prefer-strict-equal': 'error',
236
234
 
237
235
  // Suggest using toBe()
238
236
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-be.md
239
- "jest/prefer-to-be": "error",
237
+ 'jest/prefer-to-be': 'error',
240
238
 
241
239
  // Prefer using toContain()
242
240
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-contain.md
243
- "jest/prefer-to-contain": "error",
241
+ 'jest/prefer-to-contain': 'error',
244
242
 
245
243
  // Suggest using toHaveLength()
246
244
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-to-have-length.md
247
- "jest/prefer-to-have-length": "error",
245
+ 'jest/prefer-to-have-length': 'error',
248
246
 
249
247
  // Suggest using test.todo
250
248
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-todo.md
251
- "jest/prefer-todo": "error",
249
+ 'jest/prefer-todo': 'error',
252
250
 
253
251
  // Require setup and teardown to be within a hook
254
252
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-hook.md
255
- "jest/require-hook": "error",
253
+ 'jest/require-hook': 'error',
256
254
 
257
255
  // Require toThrow() to be called with an error message
258
256
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-to-throw-message.md
259
- "jest/require-to-throw-message": "error",
257
+ 'jest/require-to-throw-message': 'error',
260
258
 
261
259
  // Enforce that all tests are in a top-level describe
262
260
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/require-top-level-describe.md
263
- "jest/require-top-level-describe": "error",
261
+ 'jest/require-top-level-describe': 'error',
264
262
 
265
263
  // Enforce valid describe callback
266
264
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/valid-describe-callback.md
267
- "jest/valid-describe-callback": "error",
265
+ 'jest/valid-describe-callback': 'error',
268
266
 
269
267
  // Enforce valid expect() usage
270
268
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/valid-expect.md
271
- "jest/valid-expect": "error",
269
+ 'jest/valid-expect': 'error',
272
270
 
273
271
  // Enforce valid titles
274
272
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/valid-title.md
275
273
  // decision: `allowArguments` avoids conflict with `prefer-describe-function-title` rule, which is enabled
276
- "jest/valid-title": ["error", { "allowArguments": true }],
274
+ 'jest/valid-title': ['error', { allowArguments: true }],
277
275
 
278
276
  // -- Rules via jsPlugins (@vitest/eslint-plugin + no-only-tests) --
279
277
 
280
278
  // Disallow .only tests
281
279
  // https://github.com/levibuzolic/eslint-plugin-no-only-tests
282
- "eslint-plugin-no-only-tests/no-only-tests": "error",
280
+ 'eslint-plugin-no-only-tests/no-only-tests': 'error',
283
281
 
284
282
  // Disallow the use of certain vi methods
285
283
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/no-restricted-vi-methods.md
286
- "vitest-js/no-restricted-vi-methods": "error",
284
+ 'vitest-js/no-restricted-vi-methods': 'error',
287
285
 
288
286
  // Prefer toHaveBeenCalledExactlyOnceWith over manual assertions
289
287
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-called-exactly-once-with.md
290
- "vitest-js/prefer-called-exactly-once-with": "error",
288
+ 'vitest-js/prefer-called-exactly-once-with': 'error',
291
289
 
292
290
  // Prefer importing vitest globals
293
291
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-importing-vitest-globals.md
294
- "vitest-js/prefer-importing-vitest-globals": "error",
292
+ 'vitest-js/prefer-importing-vitest-globals': 'error',
295
293
 
296
294
  // Prefer snapshot hint for inline/external snapshots
297
295
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-snapshot-hint.md
298
- "vitest-js/prefer-snapshot-hint": "error",
296
+ 'vitest-js/prefer-snapshot-hint': 'error',
299
297
 
300
298
  // Enforce padding around afterAll blocks
301
299
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-after-all-blocks.md
302
- "vitest-js/padding-around-after-all-blocks": "error",
300
+ 'vitest-js/padding-around-after-all-blocks': 'error',
303
301
 
304
302
  // Enforce padding around afterEach blocks
305
303
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-after-each-blocks.md
306
- "vitest-js/padding-around-after-each-blocks": "error",
304
+ 'vitest-js/padding-around-after-each-blocks': 'error',
307
305
 
308
306
  // Enforce padding around beforeAll blocks
309
307
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-before-all-blocks.md
310
- "vitest-js/padding-around-before-all-blocks": "error",
308
+ 'vitest-js/padding-around-before-all-blocks': 'error',
311
309
 
312
310
  // Enforce padding around beforeEach blocks
313
311
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-before-each-blocks.md
314
- "vitest-js/padding-around-before-each-blocks": "error",
312
+ 'vitest-js/padding-around-before-each-blocks': 'error',
315
313
 
316
314
  // Enforce padding around expect groups
317
315
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-expect-groups.md
318
- "vitest-js/padding-around-expect-groups": "error",
316
+ 'vitest-js/padding-around-expect-groups': 'error',
319
317
 
320
318
  // Enforce padding around describe blocks
321
319
  // https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/padding-around-describe-blocks.md
322
- "vitest-js/padding-around-describe-blocks": "error",
320
+ 'vitest-js/padding-around-describe-blocks': 'error',
323
321
  },
324
- }
322
+ };
@@ -1,4 +0,0 @@
1
- {
2
- "$schema": "../node_modules/oxlint/configuration_schema.json",
3
- "extends": ["../rules/base.jsonc", "../rules/import.jsonc", "../rules/promise.jsonc"],
4
- }
@@ -1,4 +0,0 @@
1
- {
2
- "$schema": "../node_modules/oxlint/configuration_schema.json",
3
- "extends": ["../rules/node.jsonc"],
4
- }
@@ -1,4 +0,0 @@
1
- {
2
- "$schema": "../node_modules/oxlint/configuration_schema.json",
3
- "extends": ["../rules/playwright.jsonc"],
4
- }
@@ -1,4 +0,0 @@
1
- {
2
- "$schema": "../node_modules/oxlint/configuration_schema.json",
3
- "extends": ["../rules/react.jsonc", "../rules/react-a11y.jsonc"],
4
- }
@@ -1,4 +0,0 @@
1
- {
2
- "$schema": "../node_modules/oxlint/configuration_schema.json",
3
- "extends": ["../rules/storybook.jsonc"],
4
- }
@@ -1,4 +0,0 @@
1
- {
2
- "$schema": "../node_modules/oxlint/configuration_schema.json",
3
- "extends": ["../rules/styled-components.jsonc"],
4
- }
@@ -1,4 +0,0 @@
1
- {
2
- "$schema": "../node_modules/oxlint/configuration_schema.json",
3
- "extends": ["../rules/testing-library.jsonc"],
4
- }
@@ -1,4 +0,0 @@
1
- {
2
- "$schema": "../node_modules/oxlint/configuration_schema.json",
3
- "extends": ["./javascript.jsonc", "../rules/typescript.jsonc"],
4
- }
@@ -1,4 +0,0 @@
1
- {
2
- "$schema": "../node_modules/oxlint/configuration_schema.json",
3
- "extends": ["../rules/vitest.jsonc"],
4
- }
package/jsoncLoader.d.mts DELETED
@@ -1,10 +0,0 @@
1
- /**
2
- * Load and parse a JSONC file (JSON with comments and trailing commas).
3
- *
4
- * Node's ESM loader doesn't support `.jsonc` imports, so this resolves the
5
- * path via `require.resolve`, reads the file, and parses it with `jsonc-parser`.
6
- *
7
- * @param specifier - A module specifier resolvable by `require.resolve`
8
- * @returns The parsed JSONC content
9
- */
10
- export declare const jsoncLoader: (specifier: string) => Record<string, unknown>;
package/jsoncLoader.mjs DELETED
@@ -1,27 +0,0 @@
1
- import { readFileSync } from 'node:fs';
2
- import { createRequire } from 'node:module';
3
- import { parse } from 'jsonc-parser';
4
-
5
- const require = createRequire(import.meta.url);
6
-
7
- /**
8
- * Load and parse a JSONC file (JSON with comments and trailing commas).
9
- *
10
- * Node's ESM loader doesn't support `.jsonc` imports, so this resolves the
11
- * path via `require.resolve`, reads the file, and parses it with `jsonc-parser`.
12
- *
13
- * @example
14
- * ```ts
15
- * import { jsoncLoader } from '@wistia/oxlint-config/jsoncLoader';
16
- *
17
- * const baseRules = jsoncLoader('@wistia/oxlint-config/rules/base.jsonc');
18
- * ```
19
- *
20
- * @param {string} specifier - A module specifier resolvable by `require.resolve`
21
- * @returns {Record<string, unknown>} The parsed JSONC content
22
- */
23
- export const jsoncLoader = (specifier) => {
24
- const filePath = require.resolve(specifier);
25
- const raw = readFileSync(filePath, 'utf8');
26
- return parse(raw);
27
- };