Skip to content

linter: no-unused-vars should relax during destructured assingment #14764

@lukeed

Description

@lukeed

What version of Oxlint are you using?

1.23.0

What command did you run?

No response

What does your .oxlintrc.json config file look like?

{
  "plugins": [
    "oxc",
    "import",
    "promise",
    "typescript",
    "jsx-a11y",
    "unicorn"
    // "jsdoc"
  ],
  "categories": {
    "correctness": "error",
    "suspicious": "warn",
    "perf": "warn"
  },
  "rules": {
    "no-cond-assign": "off",
    "no-import-prefix": "off",
    "no-inner-declarations": "off",
    "no-namespace": "off",
    "no-var": "off",
    "prefer-const": "off"
  },
}

What happened?

with input like this, password should not be reporting a no-unused-vars error. Its definition / extraction serves a purpose.

let { password, ...profile } = user;
return Response.json(profile);

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions