feat(linter/eslint-plugin-vitest): Add require-hook as vitest compatible jest rule#288
Merged
camc314 merged 1 commit intooxc-project:mainfrom Dec 15, 2025
Conversation
camc314
pushed a commit
to oxc-project/oxc
that referenced
this pull request
Dec 15, 2025
…ble jest rule (#16880) Related to #4656 # Sumarry Add `require hook` as a vitest compatible rule. Oxlint-migrate PR: oxc-project/oxlint-migrate#288 # Changes made I had to sligthy modify the implementation to be compatible with both frameworks. The modifications were for 2 specific tests: ```javascripts ("describe.for([])('%s', (value) => {})", None), ( "describe('scoped', () => { test.scoped({ example: 'value' }); });", None, ), ``` Both test cases must pass. The first test case failed because `describe.for` [only exists in vitest](https://vitest.dev/api/#describe-for) and this exact part of `parse_jest_fn.rs` failed in the jest branch. https://github.com/oxc-project/oxc/blob/eba07e6fd945069e7694e3880b36e4f0f8f78d6d/crates/oxc_linter/src/utils/jest/parse_jest_fn.rs#L109C1-L115C10 Second test failed because `test.scoped` doesn't exist neither frameworks, `scoped` is a custom property made by a user. Reviewing the Jest and Vitest eslint code they are only interested in the beginning, not in the full chain.
camc314
approved these changes
Dec 15, 2025
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.
No description provided.