-
Notifications
You must be signed in to change notification settings - Fork 10
Add rules to detect unmerged className and event handlers with spread props #441
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
Conversation
⚠️ No Changeset found
Latest commit: 8c82c53
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
Co-authored-by: siddharthkp <1863771+siddharthkp@users.noreply.github.com>
Co-authored-by: siddharthkp <1863771+siddharthkp@users.noreply.github.com>
Co-authored-by: siddharthkp <1863771+siddharthkp@users.noreply.github.com>
Not high priority right now and might need more time from me, going to unassign myself. Going to let the draft PR stay in case someone else has appetite for it
Uh oh!
There was an error while loading. Please reload this page.
Follow-up to #437. When spread props appear before
classNameor event handlers, the spread values get silently overridden unless explicitly merged. This implements detection for these cases.Changes
New Rules
merge-spread-props-classname: DetectsclassNameafter spread props without mergingclsx,classnames,classNames,cnclsx(rest.className, value)merge-spread-props-event-handlers: Detects event handlers after spread props without mergingonClick,onChange, etc.)compose,composeEventHandlers,composeHandlerscompose(rest.handlerName, handler)Smart Detection
Both rules only trigger when:
Example
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.