Skip to content

[@typescript-eslint/indent] False positives in enums #1701

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

Closed
neurolag opened this issue Mar 7, 2020 · 2 comments
Closed

[@typescript-eslint/indent] False positives in enums #1701

neurolag opened this issue Mar 7, 2020 · 2 comments
Labels
bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin

Comments

@neurolag
Copy link
Contributor

neurolag commented Mar 7, 2020

Repro

{
  "rules": {
    "@typescript-eslint/indent": "warn"
  }
}
export enum LogLevel {
    Info,
    Warning
}

export enum LogLevel
{ // Expected indentation of 4 spaces but found 0. (@typescript-eslint/indent)
    Info,
    Warning
}

Expected Result
Both examples should work as expected.

Actual Result
An error is reported in the second example.

Versions

package version
@typescript-eslint/eslint-plugin 2.22.1-alpha.6
@typescript-eslint/parser 2.22.0
TypeScript 3.8.3
ESLint 6.8.0
node v12.4.0
npm 6.9.0
@neurolag neurolag added package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin triage Waiting for team members to take a look labels Mar 7, 2020
@bradzacher bradzacher added bug Something isn't working and removed triage Waiting for team members to take a look labels Mar 7, 2020
@bradzacher bradzacher added this to the indent rewrite milestone Mar 7, 2020
@bradzacher
Copy link
Member

recommendation for this an #1700 is to not use the rule.
It's very broken, and unlikely to get fixed due to the huge complexity in the rule.
You should consider using a tool like prettier instead.

@bradzacher
Copy link
Member

Merging into #1824

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working package: eslint-plugin Issues related to @typescript-eslint/eslint-plugin
Projects
None yet
Development

No branches or pull requests

2 participants