feat(jest,rstest): add padding rules - #2075
Open
elecmonkey wants to merge 1 commit into
Open
Conversation
This was referenced Sep 5, 2026
Base automatically changed from
refactor/test-framework-padding-engine
to
main
September 6, 2026 04:35
fansenze
force-pushed
the
feat/test-framework-padding-rules
branch
from
September 6, 2026 04:35
d7452ac to
0919622
Compare
fansenze
reviewed
Sep 6, 2026
| priority = 100 | ||
| } | ||
| return padding.NewRule(padding.Definition{ | ||
| Name: name, Family: "jest", Priority: priority, |
Contributor
There was a problem hiding this comment.
[P2] Adding a warning rule can make failing lint pass
Enable these two rules:
rules: {
'jest/padding-around-before-all-blocks': 'warn',
'jest/padding-around-before-each-blocks': 'error',
}Then lint two hooks with no blank line between them:
beforeAll(connect);
beforeEach(reset);- Expected: The missing blank line before
beforeEachproduces an error. Exit code: 1. - Actual: Only the
beforeAllwarning is reported. Exit code: 0.
Turning the first rule off restores the error. In other words, adding a warning rule makes code that previously failed lint pass.
Both rules detect the same missing blank line, but deduplication keeps the warning and drops the error. Rstest has the same problem. Please retain the error when these reports overlap and add a regression test for this configuration.
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
Add seven focused padding rules and
padding-around-allfor both Jest and Rstest.Share the padding engine while keeping framework-specific API tables, tests, and documentation.
Intentional limitations
expectTypeOf.Related Links
Related #476.
Related #935.
Checklist