-
-
Notifications
You must be signed in to change notification settings - Fork 209
Flow import type
counted as "defined but never used"
#108
Comments
import type
import type
counted as "defined but never used"
Ok thanks!. So I think I know how to fix this - do the same escope patching as for decorators. However there's some more places where flow types are used that could result in the same error right? We probably want to cover all of those as well? function log(foo): Foo { return 1; } // return
var foo: Foo = 1; // var decl I'l probably need to use the tests in https://github.com/babel/babel/blob/088846a3479375a51d71084cb4fd70ef8fa21d29/test/acorn/tests-flow.js then? Looks like a lot of places! |
Thanks @hzoo! |
I was hoping this would fix these lint errors: ``` /Users/glh/code/corpus/src/app/OperationsQueue.js 8:12 error Promise is defined but never used no-unused-vars /Users/glh/code/corpus/src/app/Repo.js 10:12 error Promise is defined but never used no-unused-vars ``` For reference, the usage sites look like this: ``` import type Promise from 'bluebird'; type Operation = () => Promise; ``` Alas, babel/babel-eslint#108 doesn't fix this particular case, although it does help with others (see the tests in the attached commit on that PR).
Still got this error 💊
|
I also had the same problem with version 8.2.1: |
Same issue here. 8.0.3 is fine
|
flow react warning type 'Props' is defined but never used no-unused-vars how handle? |
visit flow types - fixes babel/babel-eslint#108
Complains that
Foo
is "defined but never used" (no-unused-vars
).PR #89 was previously submitted but withdrawn to address this, but the problem's still there. Filing this issue to make sure we don't lose track of it.
The text was updated successfully, but these errors were encountered: