I tried enabling prefer-ternary
again on a large codebase and I think I found the only place where I actually prefer its result: assignments.
This also works if lines are long as long as they're wrapped.
Would it be possible to enable the rule only on such code? Regular if (x) await foo; else await bar
makes no sense with a ternary.
if (a)
foo = 1
else
foo = 2
if (a)
return 'Nisi temporibus quae vel officia? Rerum error blanditiis'
else
return 'pariatur praesentium repellendus culpa neque veritatis, non assumenda fugiat dicta dolorum '
foo = a ? 1 : 2
return a ?
'Nisi temporibus quae vel officia? Rerum error blanditiis' :
'pariatur praesentium repellendus culpa neque veritatis, non assumenda fugiat dicta dolorum '
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too