Skip to content

feat(react-x): add 'no-unused-props' rule #1161

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

Draft
wants to merge 8 commits into
base: 2.0.0-beta
Choose a base branch
from

Conversation

ulrichstark
Copy link

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Docs
  • Test
  • New Binding issue #___
  • Code style update
  • Refactor
  • Build-related changes
  • Other, please describe:

Does this PR introduce a breaking change?

  • Yes, and the changes were approved in issue #___
  • No

Checklist

  • When resolving issues, they are referenced in the PR's title (e.g fix: remove a typo, closes #___, #___)
  • I have added a convincing reason for adding this feature, if necessary

Other information

A pull request of a TypeScript type only version no-unused-prop-types is welcome.
#85 (comment)

Copy link

vercel bot commented Jul 21, 2025

@ulrichstark is attempting to deploy a commit to the Rel1cx's projects Team on Vercel.

A member of the Team first needs to authorize it.

@ulrichstark
Copy link
Author

Hey @Rel1cx, I'm already making better progress than expected on this rule. As you can see, four basic invalid and four basic valid tests are already passing. Before continuing I wanted to confirm that the direction I'm going matches your expectation of this rule.

The most important question right now is if I should count prop keys as used if they are destructered/accessed from the props object, but NOT used after that (in JSX for example). I would decide for no, because that case is already covered by https://eslint.org/docs/latest/rules/no-unused-vars. See my valid tests for reference. They currently pass because destructuring from the props object is enough to be counted as used.

Some other decisions I made so far:

  • Rule features are TSC and EXP
  • Added my rule to all and x config
  • Added my rule to recommended config, but commented out

If you notice anything incorrect in my current changes, feel free to point that out or change it to your desire.

@Rel1cx
Copy link
Owner

Rel1cx commented Jul 23, 2025

I would decide for no, because that case is already covered by https://eslint.org/docs/latest/rules/no-unused-vars

You are right. This aligns with our philosophy: Each rule should have a single purpose. Make multiple rules work together to achieve more complex behaviors.

So far so good, Thanks for the amazing work!

Copy link

vercel bot commented Jul 23, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
eslint-react ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 25, 2025 3:50am

Signed-off-by: Ulrich Stark <github@ustark.de>
Signed-off-by: REL1CX <dokimondex@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants