New rule: newline-before-if
See original GitHub issue- This rule will warn when no newline before if statement.
Correct:
const a = 10;
if (a === 10) {
}
Incorrect:
const a = 10;
if (a === 10) {
}
- This rule is stylistic only.
- This rule is can be widely used as it increases code readability.
- Yes. I can create rule by myself.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:6
- Comments:15 (11 by maintainers)
Top Results From Across the Web
newline-before-return - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >proposed revisions to - Supreme Court
An amendment to Rule 37.4 sets forth requirements concerning amicus curiae briefs in connection with emergency applications. The new provision discourages these ...
Read more >Proposed Rules - GovInfo
The revised. Common Rule includes provisions intended to strengthen the effectiveness of the human subject protection regulations, and FDA is ...
Read more >Sass Guidelines
Always an empty new line before @if ;; Always a line break after the opening brace ( { );; @else statements on the...
Read more >JavaScript packages index - Page 933 | Snyk Advisor - Snyk
... eslint-plugin-my-custom-plugin · eslint-plugin-my-custom-rules ... eslint-plugin-new-line-before-if · eslint-plugin-newline-before-paren ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
JSCS has
requireNewlineBeforeBlockStatements
. I’m guessing we’d need the equivalent rather than one that is just specific toif
.Would be useful to be able to enforce newline after a block too. Like
requirePaddingNewLinesAfterBlocks
. Maybespace-around-block
.Similar to http://eslint.org/docs/rules/padded-blocks, but outside blocks.
Related issue: https://github.com/eslint/eslint/issues/3092