-
-
Notifications
You must be signed in to change notification settings - Fork 722
docs(linter): Add documentation on ignoreRestSiblings option for no-unused-vars rule
#14807
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
docs(linter): Add documentation on ignoreRestSiblings option for no-unused-vars rule
#14807
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. |
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.
Pull Request Overview
Adds documentation for the ignoreRestSiblings option in the eslint/no-unused-vars rule, clarifying its behavior with object rest properties.
- Documents the option type and default.
- Provides an example demonstrating flagged vs allowed usage based on the option.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: howen <108785851+howenyap@users.noreply.github.com>
camc314
left a comment
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.
I just realized, we already have the options documented here:
They just don't appear on the website because json schema isn't implemented for no unused vars. Would you be interested in working on this?
See c80da95 for an example of how this would work
BugSpent quite some time figuring out why the configuration documentation was not being generated, until I realised I was missing a comma here 🥲
CauseMacro quietly swallows remaining fields FixI have a fix to error on missing commas, should I add this in a seperate PR?
With the fix, it shows missing commas on other rules as well, causing documentation to be generated incorrectly
Errorsmax depthconfig options are not generated link bad bitwise operator"An auto-fix is still under development." is not rendered like in misrefactored assign op (cmiiw) link forward ref uses ref |
|
Good point about the problem with the lack of commas, I'd definitely recommend opening the PR to fix that! I only avoided it so far because I'm neurotic about including commas, ha |
) Related to [this](#14807 (comment)) issue where missing commas in `declare_oxc_lint!` would cause documentation to be generated wrongly without erroring. In the image below, there is no warning about the missing comma after `dangerou_suggestion`, this causes `config` to not be generated in the documentation. <img width="436" height="196" alt="image" src="https://github.com/user-attachments/assets/0d40bc12-15e2-48a7-813b-62b61aafc718" /> With the fix, users will be notified about the missing comma. <img width="436" height="196" alt="image" src="https://github.com/user-attachments/assets/ca75fb69-ce08-4de0-9cc0-7332a11a5e55" />
camc314
left a comment
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 both!
CodSpeed Performance ReportMerging #14807 will not alter performanceComparing Summary
Footnotes
|







Explains the
ignoreRestSiblingsconfig option for the no unused vars rule.Related to this issue.