Skip to content

Comments

feat(linter/eslint-plugin-vitest): Add prefer-spy-on as vitest compatible jest rule#291

Merged
camc314 merged 1 commit intooxc-project:mainfrom
Afsoon:12-15-vitest-comptible-jest-rule-prefer-spy-on
Dec 16, 2025
Merged

feat(linter/eslint-plugin-vitest): Add prefer-spy-on as vitest compatible jest rule#291
camc314 merged 1 commit intooxc-project:mainfrom
Afsoon:12-15-vitest-comptible-jest-rule-prefer-spy-on

Conversation

@Afsoon
Copy link
Contributor

@Afsoon Afsoon commented Dec 15, 2025

No description provided.

camc314 pushed a commit to oxc-project/oxc that referenced this pull request Dec 16, 2025
Related to #4656 

Implement
[prefer-spy-on](https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-spy-on.md)
lint ruler.

~~It's my first contribution made in Rust, and in Oxc, any suggestion to
improve the code it's welcome. The logic is based on the JS rule
implementation.~~

~~Update 12/04/2025: I have just notice Jest have a similar linter rule,
so I have duplicate the code and adapt it to vitest. I discarded the
option to abstract all the logic as none can ensure that both lints rule
are going to be the same in the future. Discarded the map between jest
and vitest rules as the documentacion for this specific rule is
distinct.~~

Update 12/15/2025: The rule is implemented as a compatible with jest
instead of duplicate code:

Oxlint migrate PR:
oxc-project/oxlint-migrate#291
@camc314 camc314 merged commit 6a19ad7 into oxc-project:main Dec 16, 2025
3 checks passed
Boshen pushed a commit to oxc-project/oxc that referenced this pull request Dec 16, 2025
Related to #4656 

Implement
[prefer-spy-on](https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-spy-on.md)
lint ruler.

~~It's my first contribution made in Rust, and in Oxc, any suggestion to
improve the code it's welcome. The logic is based on the JS rule
implementation.~~

~~Update 12/04/2025: I have just notice Jest have a similar linter rule,
so I have duplicate the code and adapt it to vitest. I discarded the
option to abstract all the logic as none can ensure that both lints rule
are going to be the same in the future. Discarded the map between jest
and vitest rules as the documentacion for this specific rule is
distinct.~~

Update 12/15/2025: The rule is implemented as a compatible with jest
instead of duplicate code:

Oxlint migrate PR:
oxc-project/oxlint-migrate#291
qinyuhang pushed a commit to qinyuhang/oxc that referenced this pull request Jan 22, 2026
…ct#16426)

Related to oxc-project#4656 

Implement
[prefer-spy-on](https://github.com/vitest-dev/eslint-plugin-vitest/blob/main/docs/rules/prefer-spy-on.md)
lint ruler.

~~It's my first contribution made in Rust, and in Oxc, any suggestion to
improve the code it's welcome. The logic is based on the JS rule
implementation.~~

~~Update 12/04/2025: I have just notice Jest have a similar linter rule,
so I have duplicate the code and adapt it to vitest. I discarded the
option to abstract all the logic as none can ensure that both lints rule
are going to be the same in the future. Discarded the map between jest
and vitest rules as the documentacion for this specific rule is
distinct.~~

Update 12/15/2025: The rule is implemented as a compatible with jest
instead of duplicate code:

Oxlint migrate PR:
oxc-project/oxlint-migrate#291
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