Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: add suggestions for no-unused-private-class-members#20773

Merged
DMartens merged 5 commits into
eslint:mainfrom
sethamus:no-unused-private-class-members-suggestions
Apr 27, 2026
Merged

feat: add suggestions for no-unused-private-class-members#20773
DMartens merged 5 commits into
eslint:mainfrom
sethamus:no-unused-private-class-members-suggestions

Conversation

@sethamus
Copy link
Copy Markdown
Contributor

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
[ ] Bug fix (template)
[ ] New rule (template)
[x] 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 adds suggestions to no-unused-private-class-members for unused private fields and methods when the member can be safely removed.

Fixes #20516

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

@sethamus sethamus requested a review from a team as a code owner April 18, 2026 09:20
@eslint-github-bot eslint-github-bot Bot added the feature This change adds a new feature to ESLint label Apr 18, 2026
@github-project-automation github-project-automation Bot moved this to Needs Triage in Triage Apr 18, 2026
@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 18, 2026

Deploy Preview for docs-eslint ready!

Name Link
🔨 Latest commit da2253e
🔍 Latest deploy log https://app.netlify.com/projects/docs-eslint/deploys/69ee72fac0a9040008f47dd9
😎 Deploy Preview https://deploy-preview-20773--docs-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions Bot added the rule Relates to ESLint's core rules label Apr 18, 2026
@mdjermanovic mdjermanovic moved this from Needs Triage to Implementing in Triage Apr 18, 2026
@mdjermanovic mdjermanovic added the accepted There is consensus among the team that this change meets the criteria for inclusion label Apr 18, 2026
Comment thread lib/rules/no-unused-private-class-members.js Outdated
Comment thread lib/rules/no-unused-private-class-members.js
Comment thread lib/rules/no-unused-private-class-members.js Outdated
Comment thread lib/rules/no-unused-private-class-members.js Outdated
Comment thread lib/rules/no-unused-private-class-members.js
Comment thread lib/rules/no-unused-private-class-members.js Outdated
Comment thread lib/rules/no-unused-private-class-members.js Outdated
Comment thread tests/lib/rules/no-unused-private-class-members.js
Comment thread lib/rules/no-unused-private-class-members.js
Comment thread tests/lib/rules/no-unused-private-class-members.js
Copy link
Copy Markdown
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! I think that removing comments works good for common comment placements & code formatting, and reasonably well in edge case. Since these are suggestions, in edge cases where unwanted comments might be left in the code user can remove them manually after applying the suggested fix.

Leaving open for @DMartens to verify.

@mdjermanovic mdjermanovic moved this from Implementing to Second Review Needed in Triage Apr 27, 2026
Copy link
Copy Markdown
Contributor

@DMartens DMartens left a comment

Choose a reason for hiding this comment

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

Changes LGTM, thank you for working on this.

@DMartens DMartens merged commit 379571a into eslint:main Apr 27, 2026
43 checks passed
@github-project-automation github-project-automation Bot moved this from Second Review Needed to Complete in Triage Apr 27, 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 contributor pool feature This change adds a new feature to ESLint rule Relates to ESLint's core rules

Projects

Status: Complete

Development

Successfully merging this pull request may close these issues.

Rule Change: Add suggestion to remove unused member in no-unused-private-class-members

3 participants