Skip to content

Commit

Permalink
fix: don't remove decorated definite class properties
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescdavis committed Feb 27, 2020
1 parent d63c680 commit 5e7a0d7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/babel-plugin-transform-typescript/src/index.js
Expand Up @@ -74,7 +74,9 @@ export default declare(
);
}

path.remove();
if (!node.decorators) {
path.remove();
}
} else if (!allowDeclareFields && !node.value && !node.decorators) {
path.remove();
}
Expand All @@ -84,6 +86,7 @@ export default declare(
if (node.readonly) node.readonly = null;
if (node.optional) node.optional = null;
if (node.typeAnnotation) node.typeAnnotation = null;
if (node.definite) node.definite = null;
},
method({ node }) {
if (node.accessibility) node.accessibility = null;
Expand Down

0 comments on commit 5e7a0d7

Please sign in to comment.