-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Closed
Labels
i: questionoutdatedA 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
When a class is defined like:
class Foo {
bar!: string
}And the typescript preset + class-properties is applied the generated code ends up including that property set to void 0 which differs from TypeScript.
class Foo {
constructor() {
this.bar = void 0;
}
}Input Code
https://github.com/aaronjensen/typescript-babel-repro
Expected behavior/code
It should not emit the property unless it has an assignment.
class Foo {
}Babel Configuration (.babelrc, package.json, cli command)
Note: loose is not important--the bug exists either way. It just simplifies the output.
{
"presets": ["@babel/preset-typescript"],
"plugins": [
[
"@babel/plugin-proposal-class-properties", { "loose": true }
]
]
}Environment
- Babel version(s): v7.0.0-beta.47
- Node/npm version: Node 8/yarn 1.6.0
- OS: macOS 10.13.4
- Monorepo: no
- How you are using Babel: repro cli, project loader
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
i: questionoutdatedA 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