What version of Oxlint are you using?
1.62.0
What command did you run?
npx oxlint path/to/file.test.ts
What does your .oxlintrc.json (or oxlint.config.ts) config file look like?
What happened?
jest/padding-around-after-all-blocks produces incorrect results when two or more comments sit between the previous statement and the afterAll block. The rule appears to misclassify whether the comment group is "attached to" the previous statement or to the hook, which causes both false negatives and a broken autofix.
1. False negative — invalid code is not reported
This input has no blank line anywhere between const thing = 123; and afterAll(...), so the rule should report it. It does not:
const thing = 123;
/* one */
/* two */
afterAll(() => {});
Expected: Missing padding before afterAll block.
Actual: no diagnostic.
2. Autofix is incorrect
For case 2 (the input that should be flagged), the expected autofix is to insert a blank line before the attached comment group, i.e.:
// input
const thing = 123;
/* one */
/* two */
afterAll(() => {});
// expected output
const thing = 123;
/* one */
/* two */
afterAll(() => {});
Even after forcing the diagnostic to fire, the fixer does not produce this output.
I've tested this with ESLint, trying out both the jest/padding-around-after-all-blocks rule and vitest/padding-around-after-all-blocks, and it works as mentioned in the "expected output" section in the aforementioned cases above.
What version of Oxlint are you using?
1.62.0
What command did you run?
npx oxlint path/to/file.test.tsWhat does your
.oxlintrc.json(oroxlint.config.ts) config file look like?{ "$schema": "./node_modules/oxlint/configuration_schema.json", "plugins": ["jest"], "rules": { "jest/padding-around-after-all-blocks": "error" } }What happened?
jest/padding-around-after-all-blocksproduces incorrect results when two or more comments sit between the previous statement and theafterAllblock. The rule appears to misclassify whether the comment group is "attached to" the previous statement or to the hook, which causes both false negatives and a broken autofix.1. False negative — invalid code is not reported
This input has no blank line anywhere between
const thing = 123;andafterAll(...), so the rule should report it. It does not:Expected:
Missing padding before afterAll block.Actual: no diagnostic.
2. Autofix is incorrect
For case 2 (the input that should be flagged), the expected autofix is to insert a blank line before the attached comment group, i.e.:
Even after forcing the diagnostic to fire, the fixer does not produce this output.
I've tested this with ESLint, trying out both the
jest/padding-around-after-all-blocksrule andvitest/padding-around-after-all-blocks, and it works as mentioned in the "expected output" section in the aforementioned cases above.