Closed
Description
Version: 7.30.1
Config:
'react/jsx-no-leaked-render': ['error', { validStrategies: ['coerce', 'ternary'] }],
Before fix:
const MyComponent = () => {
const items = []
const breakpoint = { phones: true }
return <div>{items.length > 0 && breakpoint.phones && <span />}</div>
}
Post fix:
const MyComponent = () => {
const items = []
const breakpoint = { phones: true }
return <div>{!!!!!!!!!!!!!!!!!!!!items.length > 0 && breakpoint.phones && <span />}</div>
}
Expected:
const MyComponent = () => {
const items = []
const breakpoint = { phones: true }
return <div>{items.length > 0 && !!breakpoint.phones && <span />}</div>
}
On top of that, the auto fix is quite slow.