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]: Invalid "Missing initializer in const declaration" error reported in .d.ts files #14871
Comments
Hey @michaldudak! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly. If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite. |
We should expose the babel.parseSync(source, {
configFile: false,
filename: "source.d.ts",
parserOpts: {
plugins: [
["typescript", { dts: true }]
]
}
}); |
@AnmolBansalDEV I saw in other issues that you are looking for a good first issue: this could be it!
We should do something similar for the {
"plugins": [["syntax-typescript", { "dts": true }]]
} |
Thank you @nicolo-ribaudo for suggesting! Right now, I'm traveling, I'll start working on this issue next week. Thank you for your cooperation! |
Awesome! I'm assigning this to you :) |
@nicolo-ribaudo I could help with this issue, if @AnmolBansalDEV doesn't mind |
Hi there , |
#14923 |
馃捇
How are you using Babel?
Programmatic API (
babel.transform
,babel.parse
)Input code
Configuration file name
No response
Configuration
No response
Current and expected behavior
After updating @babel/parser from 7.17.3 to 7.17.7, parsing .d.ts files, as shown above, fails with the following error:
The official TypeScript compiler does not complain about this sample code.
Environment
System:
OS: Windows 10 10.0.19044
Binaries:
Node: 16.17.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
npm: 8.15.0 - ~\node_modules.bin\npm.CMD
npmPackages:
@babel/core: ^7.18.13 => 7.18.13
@babel/plugin-syntax-typescript: 7.16.7 => 7.16.7
Possible solution
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: