Skip to content

Update no-unused-vars rule to allow ignored args#54

Open
morreman wants to merge 1 commit intomasterfrom
unused-vars-suggestion
Open

Update no-unused-vars rule to allow ignored args#54
morreman wants to merge 1 commit intomasterfrom
unused-vars-suggestion

Conversation

@morreman
Copy link
Copy Markdown

Suggestion: do not allow an argument before the last argument to be unused. This enforces all parameters to be used.
Allowing to ignore the unused variable with _

// Not allowed
function foo(a, b, c) { // 'b' is declared but its value is never read.
  console.log(a, c);
}

// Allowed
function foo(a, _b, c) {
  console.log(a, c);
}

Suggestion: do not allow `function x (a, b, c) { console.log(a, c) }`
@morreman morreman requested a review from a team as a code owner March 12, 2026 09:11
@morreman
Copy link
Copy Markdown
Author

Reference PR https://github.com/BonnierNews/jetsam/pull/438 that made me do this PR.

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.

1 participant