Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat(linter): implement jest/vitest padding-around-after-each-blocks rule - #26600

Open
gowza wants to merge 7 commits into
oxc-project:mainfrom
gowza:feat/jest-padding-around-after-each-blocks
Open

feat(linter): implement jest/vitest padding-around-after-each-blocks rule#26600
gowza wants to merge 7 commits into
oxc-project:mainfrom
gowza:feat/jest-padding-around-after-each-blocks

Conversation

@gowza

@gowza gowza commented Sep 13, 2026

Copy link
Copy Markdown

Summary

Implement jest/padding-around-after-each-blocks and vitest/padding-around-after-each-blocks.

How

  • Extend crates/oxc_linter/src/utils/jest/padding_around_block.rs with report_missing_padding_after_jest_block().
  • Add crates/oxc_linter/src/rules/shared/jest_vitest/padding_around_after_each_blocks.rs for the lint rule execution.

Part of #492

Test plan

  • cargo test -p oxc_linter padding_around_describe_blocks
  • cargo fmt -p oxc_linter -- --check
  • cargo clippy -p oxc_linter --lib -- -D warnings
  • cargo lintgen, pnpm --filter oxlint-app generate-config-types, cargo lint-timings (no diff beyond the committed timing snapshot update)

@gowza
gowza force-pushed the feat/jest-padding-around-after-each-blocks branch from 005e2b6 to f8ddd55 Compare September 13, 2026 14:10
};

// Fix the padding based on the next node to circumvent having to
// handle semicolon that is not included in the AstNode's span.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

My understanding is that AstNode's span does not include ; but statement span does. So I decided to get next node and re-use the logic for report_missing_padding_before_jest_block().

An alternative that I can think of is to find the statement for the node and fix the padding between statement's span and the next statement's span.

Sorry for being a newbie. Open to suggestions 🙏

@gowza

gowza commented Sep 13, 2026

Copy link
Copy Markdown
Author

This PR probably have some merge conflicts with #23286.

Happy to amend the PR once that PR is merged.

@gowza
gowza marked this pull request as ready for review September 13, 2026 14:51
@gowza
gowza requested a review from camc314 as a code owner September 13, 2026 14:51
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.

1 participant