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

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -