fix: include variable name in no-useless-assignment message by sethamus · Pull Request #20581 · eslint/eslint (original) (raw)
Prerequisites checklist
- I have read the contributing guidelines.
AI acknowledgment
- I did not use AI to generate this PR.
- (If the above is not checked) I have reviewed the AI-generated content before submitting.
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 autofix to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:
What changes did you make? (Give an overview)
This PR improves no-useless-assignment reports by including the assigned identifier name in the message (e.g.The value assigned to 'v' is not used in subsequent statements.), which makes it easier to triage multiple occurrences in a file.
Fixes #20572