Navigation Menu

Skip to content
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

Merged
merged 3 commits into from Mar 17, 2020

Conversation

papandreou
Copy link
Contributor

@papandreou papandreou commented Feb 22, 2020

Prerequisites checklist

  • I have read the contributing guidelines.
  • The team has reached consensus on the changes proposed in this pull request. If not, I understand that the evaluation process will begin with this pull request and won't be merged until the team has reached consensus.

What is the purpose of this pull request? (put an "X" next to an item)

  • Documentation update
  • Bug fix (template)
  • New rule (template)
  • Changes an existing rule (template)
  • Add autofixing to a rule
  • Add a CLI option
  • Add something to the core
  • Other, please explain:

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.

@eslint-deprecated eslint-deprecated bot added the triage An ESLint team member will look at this issue soon label Feb 22, 2020
@aladdin-add
Copy link
Member

I'm not sure this is a bugfix, but seems reasonable to be consistency with .yaml did.

@papandreou
Copy link
Contributor Author

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 .yaml.

Copy link
Member

@nzakas nzakas left a 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?

@papandreou
Copy link
Contributor Author

@nzakas, sure! I added a test now.

Copy link
Member

@nzakas nzakas left a 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.

@kaicataldo kaicataldo added bug ESLint is working incorrectly core Relates to ESLint's core APIs and features and removed triage An ESLint team member will look at this issue soon labels Mar 17, 2020
@kaicataldo kaicataldo added the accepted There is consensus among the team that this change meets the criteria for inclusion label Mar 17, 2020
@kaicataldo kaicataldo merged commit 7598cf8 into eslint:master Mar 17, 2020
@kaicataldo
Copy link
Member

Thanks for contributing to ESLint!

anikethsaha pushed a commit to anikethsaha/eslint that referenced this pull request Mar 23, 2020
* Fix: Newline before eof when creating config via --init

* Add test

* Make a dedicated test (with a bit of duplication)
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Sep 15, 2020
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Sep 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion bug ESLint is working incorrectly core Relates to ESLint's core APIs and features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants