eslint-plugin-unicorn icon indicating copy to clipboard operation
eslint-plugin-unicorn copied to clipboard

Rule proposal: `no-identical-alternate`

Open fisker opened this issue 1 year ago • 3 comments

Description

Enforce clean code.

Fail

a ? b ? c : 1 : 1

Pass

a && b ? c : 1

Additional Info

No response

fisker avatar Jun 15 '23 07:06 fisker

also, it can verify if/if-else statements

if (foo) {
  return true
}
return true
if (foo) {
  return true
} else {
  return true
}

dimaMachina avatar Jun 21 '23 18:06 dimaMachina

Your case not the same as mine, it's more like a = b ? 1 : 1.

fisker avatar Jun 30 '23 12:06 fisker

Accepted

sindresorhus avatar Jul 19 '23 20:07 sindresorhus