-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Support for Flowtype import/exports #123
Conversation
…/18/Import-Types.html) when using babel-eslint parser. Currently any `import type SomeType from './types'` is marked as import, but its counterpart `export type SomeType` is ignored. Therefore, all those imports were marked as issue by rule `import/named`. This pull request adds the type exports to the list of named exports fixing this issue. Alternatively, if this behavior is not desired, `ImportDeclaration`s with `n.importType === 'type'` should be ignored in order to be symmetric.
Test failed before already. Give me a hint if you'd be willing to merge and need me to make any changes. |
Ah, cool! I am not using Flow yet, didn't realize it was flagged as a different type. You're right about the tests: had a different issue from ESLint 1.10 that I just fixed in Could you add some tests? Normally for new syntax I create a new file in the If not, let me know and I'll try to bang a few out at some point. Not sure when, though, currently trying to get the Webpack resolver shipped this week. 😅 |
I will give it a shot. Do the tests already use |
If you search for "babel-eslint" in the tests folder, you should find some examples. The --Ben
|
Sorry, premature send. The dependency parser is pure Babylon by default; it will need to be configured for Flow by adding the |
I added tests using
Unfortunately, I could not get |
Btw. Flowtype does not support |
Ah, yeah, so the plugin test issues were also related to ESLint 1.10 freezing settings. I fixed, added tests, and rebased + committed to master. Thanks for this! BTW: also added the ability to infer Flow plugin for default Babylon dependency parser via setting Closing this since it's merged via rebase. Thanks again! 😄 |
Add support for Flowtype import/exports (http://flowtype.org/blog/2015/02/18/Import-Types.html) when using babel-eslint parser.
Currently any
import type SomeType from './types'
is marked as import, but its counterpartexport type SomeType
is ignored. Therefore, all those imports were marked as issue by ruleimport/named
. This pull request adds the type exports to the list of named exports fixing this issue.Alternatively, if this behavior is not desired,
ImportDeclaration
s withn.importType === 'type'
should be ignored in order to be symmetric. If you prefer this solution give me a hint and I'll create another pull request.Nice plugin, btw ;-)