Be well coding/Mine

TS 에서 interface , type 을 가져와서 사용할 때 Eslint error

be well 2020. 3. 8. 16:56

Type 을 선언하고 여러 파일에서 import 해서 사용할 때 ESlint error 발생 

 

문제는 typescript-eslint/no-unused-vars 가 단순히 태그 types와 interfaces(파일에서 가져 오거나 정의 된) 태그 

사용하더라도 사용되지 않는 것으로 표시한다는 것이였는데 해당 링크를 참조하여 해결

https://github.com/typescript-eslint/typescript-eslint/issues/46

 

Improve documentation for `typescript/no-unused-vars` · Issue #46 · typescript-eslint/typescript-eslint

There are several use cases typescript/no-unused-vars does not yet support, such as type declarations: type Foo = string; // unexpected error const foo: Foo = 'foo'; Would it be possible to...

github.com