Skip to content
This repository was archived by the owner on Jan 19, 2019. It is now read-only.

False positive no-unused-vars with string enum #582

Closed
micaelmbagira opened this issue Dec 19, 2018 · 5 comments
Closed

False positive no-unused-vars with string enum #582

micaelmbagira opened this issue Dec 19, 2018 · 5 comments
Labels

Comments

@micaelmbagira
Copy link

What version of TypeScript are you using?
^3.1.6

What version of typescript-eslint-parser are you using?
^21.0.2

What code were you trying to parse?

export enum State {
  START = 'start',
  END = 'end',
}

console.log(State.START)

What did you expect to happen?
No errors

What happened?
I have the following error

  2:3  error  'START' is assigned a value but never used  no-unused-vars
  3:3  error  'END' is assigned a value but never used    no-unused-vars
@platinumazure
Copy link
Member

Hi @micaelmbagira, thanks for the issue.

Looks like we have a potential PR to fix here: #558

But there's also some discussion about the best way to fix (and whether this should be handled in eslint-plugin-typescript).

@armano2
Copy link
Contributor

armano2 commented Dec 19, 2018

@platinumazure we are already have code for this in eslint-plugin-typescript

@micaelmbagira
Copy link
Author

@platinumazure I am using eslint-plugin-typescript^0.14.0

@armano2
Copy link
Contributor

armano2 commented Dec 23, 2018

@micaelmbagira there was release of version 1.0.0-rc.0 of eslint-plugin-typescript you should consider upgrading :)

@micaelmbagira
Copy link
Author

Solved by using eslint-plugin-typescript^1.0.0-rc.0

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants