Skip to content

Commit 7b8fd1b

Browse files
authoredJan 19, 2025··
1 parent 3096ca3 commit 7b8fd1b

File tree

4 files changed

+111
-20
lines changed

4 files changed

+111
-20
lines changed
 

Diff for: ‎src/__snapshots__/configs.spec.ts.snap

+54
Original file line numberDiff line numberDiff line change
@@ -1498,6 +1498,12 @@ exports[`contains all the oxlint rules 1`] = `
14981498
"vitest/expect-expect": [
14991499
0,
15001500
],
1501+
"vitest/max-expects": [
1502+
0,
1503+
],
1504+
"vitest/max-nested-describe": [
1505+
0,
1506+
],
15011507
"vitest/no-alias-methods": [
15021508
0,
15031509
],
@@ -1516,24 +1522,60 @@ exports[`contains all the oxlint rules 1`] = `
15161522
"vitest/no-disabled-tests": [
15171523
0,
15181524
],
1525+
"vitest/no-duplicate-hooks": [
1526+
0,
1527+
],
15191528
"vitest/no-focused-tests": [
15201529
0,
15211530
],
1531+
"vitest/no-hooks": [
1532+
0,
1533+
],
15221534
"vitest/no-identical-title": [
15231535
0,
15241536
],
15251537
"vitest/no-import-node-test": [
15261538
0,
15271539
],
1540+
"vitest/no-interpolation-in-snapshots": [
1541+
0,
1542+
],
15281543
"vitest/no-restricted-jest-methods": [
15291544
0,
15301545
],
1546+
"vitest/no-restricted-matchers": [
1547+
0,
1548+
],
15311549
"vitest/no-test-prefixes": [
15321550
0,
15331551
],
1552+
"vitest/no-test-return-statement": [
1553+
0,
1554+
],
1555+
"vitest/prefer-comparison-matcher": [
1556+
0,
1557+
],
1558+
"vitest/prefer-each": [
1559+
0,
1560+
],
1561+
"vitest/prefer-equality-matcher": [
1562+
0,
1563+
],
1564+
"vitest/prefer-expect-resolves": [
1565+
0,
1566+
],
15341567
"vitest/prefer-hooks-in-order": [
15351568
0,
15361569
],
1570+
"vitest/prefer-hooks-on-top": [
1571+
0,
1572+
],
1573+
"vitest/prefer-mock-promise-shorthand": [
1574+
0,
1575+
],
1576+
"vitest/prefer-strict-equal": [
1577+
0,
1578+
],
15371579
"vitest/prefer-to-be-falsy": [
15381580
0,
15391581
],
@@ -1543,9 +1585,21 @@ exports[`contains all the oxlint rules 1`] = `
15431585
"vitest/prefer-to-be-truthy": [
15441586
0,
15451587
],
1588+
"vitest/prefer-to-have-length": [
1589+
0,
1590+
],
1591+
"vitest/prefer-todo": [
1592+
0,
1593+
],
15461594
"vitest/require-local-test-context-for-concurrent-snapshots": [
15471595
0,
15481596
],
1597+
"vitest/require-to-throw-message": [
1598+
0,
1599+
],
1600+
"vitest/require-top-level-describe": [
1601+
0,
1602+
],
15491603
"vitest/valid-describe-callback": [
15501604
0,
15511605
],

Diff for: ‎src/constants.ts

+21-20
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,15 @@ export const aliasPluginNames: Record<string, string> = {
1717
// Some typescript-eslint rules are re-implemented version of eslint rules.
1818
// Since oxlint supports these rules under eslint/* and it also supports TS,
1919
// we should override these to make implementation status up-to-date.
20+
// remapping in source-code: <https://github.com/oxc-project/oxc/blob/d966e0addafc4e0160ea27bf2d65e8b97ef299cb/crates/oxc_linter/src/utils/mod.rs>
2021
export const typescriptRulesExtendEslintRules = [
21-
'block-spacing',
22-
'brace-style',
2322
'class-methods-use-this',
24-
'comma-dangle',
25-
'comma-spacing',
2623
'default-param-last',
27-
'func-call-spacing',
28-
'indent',
2924
'init-declarations',
30-
'key-spacing',
31-
'keyword-spacing',
32-
'lines-around-comment',
33-
'lines-between-class-members',
3425
'max-params',
3526
'no-array-constructor',
3627
'no-dupe-class-members',
3728
'no-empty-function',
38-
'no-extra-parens',
39-
'no-extra-semi',
4029
'no-invalid-this',
4130
'no-loop-func',
4231
'no-loss-of-precision',
@@ -48,30 +37,42 @@ export const typescriptRulesExtendEslintRules = [
4837
'no-unused-vars',
4938
'no-use-before-define',
5039
'no-useless-constructor',
51-
'object-curly-spacing',
52-
'padding-line-between-statements',
53-
'quotes',
54-
'semi',
55-
'space-before-blocks',
56-
'space-before-function-paren',
57-
'space-infix-ops',
5840
];
5941

6042
// Some vitest rules are re-implemented version of jest rules.
6143
// Since oxlint supports these rules under jest/*, we need to remap them.
44+
// remapping in source-code: <https://github.com/oxc-project/oxc/blob/d966e0addafc4e0160ea27bf2d65e8b97ef299cb/crates/oxc_linter/src/utils/mod.rs>
6245
export const viteTestCompatibleRules = [
6346
'consistent-test-it',
6447
'expect-expect',
48+
'max-expects',
49+
'max-nested-describe',
6550
'no-alias-methods',
51+
'no-commented-out-tests',
6652
'no-conditional-expect',
6753
'no-conditional-in-test',
68-
'no-commented-out-tests',
6954
'no-disabled-tests',
55+
'no-duplicate-hooks',
7056
'no-focused-tests',
57+
'no-hooks',
7158
'no-identical-title',
59+
'no-interpolation-in-snapshots',
7260
'no-restricted-jest-methods',
61+
'no-restricted-matchers',
7362
'no-test-prefixes',
63+
'no-test-return-statement',
64+
'prefer-comparison-matcher',
65+
'prefer-each',
66+
'prefer-equality-matcher',
67+
'prefer-expect-resolves',
7468
'prefer-hooks-in-order',
69+
'prefer-hooks-on-top',
70+
'prefer-mock-promise-shorthand',
71+
'prefer-strict-equal',
72+
'prefer-to-have-length',
73+
'prefer-todo',
74+
'require-to-throw-message',
75+
'require-top-level-describe',
7576
'valid-describe-callback',
7677
'valid-expect',
7778
];

Diff for: ‎src/generated/rules-by-category.ts

+18
Original file line numberDiff line numberDiff line change
@@ -273,11 +273,28 @@ const styleRules = {
273273
'@typescript-eslint/max-params': 'off',
274274
'@typescript-eslint/no-magic-numbers': 'off',
275275
'vitest/consistent-test-it': 'off',
276+
'vitest/max-expects': 'off',
277+
'vitest/max-nested-describe': 'off',
276278
'vitest/no-alias-methods': 'off',
279+
'vitest/no-duplicate-hooks': 'off',
280+
'vitest/no-hooks': 'off',
277281
'vitest/no-identical-title': 'off',
282+
'vitest/no-interpolation-in-snapshots': 'off',
278283
'vitest/no-restricted-jest-methods': 'off',
284+
'vitest/no-restricted-matchers': 'off',
279285
'vitest/no-test-prefixes': 'off',
286+
'vitest/no-test-return-statement': 'off',
287+
'vitest/prefer-each': 'off',
288+
'vitest/prefer-comparison-matcher': 'off',
289+
'vitest/prefer-equality-matcher': 'off',
290+
'vitest/prefer-expect-resolves': 'off',
280291
'vitest/prefer-hooks-in-order': 'off',
292+
'vitest/prefer-hooks-on-top': 'off',
293+
'vitest/prefer-mock-promise-shorthand': 'off',
294+
'vitest/prefer-strict-equal': 'off',
295+
'vitest/prefer-to-have-length': 'off',
296+
'vitest/prefer-todo': 'off',
297+
'vitest/require-top-level-describe': 'off',
281298
} as const;
282299

283300
const correctnessRules = {
@@ -446,6 +463,7 @@ const correctnessRules = {
446463
'vitest/no-conditional-expect': 'off',
447464
'vitest/no-disabled-tests': 'off',
448465
'vitest/no-focused-tests': 'off',
466+
'vitest/require-to-throw-message': 'off',
449467
'vitest/valid-describe-callback': 'off',
450468
'vitest/valid-expect': 'off',
451469
} as const;

Diff for: ‎src/generated/rules-by-scope.ts

+18
Original file line numberDiff line numberDiff line change
@@ -496,16 +496,34 @@ const vitestRules = {
496496
'vitest/require-local-test-context-for-concurrent-snapshots': 'off',
497497
'vitest/consistent-test-it': 'off',
498498
'vitest/expect-expect': 'off',
499+
'vitest/max-expects': 'off',
500+
'vitest/max-nested-describe': 'off',
499501
'vitest/no-alias-methods': 'off',
500502
'vitest/no-commented-out-tests': 'off',
501503
'vitest/no-conditional-expect': 'off',
502504
'vitest/no-conditional-in-test': 'off',
503505
'vitest/no-disabled-tests': 'off',
506+
'vitest/no-duplicate-hooks': 'off',
504507
'vitest/no-focused-tests': 'off',
508+
'vitest/no-hooks': 'off',
505509
'vitest/no-identical-title': 'off',
510+
'vitest/no-interpolation-in-snapshots': 'off',
506511
'vitest/no-restricted-jest-methods': 'off',
512+
'vitest/no-restricted-matchers': 'off',
507513
'vitest/no-test-prefixes': 'off',
514+
'vitest/no-test-return-statement': 'off',
515+
'vitest/prefer-each': 'off',
516+
'vitest/prefer-comparison-matcher': 'off',
517+
'vitest/prefer-equality-matcher': 'off',
518+
'vitest/prefer-expect-resolves': 'off',
508519
'vitest/prefer-hooks-in-order': 'off',
520+
'vitest/prefer-hooks-on-top': 'off',
521+
'vitest/prefer-mock-promise-shorthand': 'off',
522+
'vitest/prefer-strict-equal': 'off',
523+
'vitest/prefer-to-have-length': 'off',
524+
'vitest/prefer-todo': 'off',
525+
'vitest/require-to-throw-message': 'off',
526+
'vitest/require-top-level-describe': 'off',
509527
'vitest/valid-describe-callback': 'off',
510528
'vitest/valid-expect': 'off',
511529
} as const;

0 commit comments

Comments
 (0)
Please sign in to comment.