-
-
Notifications
You must be signed in to change notification settings - Fork 480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(linter): add vitest/prefer-lowercase-title rule #8152
base: main
Are you sure you want to change the base?
feat(linter): add vitest/prefer-lowercase-title rule #8152
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. |
CodSpeed Performance ReportMerging #8152 will not alter performanceComparing Summary
|
crates/oxc_linter/src/snapshots/vitest_prefer_lowercase_title2.snap
Outdated
Show resolved
Hide resolved
I noticed the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
This pull request implements the vitest/prefer-lowercase-title rule.
Since there was an existing jest rule with this title, I followed the existing pattern in no-unused-vars to group the jest and vitest rules together in a shared module. I used the existing
jest/prefer-lowercase-title
documentation as a base and modified it where it seemed appropriate. I added ajest
andvitest
snapshot suffix for each respective test suite.One item I wasn't 100% about is adding
bench
to the jest test names. Without this change, the vitest test suite fails because of this check which validates that we're only parsing valid jest functions from a detected jest file. The unit tests that are sourced from the vitest plugin are all read by the linting host as jest-like files, so addingbench
as a "valid" jest method allows us to lint a unit test using this keyword. This seemed to me like the least invasive solution to accommodate the new rule without breaking any existing code, but I'm certainly open to alternatives.