What version of Oxlint are you using?
1.42.0
What command did you run?
oxlint ./tests
What does your .oxlintrc.json config file look like?
What happened?
The valid-expect rule currently enforces a strict 1-argument limit for expect(). This is correct for Jest, but Vitest supports an optional second argument for a custom failure message (e.g., expect(value, 'message').toBe(value)).
See the Vitest documentation for details on the message argument.
Currently, valid Vitest code like this triggers a false positive:
import { expect, test } from 'vitest'
test('adds 1 + 2 to equal 3', () => {
expect(1 + 2, "sum is incorrect").toBe(4)
})
gives:
> valid-exprect-repro@1.0.0 lint
> oxlint ./tests
⚠ eslint-plugin-jest(valid-expect): Expect takes at most 1 argument
╭─[tests/sum.test.js:4:3]
3 │ test('adds 1 + 2 to equal 3', () => {
4 │ expect(1 + 2, "sum is incorrect").toBe(4)
· ─────────────────────────────────
5 │ })
╰────
help: Remove the extra arguments.
What version of Oxlint are you using?
1.42.0
What command did you run?
oxlint ./tests
What does your
.oxlintrc.jsonconfig file look like?{ "plugins": ["vitest"], }What happened?
The
valid-expectrule currently enforces a strict 1-argument limit forexpect(). This is correct for Jest, but Vitest supports an optional second argument for a custom failure message (e.g.,expect(value, 'message').toBe(value)).See the Vitest documentation for details on the message argument.
Currently, valid Vitest code like this triggers a false positive:
gives: