Skip to content

Comments

feat(linter): add vitest/valid_title rule#19365

Closed
Limerio wants to merge 3 commits intooxc-project:mainfrom
Limerio:feat/implement-vitest-valid-title
Closed

feat(linter): add vitest/valid_title rule#19365
Limerio wants to merge 3 commits intooxc-project:mainfrom
Limerio:feat/implement-vitest-valid-title

Conversation

@Limerio
Copy link
Contributor

@Limerio Limerio commented Feb 13, 2026

This commit introduces a new linting rule, valid_title, for Vitest that checks the validity of titles in describe, it, and test blocks. The rule ensures that titles are meaningful, do not contain disallowed words, and adhere to specified patterns. Additionally, it includes diagnostics for common issues such as empty titles and leading/trailing spaces.

This commit introduces a new linting rule, `valid_title`, for Vitest that checks the validity of titles in `describe`, `it`, and `test` blocks. The rule ensures that titles are meaningful, do not contain disallowed words, and adhere to specified patterns. Additionally, it includes diagnostics for common issues such as empty titles and leading/trailing spaces.
@Limerio Limerio requested a review from camc314 as a code owner February 13, 2026 10:49
@github-actions github-actions bot added A-linter Area - Linter C-enhancement Category - New feature or request labels Feb 13, 2026
@codspeed-hq
Copy link

codspeed-hq bot commented Feb 13, 2026

Merging this PR will not alter performance

✅ 47 untouched benchmarks
⏩ 3 skipped benchmarks1


Comparing Limerio:feat/implement-vitest-valid-title (3306d2d) with main (d1c2fb6)2

Open in CodSpeed

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on main (b069269) during the generation of this report, so d1c2fb6 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

Copy link
Contributor

@camc314 camc314 left a comment

Choose a reason for hiding this comment

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

Hi! Thanks for working on this - some rules are aliased between the jest/vitest plugins to share code and reduce duplication - this is one of them, the rule is implemented here:

https://github.com/oxc-project/oxc/blob/main/crates/oxc_linter/src/rules/jest/valid_title.rs

@camc314 camc314 closed this Feb 13, 2026
@Limerio
Copy link
Contributor Author

Limerio commented Feb 13, 2026

Small question how is it shared between to better understand please?

@camc314
Copy link
Contributor

camc314 commented Feb 13, 2026

Take a look at these two?

Effectivly if you've got the vitest plugin enabled, we check the VITEST_COMPATIBLE_JEST_RULES var and enable the jest version of the rule if it's compatible

#12085

https://github.com/Boshen/oxc/blob/main/crates/oxc_linter/src/utils/mod.rs#L36-L84

@Limerio
Copy link
Contributor Author

Limerio commented Feb 20, 2026

Take a look at these two?

Effectivly if you've got the vitest plugin enabled, we check the VITEST_COMPATIBLE_JEST_RULES var and enable the jest version of the rule if it's compatible

#12085

https://github.com/Boshen/oxc/blob/main/crates/oxc_linter/src/utils/mod.rs#L36-L84

Oh okay I got it thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-linter Area - Linter C-enhancement Category - New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants