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: unicode-bom fixer insert BOM in appropriate location (fixes #8083) #8084

Merged
merged 2 commits into from Feb 16, 2017

Conversation

pantosha
Copy link
Contributor

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

[ ] Documentation update
[x] 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:

See issue #8083

What changes did you make? (Give an overview)
Insert BOM at specific location using fixer.insertTextBeforeRange() instead before node. Because node range doesn't include comments.

Is there anything you'd like reviewers to focus on?
nothing

@mention-bot
Copy link

@pantosha, thanks for your PR! By analyzing the history of the files in this pull request, we identified @ehjay, @kaicataldo and @pedrottimark to be potential reviewers.

@jsf-clabot
Copy link

jsf-clabot commented Feb 15, 2017

CLA assistant check
All committers have signed the CLA.

@eslintbot
Copy link

LGTM

@mysticatea mysticatea added accepted There is consensus among the team that this change meets the criteria for inclusion bug ESLint is working incorrectly rule Relates to ESLint's core rules labels Feb 15, 2017
Copy link
Member

@mysticatea mysticatea left a comment

Choose a reason for hiding this comment

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

Thank you for contributing!

Implementation LGTM.
Could you add tests for this change?
The test file is here: https://github.com/eslint/eslint/blob/c7e64f30de7aa56e6e0c00ffd1f9ab398920b0b1/tests/lib/rules/unicode-bom.js

@eslintbot
Copy link

LGTM

@pantosha
Copy link
Contributor Author

@mysticatea, please review again. I've added the test.

Copy link
Member

@not-an-aardvark not-an-aardvark 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!

Copy link
Member

@mysticatea mysticatea left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

@ilyavolodin ilyavolodin merged commit c53e034 into eslint:master Feb 16, 2017
@pantosha pantosha deleted the unicode-bom-fixer branch February 16, 2017 21:21
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 6, 2018
@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 Feb 6, 2018
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 rule Relates to ESLint's core rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants