Skip to content

Commit

Permalink
fix flow-strip-types/flow-comments removing entire ClassProperty (#4587)
Browse files Browse the repository at this point in the history
  • Loading branch information
danharper authored and danez committed Sep 28, 2016
1 parent 5ea57d5 commit 8709899
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 1 deletion.
@@ -0,0 +1,5 @@
class X {
foo = 2
bar: number = 3
baz: ?string
}
@@ -0,0 +1,5 @@
class X {
foo = 2;
bar /*: number*/ = 3;
baz /*: ?string*/;
}
@@ -0,0 +1,6 @@
{
"plugins": [
"transform-flow-comments",
"syntax-class-properties"
]
}
@@ -0,0 +1,5 @@
class X {
foo = 2
bar: number = 3
baz: ?string
}
@@ -0,0 +1,4 @@
class X {
foo = 2;
bar = 3;
}
@@ -0,0 +1,6 @@
{
"plugins": [
"transform-flow-strip-types",
"syntax-class-properties"
]
}
2 changes: 1 addition & 1 deletion packages/babel-types/src/definitions/flow.js
Expand Up @@ -45,7 +45,7 @@ defineType("ClassImplements", {
defineType("ClassProperty", {
visitor: ["key", "value", "typeAnnotation", "decorators"],
builder: ["key", "value", "typeAnnotation", "decorators", "computed"],
aliases: ["Flow", "Property"],
aliases: ["Property"],
fields: {
computed: {
validate: assertValueType("boolean"),
Expand Down

0 comments on commit 8709899

Please sign in to comment.