-
-
Notifications
You must be signed in to change notification settings - Fork 760
feat(linter): vitest/valid-title #10841
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
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. |
33bd875 to
f2d7a20
Compare
CodSpeed Instrumentation Performance ReportMerging #10841 will not alter performanceComparing Summary
|
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 for your contribution. ❤️
We are not separating the jest/vitest rules which are identical,
instead, we are implementing them in jest and remapping them for vitest:
oxc/crates/oxc_linter/src/utils/mod.rs
Lines 22 to 58 in ad4fbf4
| /// List of Jest rules that have Vitest equivalents. | |
| const VITEST_COMPATIBLE_JEST_RULES: [&str; 34] = [ | |
| "consistent-test-it", | |
| "expect-expect", | |
| "max-expects", | |
| "max-nested-describe", | |
| "no-alias-methods", | |
| "no-commented-out-tests", | |
| "no-conditional-expect", | |
| "no-conditional-in-test", | |
| "no-disabled-tests", | |
| "no-duplicate-hooks", | |
| "no-focused-tests", | |
| "no-hooks", | |
| "no-identical-title", | |
| "no-interpolation-in-snapshots", | |
| "no-restricted-jest-methods", | |
| "no-restricted-matchers", | |
| "no-standalone-expect", | |
| "no-test-prefixes", | |
| "no-test-return-statement", | |
| "prefer-comparison-matcher", | |
| "prefer-each", | |
| "prefer-equality-matcher", | |
| "prefer-expect-resolves", | |
| "prefer-hooks-in-order", | |
| "prefer-hooks-on-top", | |
| "prefer-lowercase-title", | |
| "prefer-mock-promise-shorthand", | |
| "prefer-strict-equal", | |
| "prefer-to-have-length", | |
| "prefer-todo", | |
| "require-to-throw-message", | |
| "require-top-level-describe", | |
| "valid-describe-callback", | |
| "valid-expect", | |
| ]; |
Could you please update the jest rule to include all vitest rules test + options?
And add the rule in the linked mod.rs file :)
This rule implementation is almost entirely based on the Jest rule of the same name. I'm happy to extract the common code from each if there's a good place to house it.
It's my first contribution to this repository, so let me know if I'm missing any steps!