Skip to content

Automatically sync Vitest-compatible rules list from oxc repo#344

Merged
connorshea merged 11 commits intomainfrom
autosync-vitest-rules
Jan 26, 2026
Merged

Automatically sync Vitest-compatible rules list from oxc repo#344
connorshea merged 11 commits intomainfrom
autosync-vitest-rules

Conversation

@connorshea
Copy link
Copy Markdown
Member

@connorshea connorshea commented Jan 23, 2026

See oxc-project/oxc#18413 for the concept, and oxc-project/oxc#18414 for the PR where I implemented this in the oxc repo.

This allows us to update the vitest-compatible rules list automatically after new releases, based on the file in the oxc repo. No more one-off PRs necessary every time we add a new rule for this :)

@connorshea connorshea requested a review from Sysix January 23, 2026 00:57
// Some vitest rules are re-implemented version of jest rules.
// Since oxlint supports these rules under jest/*, we need to remap them.
// remapping in source-code: <https://github.com/oxc-project/oxc/blob/94320ab6f60ef6aaedeb901b04ccb57e953f66bf/crates/oxc_linter/src/utils/mod.rs>
export const viteTestCompatibleRules = [
Copy link
Copy Markdown
Member Author

@connorshea connorshea Jan 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed that this is identical to the JSON file (except that require-hook is alphabetically sorted in the JSON file and it was out of order here)

graphite-app bot pushed a commit to oxc-project/oxc that referenced this pull request Jan 23, 2026
…18414)

This is intended to match the existing constant in the codebase exactly, and will be used for oxlint-migrate and eslint-plugin-oxlint to get rid of some tedious busywork with keeping the projects in sync.

Fixes #18413

See oxc-project/oxlint-migrate#344 for the companion PR in oxlint-migrate.
Comment on lines +18 to +19
// const gitRef = `oxlint_v${packageJson.version}`;
const gitRef = `main`; // temp so we can test that this works. DO NOT LEAVE THIS AS MAIN!
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to revert this before we can merge, just did this to make it work in CI today. Can't merge it until we do a new oxlint release on Monday anyway.

@connorshea connorshea requested a review from Sysix January 24, 2026 20:59
…e oxc GitHub repo.

And format the repo automatically when running pnpm generate, to avoid needing to do that manually.
And update the generator script to do the vitest update first, then the rules generation. Otherwise it may use outdated data to generate the rules list.

Now we have a single source of truth for the vitest-compatible-jest-rules :)
No need to remove the existing files, and no need to format as that's done as part of `generate` now.
Needed to rereder generate.ts to have the vitest rules generation first, before the rules generation, otherwise the JSON file imported by traverseRules() won't work.
…generated JSON file works.

Otherwise, we get an error due to the import being resolved immediately upon execution of the file, before the JSON file exists (assuming it has been deleted).
@connorshea connorshea force-pushed the autosync-vitest-rules branch from 9186dca to afbcee7 Compare January 26, 2026 23:45
@connorshea connorshea marked this pull request as ready for review January 26, 2026 23:46
@connorshea connorshea merged commit e0fb845 into main Jan 26, 2026
5 checks passed
@connorshea connorshea deleted the autosync-vitest-rules branch January 26, 2026 23:48
Sysix pushed a commit to oxc-project/eslint-plugin-oxlint that referenced this pull request Jan 27, 2026
…ases (#619)

See oxc-project/oxc#18413 for the concept, and
oxc-project/oxc#18414 for the PR where I
implemented this in the oxc repo.

This was generated with help from Claude Code by having it basically
reproduce the changes from
oxc-project/oxlint-migrate#344 in this repo.

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants