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
Fix: Newline before eof when creating config via --init #12952
Fix: Newline before eof when creating config via --init #12952
Conversation
e5a736b
to
c12dda4
Compare
I'm not sure this is a bugfix, but seems reasonable to be consistency with |
Text files that don't end with a newline are annoying to work with, and most editors will immediately fix it up when editing the file, causing needless churn. That was how I noticed: papandreou/esquery@cd2bbbf 😅 So I really think it is a bug fix, and not just a matter of being consistent with |
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.
I like changing this to be more consistent. Can you please add a test that verifies this change?
@nzakas, sure! I added a test now. |
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.
LGTM, thanks! Leaving open to get some more eyes on this.
Thanks for contributing to ESLint! |
* Fix: Newline before eof when creating config via --init * Add test * Make a dedicated test (with a bit of duplication)
Prerequisites checklist
What is the purpose of this pull request? (put an "X" next to an item)
What changes did you make? (Give an overview)
Include a newline character before EOF when writing out a .js or .json-based config in
eslint --init
. Previously only the .yaml mode did this.