Automatically sync Vitest-compatible rules list from oxc repo#344
Merged
connorshea merged 11 commits intomainfrom Jan 26, 2026
Merged
Automatically sync Vitest-compatible rules list from oxc repo#344connorshea merged 11 commits intomainfrom
connorshea merged 11 commits intomainfrom
Conversation
connorshea
commented
Jan 23, 2026
connorshea
commented
Jan 23, 2026
| // 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 = [ |
Member
Author
There was a problem hiding this comment.
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.
Sysix
requested changes
Jan 23, 2026
connorshea
commented
Jan 24, 2026
scripts/generate-vitest-rules.ts
Outdated
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! |
Member
Author
There was a problem hiding this comment.
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.
Sysix
approved these changes
Jan 24, 2026
…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).
9186dca to
afbcee7
Compare
This was referenced Jan 26, 2026
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 :)