-
-
Notifications
You must be signed in to change notification settings - Fork 650
feat(linter): add jest/padding-around-test-blocks rule #12985
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 jest/padding-around-test-blocks rule #12985
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. |
8e58158
to
b387324
Compare
CodSpeed Instrumentation Performance ReportMerging #12985 will not alter performanceComparing Summary
|
ee0f1fb
to
b2c6c41
Compare
@Sysix resolved all your comments 🙏 |
0c0e55d
to
61f1928
Compare
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.
Pull Request Overview
This PR adds a new ESLint rule jest/padding-around-test-blocks
that enforces blank lines before test blocks (test, it, fit, etc.) to improve code readability and organization. The rule includes auto-fix functionality and supports proper handling of comments between statements.
Key Changes:
- Implements the
jest/padding-around-test-blocks
linting rule with auto-fix support - Adds comprehensive test coverage including edge cases with comments and nested describe blocks
- Integrates the new rule into the linter's rule registry
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
crates/oxc_linter/src/rules/jest/padding_around_test_blocks.rs |
Main implementation of the padding rule with logic for detecting missing padding and auto-fixing |
crates/oxc_linter/src/rules.rs |
Registers the new rule in the linter's module system |
crates/oxc_linter/src/snapshots/jest_padding_around_test_blocks.snap |
Test snapshots showing expected diagnostic output for various violation cases |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
5f99938
to
335aa17
Compare
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
[autofix.ci] apply automated fixes
335aa17
to
391ac56
Compare
Adds the
jest/padding-around-test-blocks
rule. The jest plugin opts for abstracting away all thepadding-around-x
rules with a helper, but for my purposes, I only needed this specific rule. My opinion is that we can investigate generalizing this rule to the other padding plugin as a followup, if there is pull for it.Works towards #492