typescript - tslint one line rule misplaced 'else' -
i have such config
in tslint.json
one line rule
one-line": [true, "check-open-brace", "check-catch", "check-else", "check-whitespace" ],
when have code lines that:
if(somethingtrue) { next("a"); } else { next("b"); }
i've got warning:
(one-line) file.ts[17, 9]: misplaced 'else'
why happens? bad practice have 1 line else
?
you have :
else { next("b"); }
else must 1 one line. so:
else { next("b"); }
is bad practice have 1 line else?
just easier read. styleguide consistency.
Comments
Post a Comment