fix: include variable name in no-useless-assignment message by sethamus · Pull Request #20581 · eslint/eslint (original) (raw)

Prerequisites checklist

AI acknowledgment

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

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