Skip to content
This repository has been archived by the owner on May 19, 2018. It is now read-only.

Should we allow Flowtype import type statements when sourceType:script? #726

Closed
loganfsmyth opened this issue Sep 18, 2017 · 2 comments · Fixed by #771
Closed

Should we allow Flowtype import type statements when sourceType:script? #726

loganfsmyth opened this issue Sep 18, 2017 · 2 comments · Fixed by #771
Labels
Milestone

Comments

@loganfsmyth
Copy link
Member

We don't currently, but I'm thinking we should?

Flowtype doesn't seem to have a concept of sourceType. It just accepts import statements as normal statements, and doesn't worry about the grammar differences. I don't think we can go that far since Babel needs to follow to ECMA spec for parsing, but we could potentially allow import type {Foo} from ''; statements since import type is Flow-specific. We should double-check this with someone working on Flow ideally, but it seems to be the case from what I can tell.

Not sure is this is a concern for Typescript too.

Important since I'd like to nail down our approach to parsing in babel/babel#6242

@loganfsmyth loganfsmyth added this to the 7.0.0 milestone Sep 18, 2017
@loganfsmyth
Copy link
Member Author

cc @samwgoldman

@loganfsmyth
Copy link
Member Author

@avikchaudhuri Do you happen to know if the Flow team has an opinion on this? My assumption is that Flow doesn't really care whether JS considers a file an ES6 module or a CommonJS module, but it'd be good to get an official confirmation so we don't risk affecting things further in the future.

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

Successfully merging a pull request may close this issue.

2 participants