eBay / eslint-config-ebay

MIT License
13 stars 11 forks source link

Proposal: Enforce no-multiple-empty-lines max:1 #10

Closed yomed closed 6 years ago

yomed commented 6 years ago

https://eslint.org/docs/rules/no-multiple-empty-lines

This rule allows enforcing the max number of empty lines in general, as well as at the beginning and end of files. I think enforcing a single line at the end of the file (maxEOF: 1) isn't too controversial. Many coding styles also limit the number of consecutive empty lines in a file to 1, but I don't know if some people might specifically use consecutive empty lines to signify something.

Edit: Oops, I see maxEOF: 1 is already enforced. What are your thoughts on enforcing max: 1?

senthilp commented 6 years ago

I like the proposal. I assume the max: 1 will take care of both BOF and EOF right? @mikewoo200 @mwoo what do you think?

mikewoo200 commented 6 years ago

I am fine with it. I sometimes see multiple blank lines in the code and ask for it to be removed, so far, every time, it's an oversight rather than used as a marker. For markers, I think adding comments would be better, as blank-line markers may be removed by other developers if they work on the code.

max: 1 will take care of both BOF and EOF.

@yomed Can you file a PR?

@senthilp Would this warrant a major, minor, or patch version? (This is a breaking change but can be auto-fixed by --fix in eslint.)

yomed commented 6 years ago

@mikewoo200 Sure, I've created a PR here https://github.com/eBay/eslint-config-ebay/pull/11

senthilp commented 6 years ago

@mikewoo200 unless we are removing a rule, everything else might break builds. Let's make it a major version upgrade, to stick with SemVer.

mikewoo200 commented 6 years ago

https://github.com/eBay/eslint-config-ebay/releases/tag/release-1.0.0

Published eslint-config-ebay@1.0.0

http://registry.npmjs.com/eslint-config-ebay