Skip to content
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

fix: report missing plugins on type exports #11417

Merged
merged 3 commits into from Apr 14, 2020

Conversation

JLHwung
Copy link
Contributor

@JLHwung JLHwung commented Apr 13, 2020

Q                       A
Fixed Issues? Fixes #7954, closes #8080, fixes #11331
Patch: Bug Fix? Yes
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

This PR throws more helpful errors on type exports supported by both Flow and TypeScript

export type Foo = number;

It is also considered as a bug fix as type exports should never be considered as exportDefault from clause.

To simplify the parser logic, the current approach does not warn missing flow helpers for the following pedantic case:

export type from = number;

which means it will still throw missing exportDefaultFrom plugins though it is a valid type exports. I think this situation still acceptable and practically only those flow codes with such statements as the first one will trigger this issue.

@JLHwung JLHwung added PR: Polish 💅 A type of pull request used for our changelog categories PR: Bug Fix 🐛 A type of pull request used for our changelog categories pkg: parser labels Apr 13, 2020
Copy link
Member

@hzoo hzoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Is this something where we want another message to enable the correct presets like the missing syntax plugins map thing we have?

Co-Authored-By: Brian Ng <bng412@gmail.com>
@nicolo-ribaudo nicolo-ribaudo merged commit a466f9c into babel:master Apr 14, 2020
@nicolo-ribaudo nicolo-ribaudo deleted the fix-7954 branch April 14, 2020 13:23
@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Jul 15, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: parser PR: Bug Fix 🐛 A type of pull request used for our changelog categories PR: Polish 💅 A type of pull request used for our changelog categories
Projects
None yet
4 participants