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: extend prefer-const fixer range to whole declaration (fixes #13899) #14033
Conversation
I'm not sure why the test case is failing although it is correctly converting eslint-prefer-const.mp4 |
There are overlapping ranges now, so the fixes cannot be applied in the same pass.
const someFunc = () => { let a = 1, b = 2; foo(a, b) } and compares the result of that single pass with the provided Before this change, the ranges were not overlapping, so both
|
The solution is to change the output in the failing test case, to: output: "const someFunc = () => { let a = 1, b = 2; foo(a, b) }" and it would be nice to also leave a comment that the inner |
Thanks for the explanation @mdjermanovic.
I have updated the test case 🚀 |
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!
Thanks for contributing! |
@mdjermanovic Thanks for your review and help. Can you point me towards some more beginner-friendly issues where I can help? |
Prerequisites checklist
What is the purpose of this pull request? (put an "X" next to an 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:
What changes did you make? (Give an overview)
Fixes #13899
Is there anything you'd like reviewers to focus on?