You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consider setting no-nested-ternary to warn or error. ESLint docs.
Would prevent stuff like this, which I find hard to read.
const test = sub ? ( sub.length ? 'test' : 'test2' ) : 'test3';
Here's some code searches. Codesearch 1.Codesearch 2. I excluded the folders modules, resources, lib, and dist, and files containing the word ".min.js". External code is much more likely to have nested ternaries due to minification or different code standards.
Would be good to keep it out of our codebase. I had several of these in Twinkle that I rewrote.
The text was updated successfully, but these errors were encountered:
I think that's too subjective. Some may find a single line double ternary easier to read. I don't know if we need to be opinionated about it at such a high level.
Consider setting
no-nested-ternary
to warn or error. ESLint docs.Would prevent stuff like this, which I find hard to read.
const test = sub ? ( sub.length ? 'test' : 'test2' ) : 'test3';
Here's some code searches. Codesearch 1. Codesearch 2. I excluded the folders modules, resources, lib, and dist, and files containing the word ".min.js". External code is much more likely to have nested ternaries due to minification or different code standards.
Would be good to keep it out of our codebase. I had several of these in Twinkle that I rewrote.
The text was updated successfully, but these errors were encountered: