Axetroy
Axetroy
> This is the perfect case for a eslint-disable-next-line comment The problem isn't whether it's disabled or not, it's that it's an unsafe autofix. Do we have a means to...
> I think the rule name should include `ternary`. So maybe `no-identical-alternatives-in-ternary`? I'm not very good with rule naming, but I think this is a better name
If it needs to keep the comments, needs a test: ```js a /** comment */ ? /** comment */ b : /** comment */ c ? 1 : 1 ```
I have reimplemented it. It is supports multiple lines and complex comments retention. Now it's ready for review @fisker
Close because it is too complex to implement edge cases perfectly.
Maybe, should `if (foo.indexOf('bar') < 0) {}` also be checked?
> [4e05b9b](https://github.com/sindresorhus/eslint-plugin-unicorn/commit/4e05b9b2b97fd739743ef404d2f0454534a74564) ? I did update but CI failed ```log package › Every rule has a doc with the appropriate content test/package.mjs:134 133: if (!RULES_WITHOUT_PASS_FAIL_SECTIONS.has(ruleName)) { 134: t.true(documentContents.includes('## Pass'), `${ruleName}...
Close since it will bring unexpected false positives.
> I'm happy to add this - but I wonder how you intend to use these? Is it just for manual checking or is this to interface with some software?...
This rule should be easy to implement. It is similar to this rule #2525 Once this rule is accepted, I will work on it.