Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
nstepien opened this issue Feb 17, 2020 · 2 comments
Closed

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

nstepien opened this issue Feb 17, 2020 · 2 comments
Labels
enhancement: plugin rule option New rule option for an existing eslint-plugin rule package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@nstepien
Copy link
Contributor

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
@nstepien nstepien added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for maintainers to take a look labels Feb 17, 2020
@bradzacher bradzacher added enhancement: plugin rule option New rule option for an existing eslint-plugin rule and removed triage Waiting for maintainers to take a look labels Feb 17, 2020
@glen-84
Copy link
Contributor

glen-84 commented Jul 22, 2020

Should this issue be closed? (#2291)

@nstepien
Copy link
Contributor Author

Looks like it works, thanks! 👍

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement: plugin rule option New rule option for an existing eslint-plugin rule package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
Development

No branches or pull requests

3 participants