Skip to content

Conversation

PeterCardenas
Copy link
Contributor

@PeterCardenas PeterCardenas commented Aug 11, 2025

Adds the jest/padding-around-test-blocks rule. The jest plugin opts for abstracting away all the padding-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

@PeterCardenas PeterCardenas requested a review from camc314 as a code owner August 11, 2025 08:28
Copy link
Contributor

graphite-app bot commented Aug 11, 2025

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

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.

@github-actions github-actions bot added A-linter Area - Linter C-enhancement Category - New feature or request labels Aug 11, 2025
@PeterCardenas PeterCardenas force-pushed the padding-around-test-blocks branch from 8e58158 to b387324 Compare August 11, 2025 08:30
Copy link

codspeed-hq bot commented Aug 11, 2025

CodSpeed Instrumentation Performance Report

Merging #12985 will not alter performance

Comparing PeterCardenas:padding-around-test-blocks (391ac56) with main (a56f0da)

Summary

✅ 34 untouched benchmarks

@camc314 camc314 self-assigned this Aug 11, 2025
@PeterCardenas PeterCardenas force-pushed the padding-around-test-blocks branch 2 times, most recently from ee0f1fb to b2c6c41 Compare August 11, 2025 11:03
@PeterCardenas
Copy link
Contributor Author

@Sysix resolved all your comments 🙏

@PeterCardenas PeterCardenas force-pushed the padding-around-test-blocks branch from 0c0e55d to 61f1928 Compare August 12, 2025 22:30
@camc314 camc314 requested a review from Copilot August 14, 2025 16:05
Copy link
Contributor

@Copilot Copilot AI left a 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.

@PeterCardenas PeterCardenas force-pushed the padding-around-test-blocks branch 2 times, most recently from 5f99938 to 335aa17 Compare August 17, 2025 20:04
@PeterCardenas PeterCardenas requested a review from camc314 August 17, 2025 20:06
Copy link
Contributor

@camc314 camc314 left a comment

Choose a reason for hiding this comment

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

thanks

@camc314 camc314 force-pushed the padding-around-test-blocks branch from 335aa17 to 391ac56 Compare August 20, 2025 14:50
@camc314 camc314 merged commit 70f0143 into oxc-project:main Aug 20, 2025
25 checks passed
This was referenced Aug 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-linter Area - Linter C-enhancement Category - New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants