Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[prefer-literal-enum] conflicts with @typescript-eslint/quotes set to backtick #2785

@radarsu

Description

@radarsu
  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.
  • I have read the FAQ and my problem is not listed.

Repro
With configuration:

    '@typescript-eslint/quotes': [`error`, `backtick`],
    '@typescript-eslint/prefer-literal-enum-member': `error`,

And enum:

export enum SomeEnum {
    first = `first`,
    second = `second`,
}

You get error Explicit enum value must only be a literal value (string, number, boolean, etc). because of backticks. Changing them to other quotes fixes issue, but then @typescript-eslint/quotes rule prompts with error.

Expected Result
No error, linter should accept backticks for enums explicit value.

Actual Result
Explicit enum value must only be a literal value (string, number, boolean, etc).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomerspackage: eslint-pluginIssues related to @typescript-eslint/eslint-plugin

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions