Skip to content

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

@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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy