Skip to content

Conversation

@howenyap
Copy link
Contributor

Explains the ignoreRestSiblings config option for the no unused vars rule.

Related to this issue.

Copilot AI review requested due to automatic review settings October 20, 2025 10:51
@howenyap howenyap requested a review from camc314 as a code owner October 20, 2025 10:51
@graphite-app
Copy link
Contributor

graphite-app bot commented Oct 20, 2025

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

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.

@github-actions github-actions bot added A-linter Area - Linter C-docs Category - Documentation. Related to user-facing or internal documentation labels Oct 20, 2025
Copy link
Contributor

Copilot AI left a 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>
Copy link
Contributor

@camc314 camc314 left a 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:

https://github.com/Boshen/oxc/blob/9cd7a6777aef0a7816a372fdf4de88e2abdda8e7/crates/oxc_linter/src/rules/eslint/no_unused_vars/options.rs#L113-L134

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

@howenyap
Copy link
Contributor Author

Bug

Spent quite some time figuring out why the configuration documentation was not being generated, until I realised I was missing a comma here 🥲

image

Cause

Macro quietly swallows remaining fields
image

Fix

I have a fix to error on missing commas, should I add this in a seperate PR?

image

With the fix, it shows missing commas on other rules as well, causing documentation to be generated incorrectly

image

Errors

max depth

config options are not generated link
image

bad bitwise operator

"An auto-fix is still under development." is not rendered like in misrefactored assign op (cmiiw) link
image

forward ref uses ref

Duplicate field
image

@howenyap howenyap requested a review from camc314 October 21, 2025 07:04
@connorshea
Copy link
Collaborator

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

camc314 pushed a commit that referenced this pull request Oct 22, 2025
)

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 camc314 self-assigned this Oct 22, 2025
Copy link
Contributor

@camc314 camc314 left a comment

Choose a reason for hiding this comment

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

Thank you both!

@camc314 camc314 merged commit 3f1c3c7 into oxc-project:main Oct 22, 2025
20 checks passed
@codspeed-hq
Copy link

codspeed-hq bot commented Oct 22, 2025

CodSpeed Performance Report

Merging #14807 will not alter performance

Comparing howenyap:docs/no-unused-vars-ignoreRestSiblings (06e76f2) with main (1fcf56c)

Summary

✅ 4 untouched
⏩ 33 skipped1

Footnotes

  1. 33 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-linter Area - Linter C-docs Category - Documentation. Related to user-facing or internal documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants