Skip to content

fix: include variable name in no-useless-assignment message#20581

Merged
lumirlumir merged 1 commit intoeslint:mainfrom
sethamus:no-useless-assignment-variable-name
Mar 3, 2026
Merged

fix: include variable name in no-useless-assignment message#20581
lumirlumir merged 1 commit intoeslint:mainfrom
sethamus:no-useless-assignment-variable-name

Conversation

@sethamus
Copy link
Contributor

@sethamus sethamus commented Mar 2, 2026

Prerequisites checklist

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

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

@sethamus sethamus requested a review from a team as a code owner March 2, 2026 17:44
@eslint-github-bot eslint-github-bot bot added the bug ESLint is working incorrectly label Mar 2, 2026
@github-project-automation github-project-automation bot moved this to Needs Triage in Triage Mar 2, 2026
@netlify
Copy link

netlify bot commented Mar 2, 2026

Deploy Preview for docs-eslint canceled.

Name Link
🔨 Latest commit 240bf72
🔍 Latest deploy log https://app.netlify.com/projects/docs-eslint/deploys/69a5cc942647b8000866340f

@github-actions github-actions bot added the rule Relates to ESLint's core rules label Mar 2, 2026
@mdjermanovic mdjermanovic added accepted There is consensus among the team that this change meets the criteria for inclusion contributor pool labels Mar 2, 2026
Copy link
Member

@mdjermanovic mdjermanovic 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 for couple days if anyone else would like to take a look.

@mdjermanovic mdjermanovic moved this from Needs Triage to Merge Candidates in Triage Mar 2, 2026
Copy link
Member

@lumirlumir lumirlumir 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!

@lumirlumir lumirlumir merged commit f4c9cf9 into eslint:main Mar 3, 2026
41 checks passed
@github-project-automation github-project-automation bot moved this from Merge Candidates to Complete in Triage Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accepted There is consensus among the team that this change meets the criteria for inclusion bug ESLint is working incorrectly contributor pool rule Relates to ESLint's core rules

Projects

Status: Complete

Development

Successfully merging this pull request may close these issues.

Change Request: no-useless-assign should log the variable assigned

3 participants