jscs-dev / node-jscs

:arrow_heading_up: JavaScript Code Style checker (unmaintained)
https://jscs-dev.github.io
MIT License
4.96k stars 511 forks source link

New rule: require-newline-before-single-statements #2138

Closed schempy closed 8 years ago

schempy commented 8 years ago

requireNewLineBeforeSingleStatements: New rule

Enforce newlines for expression statements within if/else

Fixes #1829 - issue

markelog commented 8 years ago

Hm, maybe requireNewlineBeforeSingleStatementsInIf name could be more explanatory?

schempy commented 8 years ago

Sure, that makes sense. Could also allow options to work with if/else, for etc... Don't want to make it more complicated than it needs. What do you think?

markelog commented 8 years ago

Could also allow options to work with if/else, for etc...

I think we can consider using different rule for that?

schempy commented 8 years ago

Sure another rule for those makes sense. I'll change the rule name to be requireNewlineBeforeSingleStatementsInIf

schempy commented 8 years ago

I changed the rule name to requireNewlineBeforeSingleStatementsInIf If things look OK I can squash the commits if you'd like.