Skip to content

Commit 0a04bf7

Browse files
committed
feat: support class properties
1 parent 67987b7 commit 0a04bf7

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

src/index.js

+4
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ module.exports = {
3030
loader: 'babel-loader-8',
3131
options: {
3232
plugins: [
33+
// Transpile class properties
34+
// @see https://github.com/typed-ember/ember-cli-typescript/blob/b2e75abc98beefe635b6cfd8808c887813acb44e/ts/addon.ts#L99
35+
require.resolve('@babel/plugin-proposal-class-properties'),
36+
3337
// Transpile new syntax, which is apparently not yet handled by
3438
// `@babel/preset-env`.
3539
// @see https://github.com/typed-ember/ember-cli-typescript/blob/b2e75abc98beefe635b6cfd8808c887813acb44e/ts/addon.ts#L89-L94

src/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"lint:js": "eslint --ext ts,js ."
1717
},
1818
"dependencies": {
19+
"@babel/plugin-proposal-class-properties": "^7.8.3",
1920
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.8.3",
2021
"@babel/plugin-proposal-optional-chaining": "^7.8.3",
2122
"@babel/preset-env": "^7.8.4",

tests/ts-module-b/some/nested-file.ts

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
export class Foo {
2+
bar = false;
3+
}
4+
15
const foo = { bar: { baz: undefined } };
26

37
export const works = foo.bar?.baz ?? (() => true);

0 commit comments

Comments
 (0)