-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Closed
Labels
outdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issue
Description
Bug Report
Current Behavior
Passing allowNamespaces in @babel/preset-typescript do nothing
Expected behavior/code
allowNamespaces option should be passed to @babel/plugin-transform-typescript
Babel Configuration (.babelrc, package.json, cli command)
module.exports = {
presets: [
[
'@babel/preset-env',
{
targets: {
browsers: ['last 2 versions']
},
modules: false
}
],
// This is not passing `allowNamespaces` to plugin, result in throwing namespace error
// ['@babel/preset-typescript', { isTSX: true, allExtensions: true, allowNamespaces: true }],
'@babel/preset-react'
],
plugins: [
// This works as expected
['@babel/plugin-transform-typescript', { isTSX: true, allExtensions: true, allowNamespaces: true }],
['@babel/plugin-proposal-decorators', { legacy: true }],
'@babel/plugin-proposal-class-properties',
'@babel/plugin-proposal-object-rest-spread',
'lodash',
[
'@babel/plugin-transform-runtime',
{
helpers: false,
regenerator: true
}
]
],
env: {
test: {
presets: [
[
'@babel/preset-env',
{
modules: 'auto'
}
],
'@babel/preset-typescript',
'@babel/preset-react'
]
}
}
};Environment
- Babel version(s):
"@babel/core": "7.5.5",
"@babel/plugin-proposal-class-properties": "7.5.5",
"@babel/plugin-proposal-decorators": "7.4.4",
"@babel/plugin-proposal-object-rest-spread": "7.5.5",
"@babel/plugin-transform-regenerator": "7.4.5",
"@babel/plugin-transform-runtime": "7.5.5",
"@babel/plugin-transform-typescript": "7.5.5",
"@babel/preset-env": "7.5.5",
"@babel/preset-react": "7.0.0",
"@babel/preset-typescript": "7.3.3",
"@babel/register": "7.5.5"
- Node/npm version: Node 8.15/yarn 1.17.3
- OS: OSX latest
- Monorepo: Yarn Workspaces
- How you are using Babel: loader
Possible Solution
Adjust preset code to pass missing option.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
outdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issue