Skip to content

[naming-convention] Allow selecting only const variablesΒ #1612

Closed
@nstepien

Description

@nstepien

Repro

{
  "rules": {
    "@typescript-eslint/naming-convention": [1,
      { "selector": "variable", "format": ["camelCase", "PascalCase"] },
      // { "selector": "variable", "modifiers": "const", "format": ["camelCase", "PascalCase", "UPPER_CASE"] }
    ]
  }
}
const CONSTANT_NUMBER = 1;

Expected Result
I should be able to allow UPPER_CASE for consts only.

Actual Result
I can't narrow down the variable selector.

Additional Info

Versions

package version
@typescript-eslint/eslint-plugin 2.19.2
@typescript-eslint/parser 2.19.2
TypeScript 3.7.5
ESLint 6.8.0
node 13.8.0
npm 6.13.7

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