-
-
Notifications
You must be signed in to change notification settings - Fork 714
fix(lint/noUnassignedVariables): handle JSX ref attribute assignments #7000
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(lint/noUnassignedVariables): handle JSX ref attribute assignments #7000
Conversation
🦋 Changeset detectedLatest commit: ed3684f The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
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 |
6766466
to
05c4ee5
Compare
05c4ee5
to
cd7b464
Compare
cd7b464
to
ed3684f
Compare
Hmm, I don't think this PR causes the test failure, it can be a flaky test. Let's ignore it for now. |
Thanks for confirming! I'll mark this as ready for review then. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you
With the "fix", this now flags use of JSX refs under noParameterAssign |
@timtucker-dte can confirm, posted here #6795 (comment) |
…ignments (biomejs#7000)" This reverts commit 4021165.
Summary
Closes #6795
The
noUnassignedVariables
rule was incorrectly flagging variables used in JSXref
attributes asunassigned. This occurred because JSX ref attributes were not being recognized as write references in the
semantic analyzer.
This PR fixes the issue by adding proper detection for JSX ref attribute usage, ensuring that variables
assigned to
ref
props are correctly tracked as write references.Test Plan
Added test cases in
crates/biome_js_analyze/tests/specs/nursery/noUnassignedVariables/valid.jsx
to verifythat JSX ref attributes are correctly handled:
The snapshot test confirms that no diagnostic is generated for this valid usage pattern.
Docs
no-unassigned-variables