eslint-plugin-jest-extended icon indicating copy to clipboard operation
eslint-plugin-jest-extended copied to clipboard

jest-extended/prefer-to-be-true compatibility with jest/prefer-equality-matcher

Open geoffswift opened this issue 10 months ago • 0 comments

If I have this code:

expect(x === 5).toBe(true);

I may get these violations like so:

Prefer using one of the equality matchers instead  jest/prefer-equality-matcher
Prefer using `toBeTrue()` to test value is `true`  jest-extended/prefer-to-be-true

The "right" solution would be

expect(x).toBe(5);

but the autofix for prefer-to-be-true is changing the code to be like this (and jest/prefer-equality-matcher is unable to spot it)

expect(x === 5).toBe(true);

geoffswift avatar Jan 16 '25 09:01 geoffswift