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 parse error when using named import "as" with flow parser #13659

Merged

Conversation

doing-art
Copy link
Contributor

@doing-art doing-art commented Aug 9, 2021

Q                       A
Fixed Issues? Fixes #13520
Patch: Bug Fix? 👍
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? 👍
Documentation PR Link
Any Dependency Changes?
License MIT

Update logic of the parseImportSpecifier function in the flow parser plugin to fix the issue #13520. Add related tests.

@babel-bot
Copy link
Collaborator

babel-bot commented Aug 9, 2021

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/48089/

@nicolo-ribaudo nicolo-ribaudo added PR: Bug Fix 🐛 A type of pull request used for our changelog categories and removed PR: Spec Compliance 👓 A type of pull request used for our changelog categories labels Aug 9, 2021
Copy link
Member

@fedeci fedeci left a comment

Choose a reason for hiding this comment

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

Can you add a test for

import { type foo as as } from 'name'

@codesandbox-ci
Copy link

codesandbox-ci bot commented Aug 10, 2021

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 833f8ee:

Sandbox Source
babel-repl-custom-plugin Configuration
babel-plugin-multi-config Configuration

Copy link
Member

@fedeci fedeci left a comment

Choose a reason for hiding this comment

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

Thanks!

Copy link
Member

@nicolo-ribaudo nicolo-ribaudo left a comment

Choose a reason for hiding this comment

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

Awesome!

@nicolo-ribaudo nicolo-ribaudo merged commit 1229336 into babel:main Aug 10, 2021
sosukesuzuki added a commit to sosukesuzuki/prettier that referenced this pull request Aug 18, 2021
sosukesuzuki added a commit to prettier/prettier that referenced this pull request Aug 18, 2021
* Add tests for babel/babel#13659

* Add tests for babel/babel#13655

* Add tests for babel/babel#13645

* Update tests
fisker pushed a commit to prettier/prettier that referenced this pull request Aug 18, 2021
* Build(deps): Bump @babel/parser from 7.15.2 to 7.15.3

Bumps [@babel/parser](https://github.com/babel/babel/tree/HEAD/packages/babel-parser) from 7.15.2 to 7.15.3.
- [Release notes](https://github.com/babel/babel/releases)
- [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md)
- [Commits](https://github.com/babel/babel/commits/v7.15.3/packages/babel-parser)

---
updated-dependencies:
- dependency-name: "@babel/parser"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Add tests for `@babel/parser` 7.15.3 (#11366)

* Add tests for babel/babel#13659

* Add tests for babel/babel#13655

* Add tests for babel/babel#13645

* Update tests

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sosuke Suzuki <aosukeke@gmail.com>
@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 Nov 10, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: flow 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Parse error when using named import "as" with babel-plugin-transform-flow-strip-types
4 participants