feat(linter): reuse jest/padding-around-test-blocks for vitest/padding-around-test-blocks#24519
Conversation
…ding-around-test-blocks`
There was a problem hiding this comment.
Pull request overview
This PR refactors the existing jest/padding-around-test-blocks rule implementation into the shared jest_vitest ruleset and introduces vitest/padding-around-test-blocks by reusing that shared logic, updating generated rule registries and schemas accordingly.
Changes:
- Extract
padding-around-test-blockslogic + docs intocrates/oxc_linter/src/rules/shared/jest_vitest/. - Add a new
vitest/padding-around-test-blocksrule wrapper and snapshot tests. - Update generated rule registries, timing snapshots, and JS/JSON configuration schemas to include the new Vitest rule.
Reviewed changes
Copilot reviewed 9 out of 11 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tasks/track_linter_timings/linter_timings.snap | Adds the new Vitest rule to timing tracking. |
| npm/oxlint/configuration_schema.json | Exposes vitest/padding-around-test-blocks in the configuration schema. |
| crates/oxc_linter/src/snapshots/vitest_padding_around_test_blocks.snap | Adds snapshot output for the new Vitest rule tests. |
| crates/oxc_linter/src/rules/vitest/padding_around_test_blocks.rs | New Vitest rule delegating to shared implementation + tests. |
| crates/oxc_linter/src/rules/shared/jest_vitest/padding_around_test_blocks.rs | New shared implementation and documentation for reuse. |
| crates/oxc_linter/src/rules/shared/jest_vitest/mod.rs | Exports the new shared module. |
| crates/oxc_linter/src/rules/jest/padding_around_test_blocks.rs | Refactors Jest rule to call the shared implementation. |
| crates/oxc_linter/src/rules.rs | Registers the new Vitest rule module. |
| crates/oxc_linter/src/generated/rules_enum.rs | Adds the new Vitest rule to the generated rule enum/metadata wiring. |
| crates/oxc_linter/src/generated/rule_runner_impls.rs | Adds the RuleRunner impl for the new Vitest rule. |
| apps/oxlint/src-js/package/config.generated.ts | Adds the new Vitest rule to the generated JS config types. |
Merging this PR will not alter performance
Comparing Footnotes
|
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 570f33735f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
# Oxlint ### 💥 BREAKING CHANGES - 54cc121 ast: [**BREAKING**] Split `MetaProperty` into `ImportMeta` and `NewTarget` (#24557) (camc314) ### 🚀 Features - 7b045cd minfier: Drop last break from last switch case (#24673) (Armano) - dd18383 linter/node: Implement no-top-level-await rule (#24634) (Connor Shea) - 16a65f2 linter/react: Implement function-component-definition rule (#24471) (Cole Ellison) - 7f1f585 linter: Reuse `jest/padding-around-test-blocks` for `vitest/padding-around-test-blocks` (#24519) (Mikhail Baev) - 99978a8 linter/import/consistent-type-specifier-style: Support `prefer-top-level-if-only-type-imports` option (#24502) (camc314) ### 🐛 Bug Fixes - 0184ad6 linter/unicorn/no-useless-undefined: Preserve valid parameter defaults (#24686) (camc314) - 8694167 linter/eslint/prefer-destructuring: Handle typed declarations (#24616) (camc314) - 477cf0f linter/eslint/no-throw-literal: Handle assigned errors (#24561) (Cole Ellison) - ac9200a linter: Detect React components from returned JSX (#24521) (camc314) - c0a6522 linter/eslint/no-useless-computed-key: Allow TS syntax in computed keys (#24524) (Cole Ellison) ### ⚡ Performance - 346eed1 linter/unicorn/prefer-event-target: Only run on `Class` and `NewExpression` nodes (#24685) (Mikhail Baev) - 7be5cf0 oxlint/lsp: Only invoke lint on code actions when document is not opened (#24676) (Sysix) - d3f07a0 diagnostics: Box OxcDiagnosticInner to reduce binary size (#24665) (Boshen) - 90ae040 linter/reporter/stylish: Compute diagnostic Info once per diagnostic (#24525) (connorshea) ### 📚 Documentation - e6f7174 linter/valid-expect: Fix correct example being identical to incorrect one (#24468) (mkan0141) # Oxfmt ### 💥 BREAKING CHANGES - 54cc121 ast: [**BREAKING**] Split `MetaProperty` into `ImportMeta` and `NewTarget` (#24557) (camc314) ### 🚀 Features - 3d22307 parser: Add `ParseOptions::enable_ident_hashes` (#24491) (Boshen) ### 🐛 Bug Fixes - 6fe866a oxfmt: Keep tailwind classes glued to template expr with `preserveWhitespace` (#24609) (leaysgur) - 33e32d8 formatter_css: Use `line_suffix` for EOL line comment (#24580) (leaysgur) - 5f76998 formatter_graphql: Keep same line comments pending across intervening tokens (#24579) (leaysgur) Co-authored-by: Boshen <[email protected]> Co-authored-by: Cameron <[email protected]>
this PR moves
jest/padding-around-test-blocksto the shared jest_vitest rules, so it can be reused by both the jest and vitest rules.issue #4656