feat(linter): implement jest/vitest padding-around-after-each-blocks rule - #26600
Open
gowza wants to merge 7 commits into
Open
feat(linter): implement jest/vitest padding-around-after-each-blocks rule#26600gowza wants to merge 7 commits into
gowza wants to merge 7 commits into
Conversation
gowza
force-pushed
the
feat/jest-padding-around-after-each-blocks
branch
from
September 13, 2026 14:10
005e2b6 to
f8ddd55
Compare
gowza
commented
Sep 13, 2026
| }; | ||
|
|
||
| // Fix the padding based on the next node to circumvent having to | ||
| // handle semicolon that is not included in the AstNode's span. |
Author
There was a problem hiding this comment.
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 🙏
Author
|
This PR probably have some merge conflicts with #23286. Happy to amend the PR once that PR is merged. |
gowza
marked this pull request as ready for review
September 13, 2026 14:51
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implement
jest/padding-around-after-each-blocksandvitest/padding-around-after-each-blocks.How
crates/oxc_linter/src/utils/jest/padding_around_block.rswithreport_missing_padding_after_jest_block().crates/oxc_linter/src/rules/shared/jest_vitest/padding_around_after_each_blocks.rsfor the lint rule execution.Part of #492
Test plan