New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(lint): don't allow excess trailing newlines #816
Conversation
This enforces that files should not end with blank lines (i.e. more than one trailing newline). The `eol-last` rule (inherited from airbnb's config) already enforces that files end in at least one trailing newline, so adding this rule enforces that it ends in exactly 1. See https://eslint.org/docs/rules/no-multiple-empty-lines and https://eslint.org/docs/rules/eol-last for more information. Inspired by #809.
@jumson FYI |
.eslintrc.json
Outdated
@@ -23,6 +23,7 @@ | |||
"consistent-return": "off", | |||
"no-mixed-operators": "off", | |||
"no-prototype-builtins": "off", | |||
"no-multiple-empty-lines": ["error", { "max": 2, "maxEOF": 0 } ], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@freitagbr We can also make "max": 1
, but that involves changing:
Lines 25 to 29 in 902e49c
} | |
//@ | |
//@ ### tempdir() |
and
Lines 17 to 21 in 902e49c
}); | |
//@ | |
//@ ### test(expression) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 lines max is fine. "maxBOF": 0
should be added.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
.eslintrc.json
Outdated
@@ -23,6 +23,7 @@ | |||
"consistent-return": "off", | |||
"no-mixed-operators": "off", | |||
"no-prototype-builtins": "off", | |||
"no-multiple-empty-lines": ["error", { "max": 2, "maxEOF": 0 } ], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2 lines max is fine. "maxBOF": 0
should be added.
PTAL |
LGTM |
This enforces that files should not end with blank lines (i.e. more than
one trailing newline). The
eol-last
rule (inherited from airbnb'sconfig) already enforces that files end in at least one trailing
newline, so adding this rule enforces that it ends in exactly 1.
See https://eslint.org/docs/rules/no-multiple-empty-lines and
https://eslint.org/docs/rules/eol-last for more information.
Inspired by #809.