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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Weird AST for as
in ArrayPattern
#14498
Comments
One more test case: |
Thanks! An even simpler reproduction is |
Turns out |
More things that are accepted by TS, but not by Babel:
|
Another one, that is accepted by Babel but not TS: |
This is fun |
Speaking of Also I've just realized that destructurings in ES can be used in the middle of assignment chains: |
Fun fact: |
Yeah an assignment expression is perfectly valid RHS. The transform spent some efforts preserving the completion. |
馃捇
How are you using Babel?
Programmatic API (
babel.transform
,babel.parse
)Input code
Configuration file name
No response
Configuration
Current and expected behavior
current:
expected:
Environment
System:
OS: macOS 10.15.7
Binaries:
Node: 14.18.1 - ~/.nvm/versions/node/v14.18.1/bin/node
npm: 6.14.15 - ~/.nvm/versions/node/v14.18.1/bin/npm
npmPackages:
@babel/cli: ^7.17.0 => 7.17.0
@babel/core: ^7.17.0 => 7.17.8
@babel/eslint-config-internal: workspace:^ => 7.16.1
@babel/eslint-parser: workspace:^ => 7.17.0
@babel/eslint-plugin-development: workspace:^ => 7.17.7
@babel/eslint-plugin-development-internal: workspace:^ => 7.17.7
@babel/plugin-proposal-dynamic-import: ^7.16.7 => 7.16.7
@babel/plugin-proposal-export-namespace-from: ^7.16.7 => 7.16.7
@babel/plugin-proposal-object-rest-spread: ^7.16.7 => 7.16.7
@babel/plugin-transform-modules-commonjs: ^7.16.8 => 7.16.8
@babel/plugin-transform-runtime: ^7.17.0 => 7.17.0
@babel/preset-env: ^7.16.11 => 7.16.11
@babel/preset-flow: ^7.16.7 => 7.16.7
@babel/preset-typescript: ^7.16.7 => 7.16.7
@babel/runtime: ^7.17.0 => 7.17.0
babel-plugin-transform-charcodes: ^0.2.0 => 0.2.0
eslint: ^8.9.0 => 8.9.0
jest: ^27.4.0 => 27.4.0
Possible solution
No response
Additional context
prettier/prettier#12706
The text was updated successfully, but these errors were encountered: