Skip to content

fix(lint/noUnusedPrivateClassMembers): improve member usage check#7103

Merged
arendjr merged 4 commits intobiomejs:mainfrom
omasakun:fix/6933
Aug 5, 2025
Merged

fix(lint/noUnusedPrivateClassMembers): improve member usage check#7103
arendjr merged 4 commits intobiomejs:mainfrom
omasakun:fix/6933

Conversation

@omasakun
Copy link
Copy Markdown
Contributor

@omasakun omasakun commented Aug 5, 2025

Summary

This PR fixes #6933 and #6994.

When the values of private member assignment expressions, increment expressions, etc. are used, those private members are no longer marked as unused.

Test Plan

Additional test cases have been added.

Docs

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Aug 5, 2025

🦋 Changeset detected

Latest commit: 73d1f50

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 13 packages
Name Type
@biomejs/biome Patch
@biomejs/cli-win32-x64 Patch
@biomejs/cli-win32-arm64 Patch
@biomejs/cli-darwin-x64 Patch
@biomejs/cli-darwin-arm64 Patch
@biomejs/cli-linux-x64 Patch
@biomejs/cli-linux-arm64 Patch
@biomejs/cli-linux-x64-musl Patch
@biomejs/cli-linux-arm64-musl Patch
@biomejs/wasm-web Patch
@biomejs/wasm-bundler Patch
@biomejs/wasm-nodejs Patch
@biomejs/backend-jsonrpc Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions Bot added A-Linter Area: linter L-JavaScript Language: JavaScript and super languages labels Aug 5, 2025
Copy link
Copy Markdown
Contributor

@arendjr arendjr left a comment

Choose a reason for hiding this comment

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

Thanks! Do you want to add a changeset still?

Comment on lines +221 to +222
/// return this.#val++; // increment expression used as return value
/// return this.#val = 1; //assignment used as expression
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
/// return this.#val++; // increment expression used as return value
/// return this.#val = 1; //assignment used as expression
/// return this.#val++; // increment expression used as return value
/// return this.#val = 1; // assignment used as expression

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented Aug 5, 2025

CodSpeed Performance Report

Merging #7103 will not alter performance

Comparing omasakun:fix/6933 (73d1f50) with main (29fcb05)

Summary

✅ 128 untouched benchmarks

@arendjr arendjr merged commit 80515ec into biomejs:main Aug 5, 2025
30 checks passed
@github-actions github-actions Bot mentioned this pull request Aug 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Linter Area: linter L-JavaScript Language: JavaScript and super languages

Projects

None yet

Development

Successfully merging this pull request may close these issues.

💅 False error (or at least a misleading one) - private class member never used

2 participants