Eslint rule for enforcing spaces around a ternary statement's colon?

633 views Asked by At

Is there an eslint rule to check that ternary colons have a space around them? There is a multiline-ternary rule, but I can't find one about the spacing.

Example of bad formatting:

showAreas ? areas: undefined
//               ^ missing a space

Example of good formatting:

showAreas ? areas : undefined
1

There are 1 answers

0
hendrixchord On BEST ANSWER

You can use this rule for enforcing spaces Space Infix Ops