Skip to content

Conversation

@nfischer
Copy link
Member

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.

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.
@nfischer
Copy link
Member Author

@jumson FYI

@nfischer nfischer mentioned this pull request Jan 18, 2018
.eslintrc.json Outdated
"consistent-return": "off",
"no-mixed-operators": "off",
"no-prototype-builtins": "off",
"no-multiple-empty-lines": ["error", { "max": 2, "maxEOF": 0 } ],
Copy link
Member Author

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:

shelljs/src/tempdir.js

Lines 25 to 29 in 902e49c

}
//@
//@ ### tempdir()

and

shelljs/src/test.js

Lines 17 to 21 in 902e49c

});
//@
//@ ### test(expression)

Copy link
Contributor

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

.eslintrc.json Outdated
"consistent-return": "off",
"no-mixed-operators": "off",
"no-prototype-builtins": "off",
"no-multiple-empty-lines": ["error", { "max": 2, "maxEOF": 0 } ],
Copy link
Contributor

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.

@nfischer
Copy link
Member Author

PTAL

@freitagbr
Copy link
Contributor

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants