Open 4nduril-ms opened 9 months ago
@4nduril-ms calling Boolean(variable)
does not show an error. E.g.
let x = 0;
const Component = () => {
return <>{Boolean(x) && <div />}</>;
};
Can you provide a code sample that does?
That's weird.
I will check if I can find any settings that are unusual. The project is rather complex (monorepo). But also, when I check out your repo and add the following test case to "valid" it fails:
{
code: `
const Component = () => {
return <>{Boolean(true) && <></>}</>;
};
`,
},
Hi, I was just wondering if it would be possible to allow for
Boolean
calls on the left side of&&
. I am not that much into ASTs and node types but I understand this would be a CallExpression. Can we somehow "see" what the resulting type of a call expression would be and mark it as a valid condition?