Closed DrChrispoper closed 2 years ago
For reference here is a test which should throw an error:
{
code: [
'const first = { foo: 0 };',
"<App>{first?.foo && <Foo/>}</App>",
].join("\n"),
errors: [{ messageId: "conditionErrorFalseyString" }],
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
output: [
'const first = { foo: 0 };',
"<App>{!!first?.foo && <Foo/>}</App>",
].join("\n"),
filename: "react.tsx",
},
Thanks for reporting. This should be fixed in the latest release, 1.3.1, which has just been published.
Thanks for the amazing plugin!
I have a use case, one that made us look into having a rule like this. That doesn't seem to be caught yet.