Skip to content

[naming-convention] Support destructured modifier for parameters #2828

@abacabadabacaba

Description

@abacabadabacaba

Currently, naming-convention rule supports destructured modifier only for variables. I propose to also support it for parameters.

Repro

{
  "rules": {
    "@typescript-eslint/naming-convention": ["error",
      {
        "selector": "parameter",
        "modifiers": ["destructured"],
        "format": ["camelCase"]
      }
    ]
  }
}
function foo({ aNameToBeChecked }: any) {
  // ...
}

Expected Result

The identifier aNameToBeChecked matches the rule.

Actual Result

The destructured modifier isn't supported with selector: "parameter", so it doesn't work.

Versions

This issue is currently present in the master branch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions