What version of Oxlint are you using?
1.64.0
What command did you run?
No response
What does your .oxlintrc.json (or oxlint.config.ts) config file look like?
What happened?
This situation is triggering a violation of the jest/no-standalone-expect rule:
/**
* Minimal reproduction of oxlint bug: jest/no-standalone-expect ignores additionalTestBlockFunctions.
*
* ESLint with eslint-plugin-jest passes all of these because it respects:
* "jest/no-standalone-expect": ["error", { additionalTestBlockFunctions: ["beforeEach", "afterEach"] }]
*
* oxlint 1.64.0 flags every expect() inside beforeEach/afterEach regardless of that config option.
* The option is accepted without error but silently ignored.
*
* Expected: 0 errors (additionalTestBlockFunctions should whitelist beforeEach/afterEach)
* Actual: 2 errors (two expect() calls flagged as standalone)
*/
describe("additionalTestBlockFunctions reproduction", () => {
// Case 1: expect inside beforeEach at the top level of a describe
beforeEach(() => {
expect(true).toBe(true); // <-- Flagged
});
describe("nested describe", () => {
// Case 2: expect inside afterEach one level deep
afterEach(() => {
expect(true).toBe(true); // <-- Flagged
});
});
// Sanity check: expect inside it() should never be flagged
it("should always pass", () => {
expect(true).toBe(true);
});
});
What version of Oxlint are you using?
1.64.0
What command did you run?
No response
What does your
.oxlintrc.json(oroxlint.config.ts) config file look like?{ "plugins": ["jest"], "env": { "jest": true }, "rules": { "jest/no-standalone-expect": [ "deny", { "additionalTestBlockFunctions": ["beforeEach", "afterEach"] } ] } }What happened?
This situation is triggering a violation of the
jest/no-standalone-expectrule: