Skip to content

Linting: Require unused function parameters to start with _#3561

Merged
mbg merged 1 commit intomainfrom
henrymercer/eslint-unused-vars
Mar 9, 2026
Merged

Linting: Require unused function parameters to start with _#3561
mbg merged 1 commit intomainfrom
henrymercer/eslint-unused-vars

Conversation

@henrymercer
Copy link
Contributor

The default setting for this lint rule doesn't check function parameters, but in our codebase we are often cleaning up code paths for older versions of GHES, therefore it's desirable to check whether something is being passed that we could possibly avoid computing in the first place.

@henrymercer henrymercer requested a review from a team as a code owner March 9, 2026 16:44
Copilot AI review requested due to automatic review settings March 9, 2026 16:44
@github-actions github-actions bot added the size/XS Should be very easy to review label Mar 9, 2026
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

Updates the repository’s ESLint configuration to enforce that all unused function parameters must be explicitly marked as unused by starting with _, helping identify unnecessary computed/propagated values (e.g., when cleaning up legacy GHES code paths).

Changes:

  • Configure @typescript-eslint/no-unused-vars to check all function parameters (args: "all").
  • Keep the existing underscore-based opt-out via argsIgnorePattern: "^_".

"@typescript-eslint/no-unused-vars": [
"error",
{
"args": "all",
Copy link
Member

Choose a reason for hiding this comment

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

Do you think that this is needed as of #3497 since it seemed to be working as expected before that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think that's likely, though I haven't checked.

@henrymercer henrymercer added this pull request to the merge queue Mar 9, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 9, 2026
@mbg mbg added this pull request to the merge queue Mar 9, 2026
Merged via the queue into main with commit babab88 Mar 9, 2026
248 checks passed
@mbg mbg deleted the henrymercer/eslint-unused-vars branch March 9, 2026 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XS Should be very easy to review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants