diff --git a/package.json b/package.json index a3201656..2efb84f8 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "dependencies": { "@angular/compiler": "8.2.7", "@babel/code-frame": "7.5.5", - "@babel/parser": "7.2.0", + "@babel/parser": "7.6.3", "@glimmer/syntax": "0.41.0", "@iarna/toml": "2.2.3", "@typescript-eslint/typescript-estree": "1.13.0", diff --git a/tests/classes/__snapshots__/jsfmt.spec.js.snap b/tests/classes/__snapshots__/jsfmt.spec.js.snap index b4bd62dc..2ed9a896 100644 --- a/tests/classes/__snapshots__/jsfmt.spec.js.snap +++ b/tests/classes/__snapshots__/jsfmt.spec.js.snap @@ -30,22 +30,22 @@ class MyContractSelectionWidget extends React.Component {/* dangling */} export /* dangling */{}; =====================================output===================================== -var x = { +var a = { /* dangling */ }; -var x = { +var b = { // dangling }; -var x = [ +var b = [ /* dangling */ ]; -function x() { +function d() { /* dangling */ } new Thing(/* dangling */); @@ -488,15 +488,19 @@ export //comment export /* comment */ {}; +const foo = '' export { foo // comment } +const bar = '' export { // comment bar } +const fooo = '' +const barr = '' export { fooo, // comment barr, // comment @@ -508,15 +512,19 @@ export //comment export /* comment */{}; +const foo = ""; export { foo // comment }; +const bar = ""; export { // comment bar }; +const fooo = ""; +const barr = ""; export { fooo, // comment barr // comment @@ -557,7 +565,7 @@ type UploadState // Uploading to aws3 and CreatePostMutation succeeded | {type: "Success", data: D}; -type UploadState +type UploadState2 // The upload hasnt begun yet = A // The upload timed out @@ -578,7 +586,7 @@ type UploadState = // Uploading to aws3 and CreatePostMutation succeeded | { type: "Success", data: D }; -type UploadState = +type UploadState2 = // The upload hasnt begun yet | A // The upload timed out @@ -605,14 +613,14 @@ KEYPAD_NUMBERS.map(num => ( // Buttons 0-9
)); -function f /* f */() {} -function f (/* args */) {} -function f () /* returns */ {} -function f /* f */(/* args */) /* returns */ {} +function f1 /* f */() {} +function f2 (/* args */) {} +function f3 () /* returns */ {} +function f4 /* f */(/* args */) /* returns */ {} -function f /* f */(/* a */ a) {} -function f /* f */(a /* a */) {} -function f /* f */(/* a */ a) /* returns */ {} +function f5 /* f */(/* a */ a) {} +function f6 /* f */(a /* a */) {} +function f7 /* f */(/* a */ a) /* returns */ {} const obj = { f1 /* f */() {}, @@ -626,35 +634,35 @@ const obj = { (function f () /* returns */ {})(); (function f /* f */(/* args */) /* returns */ {})(); -class C { +class C1 { f/* f */() {} } -class C { +class C2 { f(/* args */) {} } -class C { +class C3 { f() /* returns */ {} } -class C { +class C4 { f/* f */(/* args */) /* returns */ {} } -function foo() +function foo1() // this is a function { return 42 } -function foo() // this is a function +function foo2() // this is a function { return 42 } -function foo() { // this is a function +function foo3() { // this is a function return 42 } -function foo() { +function foo4() { // this is a function return 42; } @@ -668,14 +676,14 @@ KEYPAD_NUMBERS.map(( num // Buttons 0-9 ) =>
); -function f /* f */() {} -function f(/* args */) {} -function f() /* returns */ {} -function f /* f */(/* args */) /* returns */ {} +function f1 /* f */() {} +function f2(/* args */) {} +function f3() /* returns */ {} +function f4 /* f */(/* args */) /* returns */ {} -function f /* f */(/* a */ a) {} -function f /* f */(a /* a */) {} -function f /* f */(/* a */ a) /* returns */ {} +function f5 /* f */(/* a */ a) {} +function f6 /* f */(a /* a */) {} +function f7 /* f */(/* a */ a) /* returns */ {} const obj = { f1 /* f */() {}, @@ -689,35 +697,35 @@ const obj = { (function f() /* returns */ {})(); (function f /* f */(/* args */) /* returns */ {})(); -class C { +class C1 { f /* f */() {} } -class C { +class C2 { f(/* args */) {} } -class C { +class C3 { f() /* returns */ {} } -class C { +class C4 { f /* f */(/* args */) /* returns */ {} } -function foo() { +function foo1() { // this is a function return 42; } -function foo() { +function foo2() { // this is a function return 42; } -function foo() { +function foo3() { // this is a function return 42; } -function foo() { +function foo4() { // this is a function return 42; } @@ -1351,22 +1359,22 @@ parsers: ["flow", "babel"] printWidth: 80 | printWidth =====================================input====================================== -type f = ( +type f1 = ( currentRequest: {a: number}, // TODO this is a very very very very long comment that makes it go > 80 columns ) => number; -f = ( +f2 = ( currentRequest: {a: number}, // TODO this is a very very very very long comment that makes it go > 80 columns ): number => {}; -f = ( +f3 = ( currentRequest: {a: number}, // TODO this is a very very very very long comment that makes it go > 80 columns ) => {}; -f = function( +f4 = function( currentRequest: {a: number}, // TODO this is a very very very very long comment that makes it go > 80 columns ) {}; @@ -1378,7 +1386,7 @@ class X { ) {} } -function f( +function f5( a: number // some comment here ): number { @@ -1395,7 +1403,7 @@ var x = { } } -class X { +class X2 { getSectionMode( pageMetaData: PageMetaData, sectionMetaData: SectionMetaData = ['unknown'] @@ -1447,22 +1455,22 @@ class Foo { } =====================================output===================================== -type f = ( +type f1 = ( currentRequest: { a: number } // TODO this is a very very very very long comment that makes it go > 80 columns ) => number; -f = ( +f2 = ( currentRequest: { a: number } // TODO this is a very very very very long comment that makes it go > 80 columns ): number => {}; -f = ( +f3 = ( currentRequest: { a: number } // TODO this is a very very very very long comment that makes it go > 80 columns ) => {}; -f = function( +f4 = function( currentRequest: { a: number } // TODO this is a very very very very long comment that makes it go > 80 columns ) {}; @@ -1474,7 +1482,7 @@ class X { ) {} } -function f( +function f5( a: number // some comment here ): number { @@ -1490,7 +1498,7 @@ var x = { ): $Enum {} }; -class X { +class X2 { getSectionMode( pageMetaData: PageMetaData, sectionMetaData: SectionMetaData = ["unknown"] @@ -2219,130 +2227,130 @@ parsers: ["flow", "babel"] printWidth: 80 | printWidth =====================================input====================================== -let obj = // Comment +let obj1 = // Comment { key: 'val' } -let obj // Comment +let obj2 // Comment = { key: 'val' } -let obj = { // Comment +let obj3 = { // Comment key: 'val' } -let obj = { +let obj4 = { // Comment key: 'val' } -let obj = // Comment +let obj5 = // Comment [ 'val' ] -let obj // Comment +let obj6 // Comment = [ 'val' ] -let obj = [ // Comment +let obj7 = [ // Comment 'val' ] -let obj = [ +let obj8 = [ // Comment 'val' ] -let obj = // Comment +let obj9 = // Comment \`val\`; -let obj = // Comment +let obj10 = // Comment \` val val \`; -let obj = // Comment +let obj11 = // Comment tag\`val\`; -let obj = // Comment +let obj12 = // Comment tag\` val val \`; let // Comment - foo = 'val'; + foo1 = 'val'; let // Comment - foo = 'val', + foo2 = 'val', bar = 'val'; -const foo = 123 +const foo3 = 123 // Nothing to see here. ;["2", "3"].forEach(x => console.log(x)) =====================================output===================================== -let obj = +let obj1 = // Comment { key: "val" }; -let obj = +let obj2 = // Comment { key: "val" }; -let obj = { +let obj3 = { // Comment key: "val" }; -let obj = { +let obj4 = { // Comment key: "val" }; -let obj = +let obj5 = // Comment ["val"]; -let obj = +let obj6 = // Comment ["val"]; -let obj = [ +let obj7 = [ // Comment "val" ]; -let obj = [ +let obj8 = [ // Comment "val" ]; -let obj = +let obj9 = // Comment \`val\`; -let obj = +let obj10 = // Comment \` val val \`; -let obj = +let obj11 = // Comment tag\`val\`; -let obj = +let obj12 = // Comment tag\` val @@ -2350,13 +2358,13 @@ val \`; let // Comment - foo = "val"; + foo1 = "val"; let // Comment - foo = "val", + foo2 = "val", bar = "val"; -const foo = 123; +const foo3 = 123; // Nothing to see here. ["2", "3"].forEach(x => console.log(x)); diff --git a/tests/comments/assignment-pattern.js b/tests/comments/assignment-pattern.js index 5c383605..b7368706 100644 --- a/tests/comments/assignment-pattern.js +++ b/tests/comments/assignment-pattern.js @@ -2,5 +2,5 @@ const { a /* comment */ = 1 } = b; const { c = 1 /* comment */ } = d; -let {a //comment +let {d //comment = b} = c diff --git a/tests/comments/dangling.js b/tests/comments/dangling.js index 5a882d4a..25939492 100644 --- a/tests/comments/dangling.js +++ b/tests/comments/dangling.js @@ -1,9 +1,9 @@ -var x = {/* dangling */}; -var x = { +var a = {/* dangling */}; +var b = { // dangling }; -var x = [/* dangling */]; -function x() { +var b = [/* dangling */]; +function d() { /* dangling */ } new Thing(/* dangling */); diff --git a/tests/comments/export.js b/tests/comments/export.js index d357281a..172505bc 100644 --- a/tests/comments/export.js +++ b/tests/comments/export.js @@ -3,15 +3,19 @@ export //comment export /* comment */ {}; +const foo = '' export { foo // comment } +const bar = '' export { // comment bar } +const fooo = '' +const barr = '' export { fooo, // comment barr, // comment diff --git a/tests/comments/flow_union.js b/tests/comments/flow_union.js index 9d67d295..7fd267e5 100644 --- a/tests/comments/flow_union.js +++ b/tests/comments/flow_union.js @@ -8,7 +8,7 @@ type UploadState // Uploading to aws3 and CreatePostMutation succeeded | {type: "Success", data: D}; -type UploadState +type UploadState2 // The upload hasnt begun yet = A // The upload timed out diff --git a/tests/comments/function-declaration.js b/tests/comments/function-declaration.js index 63d8e83b..478dabf4 100644 --- a/tests/comments/function-declaration.js +++ b/tests/comments/function-declaration.js @@ -6,14 +6,14 @@ KEYPAD_NUMBERS.map(num => ( // Buttons 0-9
)); -function f /* f */() {} -function f (/* args */) {} -function f () /* returns */ {} -function f /* f */(/* args */) /* returns */ {} +function f1 /* f */() {} +function f2 (/* args */) {} +function f3 () /* returns */ {} +function f4 /* f */(/* args */) /* returns */ {} -function f /* f */(/* a */ a) {} -function f /* f */(a /* a */) {} -function f /* f */(/* a */ a) /* returns */ {} +function f5 /* f */(/* a */ a) {} +function f6 /* f */(a /* a */) {} +function f7 /* f */(/* a */ a) /* returns */ {} const obj = { f1 /* f */() {}, @@ -27,35 +27,35 @@ const obj = { (function f () /* returns */ {})(); (function f /* f */(/* args */) /* returns */ {})(); -class C { +class C1 { f/* f */() {} } -class C { +class C2 { f(/* args */) {} } -class C { +class C3 { f() /* returns */ {} } -class C { +class C4 { f/* f */(/* args */) /* returns */ {} } -function foo() +function foo1() // this is a function { return 42 } -function foo() // this is a function +function foo2() // this is a function { return 42 } -function foo() { // this is a function +function foo3() { // this is a function return 42 } -function foo() { +function foo4() { // this is a function return 42; } diff --git a/tests/comments/last-arg.js b/tests/comments/last-arg.js index 45c69c81..c6bdbd70 100644 --- a/tests/comments/last-arg.js +++ b/tests/comments/last-arg.js @@ -1,19 +1,19 @@ -type f = ( +type f1 = ( currentRequest: {a: number}, // TODO this is a very very very very long comment that makes it go > 80 columns ) => number; -f = ( +f2 = ( currentRequest: {a: number}, // TODO this is a very very very very long comment that makes it go > 80 columns ): number => {}; -f = ( +f3 = ( currentRequest: {a: number}, // TODO this is a very very very very long comment that makes it go > 80 columns ) => {}; -f = function( +f4 = function( currentRequest: {a: number}, // TODO this is a very very very very long comment that makes it go > 80 columns ) {}; @@ -25,7 +25,7 @@ class X { ) {} } -function f( +function f5( a: number // some comment here ): number { @@ -42,7 +42,7 @@ var x = { } } -class X { +class X2 { getSectionMode( pageMetaData: PageMetaData, sectionMetaData: SectionMetaData = ['unknown'] diff --git a/tests/comments/variable_declarator.js b/tests/comments/variable_declarator.js index 1901da56..e78d0c0e 100644 --- a/tests/comments/variable_declarator.js +++ b/tests/comments/variable_declarator.js @@ -1,66 +1,66 @@ -let obj = // Comment +let obj1 = // Comment { key: 'val' } -let obj // Comment +let obj2 // Comment = { key: 'val' } -let obj = { // Comment +let obj3 = { // Comment key: 'val' } -let obj = { +let obj4 = { // Comment key: 'val' } -let obj = // Comment +let obj5 = // Comment [ 'val' ] -let obj // Comment +let obj6 // Comment = [ 'val' ] -let obj = [ // Comment +let obj7 = [ // Comment 'val' ] -let obj = [ +let obj8 = [ // Comment 'val' ] -let obj = // Comment +let obj9 = // Comment `val`; -let obj = // Comment +let obj10 = // Comment ` val val `; -let obj = // Comment +let obj11 = // Comment tag`val`; -let obj = // Comment +let obj12 = // Comment tag` val val `; let // Comment - foo = 'val'; + foo1 = 'val'; let // Comment - foo = 'val', + foo2 = 'val', bar = 'val'; -const foo = 123 +const foo3 = 123 // Nothing to see here. ;["2", "3"].forEach(x => console.log(x)) diff --git a/tests/comments_closure_typecast/__snapshots__/jsfmt.spec.js.snap b/tests/comments_closure_typecast/__snapshots__/jsfmt.spec.js.snap index 452dfa53..109e446f 100644 --- a/tests/comments_closure_typecast/__snapshots__/jsfmt.spec.js.snap +++ b/tests/comments_closure_typecast/__snapshots__/jsfmt.spec.js.snap @@ -46,11 +46,11 @@ const data = functionCall( /** @type {{height: number, width: number}} */ (arg3)); // Invalid type casts -const v = /** @type {} */ (value); -const v = /** @type {}} */ (value); -const v = /** @type } */ (value); -const v = /** @type { */ (value); -const v = /** @type {{} */ (value); +const v1 = /** @type {} */ (value); +const v2 = /** @type {}} */ (value); +const v3 = /** @type } */ (value); +const v4 = /** @type { */ (value); +const v5 = /** @type {{} */ (value); const style = /** @type {{ width: number, @@ -65,7 +65,7 @@ const style = /** @type {{ ...margins, }); -const style =/** +const style2 =/** * @type {{ * width: number, * }} @@ -74,9 +74,9 @@ const style =/** }); // Spaces aren't necessary -const v = /**@type {string} */(value); -const v = /** @type{string} */(value); -const v = /**@type{string} */(value); +const v6 = /**@type {string} */(value); +const v7 = /** @type{string} */(value); +const v8 = /**@type{string} */(value); =====================================output===================================== // test to make sure comments are attached correctly @@ -122,11 +122,11 @@ const data = functionCall( ); // Invalid type casts -const v = /** @type {} */ value; -const v = /** @type {}} */ value; -const v = /** @type } */ value; -const v = /** @type { */ value; -const v = /** @type {{} */ value; +const v1 = /** @type {} */ value; +const v2 = /** @type {}} */ value; +const v3 = /** @type } */ value; +const v4 = /** @type { */ value; +const v5 = /** @type {{} */ value; const style = /** @type {{ width: number, @@ -141,7 +141,7 @@ const style = /** @type {{ ...margins }); -const style = /** +const style2 = /** * @type {{ * width: number, * }} @@ -150,9 +150,9 @@ const style = /** }); // Spaces aren't necessary -const v = /**@type {string} */ (value); -const v = /** @type{string} */ (value); -const v = /**@type{string} */ (value); +const v6 = /**@type {string} */ (value); +const v7 = /** @type{string} */ (value); +const v8 = /**@type{string} */ (value); ================================================================================ `; diff --git a/tests/comments_closure_typecast/closure-compiler-type-cast.js b/tests/comments_closure_typecast/closure-compiler-type-cast.js index 24b464fe..585e92b0 100644 --- a/tests/comments_closure_typecast/closure-compiler-type-cast.js +++ b/tests/comments_closure_typecast/closure-compiler-type-cast.js @@ -38,11 +38,11 @@ const data = functionCall( /** @type {{height: number, width: number}} */ (arg3)); // Invalid type casts -const v = /** @type {} */ (value); -const v = /** @type {}} */ (value); -const v = /** @type } */ (value); -const v = /** @type { */ (value); -const v = /** @type {{} */ (value); +const v1 = /** @type {} */ (value); +const v2 = /** @type {}} */ (value); +const v3 = /** @type } */ (value); +const v4 = /** @type { */ (value); +const v5 = /** @type {{} */ (value); const style = /** @type {{ width: number, @@ -57,7 +57,7 @@ const style = /** @type {{ ...margins, }); -const style =/** +const style2 =/** * @type {{ * width: number, * }} @@ -66,6 +66,6 @@ const style =/** }); // Spaces aren't necessary -const v = /**@type {string} */(value); -const v = /** @type{string} */(value); -const v = /**@type{string} */(value); +const v6 = /**@type {string} */(value); +const v7 = /** @type{string} */(value); +const v8 = /**@type{string} */(value); diff --git a/tests/decorators/__snapshots__/jsfmt.spec.js.snap b/tests/decorators/__snapshots__/jsfmt.spec.js.snap index 10201131..19d833f8 100644 --- a/tests/decorators/__snapshots__/jsfmt.spec.js.snap +++ b/tests/decorators/__snapshots__/jsfmt.spec.js.snap @@ -16,7 +16,7 @@ const foo = @deco class { // }; -const foo = +const bar = @deco class { // @@ -38,7 +38,7 @@ const foo = // }; -const foo = +const bar = @deco class { // diff --git a/tests/decorators/classes.js b/tests/decorators/classes.js index a0d56df2..ff49fd73 100644 --- a/tests/decorators/classes.js +++ b/tests/decorators/classes.js @@ -8,7 +8,7 @@ const foo = @deco class { // }; -const foo = +const bar = @deco class { // diff --git a/tests/directives/__snapshots__/jsfmt.spec.js.snap b/tests/directives/__snapshots__/jsfmt.spec.js.snap index 3c483dec..107b9d32 100644 --- a/tests/directives/__snapshots__/jsfmt.spec.js.snap +++ b/tests/directives/__snapshots__/jsfmt.spec.js.snap @@ -174,16 +174,16 @@ printWidth: 80 =====================================input====================================== "use strict"; -function fn() { +function f1() { "use strict"; } -function f() { +function f2() { 'ngInject'; Object.assign(this, { $log, $uibModal }); } -function f() { +function f3() { 'ngInject'; @@ -191,7 +191,7 @@ function f() { } -function f() { +function f4() { 'ngInject'; @@ -201,22 +201,22 @@ function f() { =====================================output===================================== "use strict"; -function fn() { +function f1() { "use strict"; } -function f() { +function f2() { "ngInject"; Object.assign(this, { $log, $uibModal }); } -function f() { +function f3() { "ngInject"; Object.assign(this, { $log, $uibModal }); } -function f() { +function f4() { "ngInject"; Object.assign(this, { $log, $uibModal }); diff --git a/tests/directives/test.js b/tests/directives/test.js index 4019c54e..3daaafb5 100644 --- a/tests/directives/test.js +++ b/tests/directives/test.js @@ -1,15 +1,15 @@ "use strict"; -function fn() { +function f1() { "use strict"; } -function f() { +function f2() { 'ngInject'; Object.assign(this, { $log, $uibModal }); } -function f() { +function f3() { 'ngInject'; @@ -17,7 +17,7 @@ function f() { } -function f() { +function f4() { 'ngInject'; diff --git a/tests/do/__snapshots__/jsfmt.spec.js.snap b/tests/do/__snapshots__/jsfmt.spec.js.snap index 9f7315b5..74b5471d 100644 --- a/tests/do/__snapshots__/jsfmt.spec.js.snap +++ b/tests/do/__snapshots__/jsfmt.spec.js.snap @@ -19,7 +19,7 @@ let x = do { tmp * tmp + 1 }; -let x = do { +let y = do { if (foo()) { f() } else if (bar()) { g() } else { h() } @@ -74,7 +74,7 @@ let x = do { tmp * tmp + 1; }; -let x = do { +let y = do { if (foo()) { f(); } else if (bar()) { diff --git a/tests/do/do.js b/tests/do/do.js index ae98feea..e2b49710 100644 --- a/tests/do/do.js +++ b/tests/do/do.js @@ -11,7 +11,7 @@ let x = do { tmp * tmp + 1 }; -let x = do { +let y = do { if (foo()) { f() } else if (bar()) { g() } else { h() } diff --git a/tests/empty_paren_comment/__snapshots__/jsfmt.spec.js.snap b/tests/empty_paren_comment/__snapshots__/jsfmt.spec.js.snap index 4c499cfc..f18e3604 100644 --- a/tests/empty_paren_comment/__snapshots__/jsfmt.spec.js.snap +++ b/tests/empty_paren_comment/__snapshots__/jsfmt.spec.js.snap @@ -31,9 +31,9 @@ parsers: ["flow", "babel", "typescript"] printWidth: 80 | printWidth =====================================input====================================== -let f = (/* ... */) => {} +let f1 = (/* ... */) => {} (function (/* ... */) {})(/* ... */) -function f(/* ... */) {} +function f2(/* ... */) {} const obj = { f(/* ... */) {}, @@ -57,13 +57,13 @@ f(a, /* ... */); f(a, /* ... */ b); f(/* ... */ a, b); -let f = () => import(a /* ... */); -let f = () => doThing(a, /* ... */ b); +let f3 = () => import(a /* ... */); +let f4 = () => doThing(a, /* ... */ b); =====================================output===================================== -let f = (/* ... */) => {}; +let f1 = (/* ... */) => {}; (function(/* ... */) {})(/* ... */); -function f(/* ... */) {} +function f2(/* ... */) {} const obj = { f(/* ... */) {}, @@ -87,8 +87,8 @@ f(a /* ... */); f(a, /* ... */ b); f(/* ... */ a, b); -let f = () => import(a /* ... */); -let f = () => doThing(a, /* ... */ b); +let f3 = () => import(a /* ... */); +let f4 = () => doThing(a, /* ... */ b); ================================================================================ `; diff --git a/tests/empty_paren_comment/empty_paren_comment.js b/tests/empty_paren_comment/empty_paren_comment.js index 71576218..efd37997 100644 --- a/tests/empty_paren_comment/empty_paren_comment.js +++ b/tests/empty_paren_comment/empty_paren_comment.js @@ -1,6 +1,6 @@ -let f = (/* ... */) => {} +let f1 = (/* ... */) => {} (function (/* ... */) {})(/* ... */) -function f(/* ... */) {} +function f2(/* ... */) {} const obj = { f(/* ... */) {}, @@ -24,5 +24,5 @@ f(a, /* ... */); f(a, /* ... */ b); f(/* ... */ a, b); -let f = () => import(a /* ... */); -let f = () => doThing(a, /* ... */ b); +let f3 = () => import(a /* ... */); +let f4 = () => doThing(a, /* ... */ b); diff --git a/tests/flow_class_field/__snapshots__/jsfmt.spec.js.snap b/tests/flow_class_field/__snapshots__/jsfmt.spec.js.snap index acd9574c..9ad64e9b 100644 --- a/tests/flow_class_field/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow_class_field/__snapshots__/jsfmt.spec.js.snap @@ -7,12 +7,12 @@ printWidth: 80 | printWidth =====================================input====================================== class Foo { - constructor: () => this; + bar: () => this; } =====================================output===================================== class Foo { - constructor: () => this; + bar: () => this; } ================================================================================ diff --git a/tests/flow_class_field/override.js b/tests/flow_class_field/override.js index 1db4f608..cc7c1b14 100644 --- a/tests/flow_class_field/override.js +++ b/tests/flow_class_field/override.js @@ -1,3 +1,3 @@ class Foo { - constructor: () => this; + bar: () => this; } diff --git a/tests/flow_comments/__snapshots__/jsfmt.spec.js.snap b/tests/flow_comments/__snapshots__/jsfmt.spec.js.snap index 06886cef..9dff2c62 100644 --- a/tests/flow_comments/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow_comments/__snapshots__/jsfmt.spec.js.snap @@ -7,23 +7,23 @@ printWidth: 80 | printWidth =====================================input====================================== // Error -const beep = (data/*: Object */) => {} +const a = (data/*: Object */) => {} // OK -const beep = (data/*: Object */, secondData/*: Object */) => {} +const b = (data/*: Object */, secondData/*: Object */) => {} -const beep = (data/*: /* this is an object *-/ Object */) => {}; +const c = (data/*: /* this is an object *-/ Object */) => {}; const run = (cmd /*: string */) /*: Promise */ => {} =====================================output===================================== // Error -const beep = (data /*: Object */) => {}; +const a = (data /*: Object */) => {}; // OK -const beep = (data /*: Object */, secondData /*: Object */) => {}; +const b = (data /*: Object */, secondData /*: Object */) => {}; -const beep = (data /*: /* this is an object *-/ Object */) => {}; +const c = (data /*: /* this is an object *-/ Object */) => {}; const run = (cmd /*: string */) /*: Promise */ => {}; @@ -107,11 +107,11 @@ printWidth: 80 | printWidth =====================================input====================================== let foo /*: Groups */; -let foo /*: string */ = 'a'; +let bar /*: string */ = 'a'; =====================================output===================================== let foo /*: Groups */; -let foo /*: string */ = "a"; +let bar /*: string */ = "a"; ================================================================================ `; @@ -122,32 +122,32 @@ parsers: ["flow", "babel"] printWidth: 80 | printWidth =====================================input====================================== -type Props = // (DispatchProps & StateProps); WHY DON'T YOU WORK FLOW!!!!!!!!! +type Props1 = // (DispatchProps & StateProps); WHY DON'T YOU WORK FLOW!!!!!!!!! { isPlaying: boolean, }; -type Props = { // (DispatchProps & StateProps); WHY DON'T YOU WORK FLOW!!!!!!!!! +type Props2 = { // (DispatchProps & StateProps); WHY DON'T YOU WORK FLOW!!!!!!!!! isPlaying: boolean }; -type Props = { +type Props3 = { // (DispatchProps & StateProps); WHY DON'T YOU WORK FLOW!!!!!!!!! isPlaying: boolean }; =====================================output===================================== // (DispatchProps & StateProps); WHY DON'T YOU WORK FLOW!!!!!!!!! -type Props = { +type Props1 = { isPlaying: boolean }; -type Props = { +type Props2 = { // (DispatchProps & StateProps); WHY DON'T YOU WORK FLOW!!!!!!!!! isPlaying: boolean }; -type Props = { +type Props3 = { // (DispatchProps & StateProps); WHY DON'T YOU WORK FLOW!!!!!!!!! isPlaying: boolean }; diff --git a/tests/flow_comments/arrow.js b/tests/flow_comments/arrow.js index 4641734a..4693394a 100644 --- a/tests/flow_comments/arrow.js +++ b/tests/flow_comments/arrow.js @@ -1,9 +1,9 @@ // Error -const beep = (data/*: Object */) => {} +const a = (data/*: Object */) => {} // OK -const beep = (data/*: Object */, secondData/*: Object */) => {} +const b = (data/*: Object */, secondData/*: Object */) => {} -const beep = (data/*: /* this is an object *-/ Object */) => {}; +const c = (data/*: /* this is an object *-/ Object */) => {}; const run = (cmd /*: string */) /*: Promise */ => {} diff --git a/tests/flow_comments/let.js b/tests/flow_comments/let.js index 8fa12e7c..cbfd79fa 100644 --- a/tests/flow_comments/let.js +++ b/tests/flow_comments/let.js @@ -1,2 +1,2 @@ let foo /*: Groups */; -let foo /*: string */ = 'a'; +let bar /*: string */ = 'a'; diff --git a/tests/flow_comments/object_type_annotation.js b/tests/flow_comments/object_type_annotation.js index 248d4057..1e5f1733 100644 --- a/tests/flow_comments/object_type_annotation.js +++ b/tests/flow_comments/object_type_annotation.js @@ -1,13 +1,13 @@ -type Props = // (DispatchProps & StateProps); WHY DON'T YOU WORK FLOW!!!!!!!!! +type Props1 = // (DispatchProps & StateProps); WHY DON'T YOU WORK FLOW!!!!!!!!! { isPlaying: boolean, }; -type Props = { // (DispatchProps & StateProps); WHY DON'T YOU WORK FLOW!!!!!!!!! +type Props2 = { // (DispatchProps & StateProps); WHY DON'T YOU WORK FLOW!!!!!!!!! isPlaying: boolean }; -type Props = { +type Props3 = { // (DispatchProps & StateProps); WHY DON'T YOU WORK FLOW!!!!!!!!! isPlaying: boolean }; diff --git a/tests/flow_function_parentheses/__snapshots__/jsfmt.spec.js.snap b/tests/flow_function_parentheses/__snapshots__/jsfmt.spec.js.snap index 2f55d3b3..98ca0a37 100644 --- a/tests/flow_function_parentheses/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow_function_parentheses/__snapshots__/jsfmt.spec.js.snap @@ -86,9 +86,9 @@ type Banana = { type Hex = {n: 0x01}; -type T = { method: (a) => void }; +type T1 = { method: (a) => void }; -type T = { method(a): void }; +type T2 = { method(a): void }; declare class X { method(a): void } @@ -96,23 +96,23 @@ declare function f(a): void; var f: (a) => void; -interface F { m(string): number } +interface F1 { m(string): number } -interface F { m: (string) => number } +interface F2 { m: (string) => number } -function f(o: { f: (string) => void }) {} +function f1(o: { f: (string) => void }) {} -function f(o: { f(string): void }) {} +function f2(o: { f(string): void }) {} -type f = (...arg) => void; +type f3 = (...arg) => void; -type f = (/* comment */ arg) => void; +type f4 = (/* comment */ arg) => void; -type f = (arg /* comment */) => void; +type f5 = (arg /* comment */) => void; -type f = (?arg) => void; +type f6 = (?arg) => void; -class X { +class Y { constructor( ideConnectionFactory: child_process$ChildProcess => FlowIDEConnection = defaultIDEConnectionFactory, @@ -126,20 +126,20 @@ interface F { type ExtractType = (B) => D -type T = ?(() => A); +type T3 = ?(() => A); -type T = ?(() => A) | B; +type T4 = ?(() => A) | B; -type T = ?() => A | B; +type T5 = ?() => A | B; -type T = (?() => A) | B; +type T6 = (?() => A) | B; // https://github.com/babel/babel/issues/7924 //type T = ??() => A; -type T = ?(?(() => A)); +type T7 = ?(?(() => A)); -type T = ?(?() => A) | B; +type T8 = ?(?() => A) | B; =====================================output===================================== type Banana = { @@ -148,9 +148,9 @@ type Banana = { type Hex = { n: 0x01 }; -type T = { method: a => void }; +type T1 = { method: a => void }; -type T = { method(a): void }; +type T2 = { method(a): void }; declare class X { method(a): void; @@ -160,27 +160,27 @@ declare function f(a): void; var f: a => void; -interface F { +interface F1 { m(string): number; } -interface F { +interface F2 { m: string => number; } -function f(o: { f: string => void }) {} +function f1(o: { f: string => void }) {} -function f(o: { f(string): void }) {} +function f2(o: { f(string): void }) {} -type f = (...arg) => void; +type f3 = (...arg) => void; -type f = /* comment */ arg => void; +type f4 = /* comment */ arg => void; -type f = arg /* comment */ => void; +type f5 = arg /* comment */ => void; -type f = (?arg) => void; +type f6 = (?arg) => void; -class X { +class Y { constructor( ideConnectionFactory: child_process$ChildProcess => FlowIDEConnection = defaultIDEConnectionFactory ) {} @@ -192,20 +192,20 @@ interface F { type ExtractType = (B) => D; -type T = ?() => A; +type T3 = ?() => A; -type T = ?(() => A) | B; +type T4 = ?(() => A) | B; -type T = ?() => A | B; +type T5 = ?() => A | B; -type T = ?(() => A) | B; +type T6 = ?(() => A) | B; // https://github.com/babel/babel/issues/7924 //type T = ??() => A; -type T = ??(() => A); +type T7 = ??(() => A); -type T = ??(() => A) | B; +type T8 = ??(() => A) | B; ================================================================================ `; @@ -223,9 +223,9 @@ type Banana = { type Hex = {n: 0x01}; -type T = { method: (a) => void }; +type T1 = { method: (a) => void }; -type T = { method(a): void }; +type T2 = { method(a): void }; declare class X { method(a): void } @@ -233,23 +233,23 @@ declare function f(a): void; var f: (a) => void; -interface F { m(string): number } +interface F1 { m(string): number } -interface F { m: (string) => number } +interface F2 { m: (string) => number } -function f(o: { f: (string) => void }) {} +function f1(o: { f: (string) => void }) {} -function f(o: { f(string): void }) {} +function f2(o: { f(string): void }) {} -type f = (...arg) => void; +type f3 = (...arg) => void; -type f = (/* comment */ arg) => void; +type f4 = (/* comment */ arg) => void; -type f = (arg /* comment */) => void; +type f5 = (arg /* comment */) => void; -type f = (?arg) => void; +type f6 = (?arg) => void; -class X { +class Y { constructor( ideConnectionFactory: child_process$ChildProcess => FlowIDEConnection = defaultIDEConnectionFactory, @@ -263,20 +263,20 @@ interface F { type ExtractType = (B) => D -type T = ?(() => A); +type T3 = ?(() => A); -type T = ?(() => A) | B; +type T4 = ?(() => A) | B; -type T = ?() => A | B; +type T5 = ?() => A | B; -type T = (?() => A) | B; +type T6 = (?() => A) | B; // https://github.com/babel/babel/issues/7924 //type T = ??() => A; -type T = ?(?(() => A)); +type T7 = ?(?(() => A)); -type T = ?(?() => A) | B; +type T8 = ?(?() => A) | B; =====================================output===================================== type Banana = { @@ -285,9 +285,9 @@ type Banana = { type Hex = { n: 0x01 }; -type T = { method: a => void }; +type T1 = { method: a => void }; -type T = { method(a): void }; +type T2 = { method(a): void }; declare class X { method(a): void; @@ -297,27 +297,27 @@ declare function f(a): void; var f: a => void; -interface F { +interface F1 { m(string): number; } -interface F { +interface F2 { m: string => number; } -function f(o: { f: string => void }) {} +function f1(o: { f: string => void }) {} -function f(o: { f(string): void }) {} +function f2(o: { f(string): void }) {} -type f = (...arg) => void; +type f3 = (...arg) => void; -type f = /* comment */ arg => void; +type f4 = /* comment */ arg => void; -type f = arg /* comment */ => void; +type f5 = arg /* comment */ => void; -type f = (?arg) => void; +type f6 = (?arg) => void; -class X { +class Y { constructor( ideConnectionFactory: child_process$ChildProcess => FlowIDEConnection = defaultIDEConnectionFactory, ) {} @@ -329,20 +329,20 @@ interface F { type ExtractType = (B) => D; -type T = ?() => A; +type T3 = ?() => A; -type T = ?(() => A) | B; +type T4 = ?(() => A) | B; -type T = ?() => A | B; +type T5 = ?() => A | B; -type T = ?(() => A) | B; +type T6 = ?(() => A) | B; // https://github.com/babel/babel/issues/7924 //type T = ??() => A; -type T = ??(() => A); +type T7 = ??(() => A); -type T = ??(() => A) | B; +type T8 = ??(() => A) | B; ================================================================================ `; @@ -360,9 +360,9 @@ type Banana = { type Hex = {n: 0x01}; -type T = { method: (a) => void }; +type T1 = { method: (a) => void }; -type T = { method(a): void }; +type T2 = { method(a): void }; declare class X { method(a): void } @@ -370,23 +370,23 @@ declare function f(a): void; var f: (a) => void; -interface F { m(string): number } +interface F1 { m(string): number } -interface F { m: (string) => number } +interface F2 { m: (string) => number } -function f(o: { f: (string) => void }) {} +function f1(o: { f: (string) => void }) {} -function f(o: { f(string): void }) {} +function f2(o: { f(string): void }) {} -type f = (...arg) => void; +type f3 = (...arg) => void; -type f = (/* comment */ arg) => void; +type f4 = (/* comment */ arg) => void; -type f = (arg /* comment */) => void; +type f5 = (arg /* comment */) => void; -type f = (?arg) => void; +type f6 = (?arg) => void; -class X { +class Y { constructor( ideConnectionFactory: child_process$ChildProcess => FlowIDEConnection = defaultIDEConnectionFactory, @@ -400,20 +400,20 @@ interface F { type ExtractType = (B) => D -type T = ?(() => A); +type T3 = ?(() => A); -type T = ?(() => A) | B; +type T4 = ?(() => A) | B; -type T = ?() => A | B; +type T5 = ?() => A | B; -type T = (?() => A) | B; +type T6 = (?() => A) | B; // https://github.com/babel/babel/issues/7924 //type T = ??() => A; -type T = ?(?(() => A)); +type T7 = ?(?(() => A)); -type T = ?(?() => A) | B; +type T8 = ?(?() => A) | B; =====================================output===================================== type Banana = { @@ -422,9 +422,9 @@ type Banana = { type Hex = { n: 0x01 }; -type T = { method: (a) => void }; +type T1 = { method: (a) => void }; -type T = { method(a): void }; +type T2 = { method(a): void }; declare class X { method(a): void; @@ -434,27 +434,27 @@ declare function f(a): void; var f: (a) => void; -interface F { +interface F1 { m(string): number; } -interface F { +interface F2 { m: (string) => number; } -function f(o: { f: (string) => void }) {} +function f1(o: { f: (string) => void }) {} -function f(o: { f(string): void }) {} +function f2(o: { f(string): void }) {} -type f = (...arg) => void; +type f3 = (...arg) => void; -type f = (/* comment */ arg) => void; +type f4 = (/* comment */ arg) => void; -type f = (arg /* comment */) => void; +type f5 = (arg /* comment */) => void; -type f = (?arg) => void; +type f6 = (?arg) => void; -class X { +class Y { constructor( ideConnectionFactory: (child_process$ChildProcess) => FlowIDEConnection = defaultIDEConnectionFactory ) {} @@ -466,20 +466,20 @@ interface F { type ExtractType = (B) => D; -type T = ?() => A; +type T3 = ?() => A; -type T = ?(() => A) | B; +type T4 = ?(() => A) | B; -type T = ?() => A | B; +type T5 = ?() => A | B; -type T = ?(() => A) | B; +type T6 = ?(() => A) | B; // https://github.com/babel/babel/issues/7924 //type T = ??() => A; -type T = ??(() => A); +type T7 = ??(() => A); -type T = ??(() => A) | B; +type T8 = ??(() => A) | B; ================================================================================ `; diff --git a/tests/flow_function_parentheses/test.js b/tests/flow_function_parentheses/test.js index da761ffc..799019b1 100644 --- a/tests/flow_function_parentheses/test.js +++ b/tests/flow_function_parentheses/test.js @@ -4,9 +4,9 @@ type Banana = { type Hex = {n: 0x01}; -type T = { method: (a) => void }; +type T1 = { method: (a) => void }; -type T = { method(a): void }; +type T2 = { method(a): void }; declare class X { method(a): void } @@ -14,23 +14,23 @@ declare function f(a): void; var f: (a) => void; -interface F { m(string): number } +interface F1 { m(string): number } -interface F { m: (string) => number } +interface F2 { m: (string) => number } -function f(o: { f: (string) => void }) {} +function f1(o: { f: (string) => void }) {} -function f(o: { f(string): void }) {} +function f2(o: { f(string): void }) {} -type f = (...arg) => void; +type f3 = (...arg) => void; -type f = (/* comment */ arg) => void; +type f4 = (/* comment */ arg) => void; -type f = (arg /* comment */) => void; +type f5 = (arg /* comment */) => void; -type f = (?arg) => void; +type f6 = (?arg) => void; -class X { +class Y { constructor( ideConnectionFactory: child_process$ChildProcess => FlowIDEConnection = defaultIDEConnectionFactory, @@ -44,17 +44,17 @@ interface F { type ExtractType = (B) => D -type T = ?(() => A); +type T3 = ?(() => A); -type T = ?(() => A) | B; +type T4 = ?(() => A) | B; -type T = ?() => A | B; +type T5 = ?() => A | B; -type T = (?() => A) | B; +type T6 = (?() => A) | B; // https://github.com/babel/babel/issues/7924 //type T = ??() => A; -type T = ?(?(() => A)); +type T7 = ?(?(() => A)); -type T = ?(?() => A) | B; +type T8 = ?(?() => A) | B; diff --git a/tests/flow_internal_slot/__snapshots__/jsfmt.spec.js.snap b/tests/flow_internal_slot/__snapshots__/jsfmt.spec.js.snap index 4053367a..5766e764 100644 --- a/tests/flow_internal_slot/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow_internal_slot/__snapshots__/jsfmt.spec.js.snap @@ -6,30 +6,30 @@ parsers: ["flow", "babel"] printWidth: 80 | printWidth =====================================input====================================== -declare class C { static [[foo]]: T } -declare class C { [[foo]]: T } -interface T { [[foo]]: X } -interface T { [[foo]](): X } -type T = { [[foo]]: X } -type T = { [[foo]](): X } -type T = { [[foo]]?: X } +declare class C1 { static [[foo]]: T } +declare class C2 { [[foo]]: T } +interface T1 { [[foo]]: X } +interface T2 { [[foo]](): X } +type T3 = { [[foo]]: X } +type T4 = { [[foo]](): X } +type T5 = { [[foo]]?: X } =====================================output===================================== -declare class C { +declare class C1 { static [[foo]]: T; } -declare class C { +declare class C2 { [[foo]]: T; } -interface T { +interface T1 { [[foo]]: X; } -interface T { +interface T2 { [[foo]](): X; } -type T = { [[foo]]: X }; -type T = { [[foo]](): X }; -type T = { [[foo]]?: X }; +type T3 = { [[foo]]: X }; +type T4 = { [[foo]](): X }; +type T5 = { [[foo]]?: X }; ================================================================================ `; diff --git a/tests/flow_internal_slot/internal_slot.js b/tests/flow_internal_slot/internal_slot.js index 7888fc6c..bd8c67c1 100644 --- a/tests/flow_internal_slot/internal_slot.js +++ b/tests/flow_internal_slot/internal_slot.js @@ -1,7 +1,7 @@ -declare class C { static [[foo]]: T } -declare class C { [[foo]]: T } -interface T { [[foo]]: X } -interface T { [[foo]](): X } -type T = { [[foo]]: X } -type T = { [[foo]](): X } -type T = { [[foo]]?: X } +declare class C1 { static [[foo]]: T } +declare class C2 { [[foo]]: T } +interface T1 { [[foo]]: X } +interface T2 { [[foo]](): X } +type T3 = { [[foo]]: X } +type T4 = { [[foo]](): X } +type T5 = { [[foo]]?: X } diff --git a/tests/flow_method/__snapshots__/jsfmt.spec.js.snap b/tests/flow_method/__snapshots__/jsfmt.spec.js.snap index 4b389255..9b771a97 100644 --- a/tests/flow_method/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow_method/__snapshots__/jsfmt.spec.js.snap @@ -31,7 +31,7 @@ printWidth: 80 | printWidth =====================================input====================================== type T = { method: () => void }; -type T = { method(): void }; +type T2 = { method(): void }; declare class X { method(): void } declare function f(): void; var f: () => void; @@ -47,7 +47,7 @@ interface I { =====================================output===================================== type T = { method: () => void }; -type T = { method(): void }; +type T2 = { method(): void }; declare class X { method(): void; } diff --git a/tests/flow_method/method.js b/tests/flow_method/method.js index bf592375..ee9a0e04 100644 --- a/tests/flow_method/method.js +++ b/tests/flow_method/method.js @@ -1,5 +1,5 @@ type T = { method: () => void }; -type T = { method(): void }; +type T2 = { method(): void }; declare class X { method(): void } declare function f(): void; var f: () => void; diff --git a/tests/flow_type_declarations/__snapshots__/jsfmt.spec.js.snap b/tests/flow_type_declarations/__snapshots__/jsfmt.spec.js.snap index 47ee13df..5cf45ebb 100644 --- a/tests/flow_type_declarations/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow_type_declarations/__snapshots__/jsfmt.spec.js.snap @@ -100,7 +100,7 @@ export type SomeReallyLongLongLongLongLongLongLongLongLongLongLongLongLongLongKe export type SomeOtherLongLongLongLongLongLongLongLongLongLongLongLongLongLongKey = null; -type SomeOtherLongLongLongLongLongLongLongLongLongLongLongLongLongLongKey = SomeReallyLongLongLongLongLongLongIdentifier; +type SomeOtherLongLongLongLongLongLongLongLongLongLongLongLongLongLongKey2 = SomeReallyLongLongLongLongLongLongIdentifier; =====================================output===================================== export type AdamPlacementValidationSingleErrorKey = @@ -110,7 +110,7 @@ export type SomeReallyLongLongLongLongLongLongLongLongLongLongLongLongLongLongKe export type SomeOtherLongLongLongLongLongLongLongLongLongLongLongLongLongLongKey = null; -type SomeOtherLongLongLongLongLongLongLongLongLongLongLongLongLongLongKey = SomeReallyLongLongLongLongLongLongIdentifier; +type SomeOtherLongLongLongLongLongLongLongLongLongLongLongLongLongLongKey2 = SomeReallyLongLongLongLongLongLongIdentifier; ================================================================================ `; @@ -129,7 +129,7 @@ export type SomeReallyLongLongLongLongLongLongLongLongLongLongLongLongLongLongKe export type SomeOtherLongLongLongLongLongLongLongLongLongLongLongLongLongLongKey = null; -type SomeOtherLongLongLongLongLongLongLongLongLongLongLongLongLongLongKey = SomeReallyLongLongLongLongLongLongIdentifier; +type SomeOtherLongLongLongLongLongLongLongLongLongLongLongLongLongLongKey2 = SomeReallyLongLongLongLongLongLongIdentifier; =====================================output===================================== export type AdamPlacementValidationSingleErrorKey = @@ -139,7 +139,7 @@ export type SomeReallyLongLongLongLongLongLongLongLongLongLongLongLongLongLongKe export type SomeOtherLongLongLongLongLongLongLongLongLongLongLongLongLongLongKey = null -type SomeOtherLongLongLongLongLongLongLongLongLongLongLongLongLongLongKey = SomeReallyLongLongLongLongLongLongIdentifier +type SomeOtherLongLongLongLongLongLongLongLongLongLongLongLongLongLongKey2 = SomeReallyLongLongLongLongLongLongIdentifier ================================================================================ `; @@ -153,13 +153,13 @@ printWidth: 80 declare export opaque type Foo; declare export opaque type Bar; declare export opaque type Baz: Foo; -declare export opaque type Foo: Bar; -declare export opaque type Foo: Bar; -declare export opaque type Foo: Bar; +declare export opaque type Foo1: Bar; +declare export opaque type Foo2: Bar; +declare export opaque type Foo3: Bar; opaque type ID = string; -opaque type Foo = Bar; +opaque type Foo4 = Bar; opaque type Maybe = _Maybe; -export opaque type Foo = number; +export opaque type Foo5 = number; opaque type union = | {type: "A"} | {type: "B"}; @@ -171,13 +171,13 @@ opaque type overloads = declare export opaque type Foo; declare export opaque type Bar; declare export opaque type Baz: Foo; -declare export opaque type Foo: Bar; -declare export opaque type Foo: Bar; -declare export opaque type Foo: Bar; +declare export opaque type Foo1: Bar; +declare export opaque type Foo2: Bar; +declare export opaque type Foo3: Bar; opaque type ID = string; -opaque type Foo = Bar; +opaque type Foo4 = Bar; opaque type Maybe = _Maybe; -export opaque type Foo = number; +export opaque type Foo5 = number; opaque type union = { type: "A" } | { type: "B" }; opaque type overloads = ((x: string) => number) & ((x: number) => string); @@ -194,13 +194,13 @@ semi: false declare export opaque type Foo; declare export opaque type Bar; declare export opaque type Baz: Foo; -declare export opaque type Foo: Bar; -declare export opaque type Foo: Bar; -declare export opaque type Foo: Bar; +declare export opaque type Foo1: Bar; +declare export opaque type Foo2: Bar; +declare export opaque type Foo3: Bar; opaque type ID = string; -opaque type Foo = Bar; +opaque type Foo4 = Bar; opaque type Maybe = _Maybe; -export opaque type Foo = number; +export opaque type Foo5 = number; opaque type union = | {type: "A"} | {type: "B"}; @@ -212,13 +212,13 @@ opaque type overloads = declare export opaque type Foo declare export opaque type Bar declare export opaque type Baz: Foo -declare export opaque type Foo: Bar -declare export opaque type Foo: Bar -declare export opaque type Foo: Bar +declare export opaque type Foo1: Bar +declare export opaque type Foo2: Bar +declare export opaque type Foo3: Bar opaque type ID = string -opaque type Foo = Bar +opaque type Foo4 = Bar opaque type Maybe = _Maybe -export opaque type Foo = number +export opaque type Foo5 = number opaque type union = { type: "A" } | { type: "B" } opaque type overloads = ((x: string) => number) & ((x: number) => string) diff --git a/tests/flow_type_declarations/long.js b/tests/flow_type_declarations/long.js index 1728e1c0..78d46ad9 100644 --- a/tests/flow_type_declarations/long.js +++ b/tests/flow_type_declarations/long.js @@ -5,4 +5,4 @@ export type SomeReallyLongLongLongLongLongLongLongLongLongLongLongLongLongLongKe export type SomeOtherLongLongLongLongLongLongLongLongLongLongLongLongLongLongKey = null; -type SomeOtherLongLongLongLongLongLongLongLongLongLongLongLongLongLongKey = SomeReallyLongLongLongLongLongLongIdentifier; +type SomeOtherLongLongLongLongLongLongLongLongLongLongLongLongLongLongKey2 = SomeReallyLongLongLongLongLongLongIdentifier; diff --git a/tests/flow_type_declarations/opaque.js b/tests/flow_type_declarations/opaque.js index df63f0b1..657d8fbe 100644 --- a/tests/flow_type_declarations/opaque.js +++ b/tests/flow_type_declarations/opaque.js @@ -1,13 +1,13 @@ declare export opaque type Foo; declare export opaque type Bar; declare export opaque type Baz: Foo; -declare export opaque type Foo: Bar; -declare export opaque type Foo: Bar; -declare export opaque type Foo: Bar; +declare export opaque type Foo1: Bar; +declare export opaque type Foo2: Bar; +declare export opaque type Foo3: Bar; opaque type ID = string; -opaque type Foo = Bar; +opaque type Foo4 = Bar; opaque type Maybe = _Maybe; -export opaque type Foo = number; +export opaque type Foo5 = number; opaque type union = | {type: "A"} | {type: "B"}; diff --git a/tests/flow_type_spread/__snapshots__/jsfmt.spec.js.snap b/tests/flow_type_spread/__snapshots__/jsfmt.spec.js.snap index 02b13db0..fa40e2cb 100644 --- a/tests/flow_type_spread/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow_type_spread/__snapshots__/jsfmt.spec.js.snap @@ -6,12 +6,12 @@ parsers: ["flow", "babel"] printWidth: 80 | printWidth =====================================input====================================== -type X = {...Y/**/}; -type X = {/**/...Y}; +type X1 = {...Y/**/}; +type X2 = {/**/...Y}; =====================================output===================================== -type X = { ...Y /**/ }; -type X = { /**/ ...Y }; +type X1 = { ...Y /**/ }; +type X2 = { /**/ ...Y }; ================================================================================ `; diff --git a/tests/flow_type_spread/comments.js b/tests/flow_type_spread/comments.js index cbbce35b..8ff60a00 100644 --- a/tests/flow_type_spread/comments.js +++ b/tests/flow_type_spread/comments.js @@ -1,2 +1,2 @@ -type X = {...Y/**/}; -type X = {/**/...Y}; +type X1 = {...Y/**/}; +type X2 = {/**/...Y}; diff --git a/tests/flow_union/__snapshots__/jsfmt.spec.js.snap b/tests/flow_union/__snapshots__/jsfmt.spec.js.snap index e481c051..6c042cae 100644 --- a/tests/flow_union/__snapshots__/jsfmt.spec.js.snap +++ b/tests/flow_union/__snapshots__/jsfmt.spec.js.snap @@ -34,7 +34,7 @@ interface RelayProps { } | null> | null | void | 1, } -interface RelayProps { +interface RelayProps2 { articles: Array<{ __id: string, } | null> | null | void, @@ -66,7 +66,7 @@ interface RelayProps { | 1; } -interface RelayProps { +interface RelayProps2 { articles: Array<{ __id: string } | null> | null | void; diff --git a/tests/flow_union/union.js b/tests/flow_union/union.js index 8333e78b..7c7beea0 100644 --- a/tests/flow_union/union.js +++ b/tests/flow_union/union.js @@ -4,7 +4,7 @@ interface RelayProps { } | null> | null | void | 1, } -interface RelayProps { +interface RelayProps2 { articles: Array<{ __id: string, } | null> | null | void, diff --git a/tests/functional_composition/__snapshots__/jsfmt.spec.js.snap b/tests/functional_composition/__snapshots__/jsfmt.spec.js.snap index 8aeb875a..0f11bef6 100644 --- a/tests/functional_composition/__snapshots__/jsfmt.spec.js.snap +++ b/tests/functional_composition/__snapshots__/jsfmt.spec.js.snap @@ -153,13 +153,13 @@ foo(6); import * as _ from "lodash"; -const foo = _.flow( +const bar = _.flow( x => x + 1, x => x * 3, x => x - 6, ); -foo(6); +bar(6); =====================================output===================================== import { flow } from "lodash"; @@ -174,13 +174,13 @@ foo(6); import * as _ from "lodash"; -const foo = _.flow( +const bar = _.flow( x => x + 1, x => x * 3, x => x - 6 ); -foo(6); +bar(6); ================================================================================ `; @@ -203,13 +203,13 @@ foo(6); import * as _ from "lodash"; -const foo = _.flowRight( +const bar = _.flowRight( x => x + 1, x => x * 3, x => x - 6, ); -foo(6); +bar(6); =====================================output===================================== import { flowRight } from "lodash"; @@ -224,13 +224,13 @@ foo(6); import * as _ from "lodash"; -const foo = _.flowRight( +const bar = _.flowRight( x => x + 1, x => x * 3, x => x - 6 ); -foo(6); +bar(6); ================================================================================ `; @@ -476,13 +476,13 @@ printWidth: 80 =====================================input====================================== import { createSelector } from 'reselect'; -const resolve = createSelector( +const foo = createSelector( getIds, getObjects, (ids, objects) => ids.map(id => objects[id]) ); -const resolve = createSelector( +const bar = createSelector( [getIds, getObjects], (ids, objects) => ids.map(id => objects[id]) ); @@ -490,11 +490,11 @@ const resolve = createSelector( =====================================output===================================== import { createSelector } from "reselect"; -const resolve = createSelector(getIds, getObjects, (ids, objects) => +const foo = createSelector(getIds, getObjects, (ids, objects) => ids.map(id => objects[id]) ); -const resolve = createSelector([getIds, getObjects], (ids, objects) => +const bar = createSelector([getIds, getObjects], (ids, objects) => ids.map(id => objects[id]) ); diff --git a/tests/functional_composition/lodash_flow.js b/tests/functional_composition/lodash_flow.js index afa84db0..409651bc 100644 --- a/tests/functional_composition/lodash_flow.js +++ b/tests/functional_composition/lodash_flow.js @@ -10,10 +10,10 @@ foo(6); import * as _ from "lodash"; -const foo = _.flow( +const bar = _.flow( x => x + 1, x => x * 3, x => x - 6, ); -foo(6); +bar(6); diff --git a/tests/functional_composition/lodash_flow_right.js b/tests/functional_composition/lodash_flow_right.js index 5afd60bf..2358ccc4 100644 --- a/tests/functional_composition/lodash_flow_right.js +++ b/tests/functional_composition/lodash_flow_right.js @@ -10,10 +10,10 @@ foo(6); import * as _ from "lodash"; -const foo = _.flowRight( +const bar = _.flowRight( x => x + 1, x => x * 3, x => x - 6, ); -foo(6); +bar(6); diff --git a/tests/functional_composition/reselect_createselector.js b/tests/functional_composition/reselect_createselector.js index e9202329..d1e65357 100644 --- a/tests/functional_composition/reselect_createselector.js +++ b/tests/functional_composition/reselect_createselector.js @@ -1,12 +1,12 @@ import { createSelector } from 'reselect'; -const resolve = createSelector( +const foo = createSelector( getIds, getObjects, (ids, objects) => ids.map(id => objects[id]) ); -const resolve = createSelector( +const bar = createSelector( [getIds, getObjects], (ids, objects) => ids.map(id => objects[id]) ); diff --git a/tests/mdx/__snapshots__/jsfmt.spec.js.snap b/tests/mdx/__snapshots__/jsfmt.spec.js.snap index bc73e177..942f1e22 100644 --- a/tests/mdx/__snapshots__/jsfmt.spec.js.snap +++ b/tests/mdx/__snapshots__/jsfmt.spec.js.snap @@ -6,13 +6,13 @@ parsers: ["mdx"] printWidth: 80 | printWidth =====================================input====================================== -import A from 'a' +import D from 'd' import {A,B,C} from "hello-world" import {AAAAAAAAAAAAAAAAAAAAAAAA, BBBBBBBBBBBBBBBBBBBBBB, CCCCCCCCCCCCCCCCCCCCCCC} from 'xyz'; --- -import A from 'a' +import D from 'd' import {A,B,C} from "hello-world" @@ -41,7 +41,7 @@ export const a = 1; export const b = 1; =====================================output===================================== -import A from "a"; +import D from "d"; import { A, B, C } from "hello-world"; import { AAAAAAAAAAAAAAAAAAAAAAAA, @@ -51,7 +51,7 @@ import { --- -import A from "a"; +import D from "d"; import { A, B, C } from "hello-world"; @@ -93,13 +93,13 @@ printWidth: 80 semi: false | printWidth =====================================input====================================== -import A from 'a' +import D from 'd' import {A,B,C} from "hello-world" import {AAAAAAAAAAAAAAAAAAAAAAAA, BBBBBBBBBBBBBBBBBBBBBB, CCCCCCCCCCCCCCCCCCCCCCC} from 'xyz'; --- -import A from 'a' +import D from 'd' import {A,B,C} from "hello-world" @@ -128,7 +128,7 @@ export const a = 1; export const b = 1; =====================================output===================================== -import A from "a" +import D from "d" import { A, B, C } from "hello-world" import { AAAAAAAAAAAAAAAAAAAAAAAA, @@ -138,7 +138,7 @@ import { --- -import A from "a" +import D from "d" import { A, B, C } from "hello-world" diff --git a/tests/mdx/import-export.mdx b/tests/mdx/import-export.mdx index 02d17ef1..725c8908 100644 --- a/tests/mdx/import-export.mdx +++ b/tests/mdx/import-export.mdx @@ -1,10 +1,10 @@ -import A from 'a' +import D from 'd' import {A,B,C} from "hello-world" import {AAAAAAAAAAAAAAAAAAAAAAAA, BBBBBBBBBBBBBBBBBBBBBB, CCCCCCCCCCCCCCCCCCCCCCC} from 'xyz'; --- -import A from 'a' +import D from 'd' import {A,B,C} from "hello-world" diff --git a/tests/multiparser_js_css/__snapshots__/jsfmt.spec.js.snap b/tests/multiparser_js_css/__snapshots__/jsfmt.spec.js.snap index 5358044a..e21296a2 100644 --- a/tests/multiparser_js_css/__snapshots__/jsfmt.spec.js.snap +++ b/tests/multiparser_js_css/__snapshots__/jsfmt.spec.js.snap @@ -6,9 +6,9 @@ parsers: ["babel"] printWidth: 80 | printWidth =====================================input====================================== -const ListItem = styled.li\`\`; +const ListItem1 = styled.li\`\`; -const ListItem = styled.li\` \`; +const ListItem2 = styled.li\` \`; const Dropdown = styled.div\`position: relative;\` @@ -146,7 +146,7 @@ styled.a\` } \` -const StyledComponent = styled.div\` +const StyledComponent1 = styled.div\` \${anInterpolation} /* a comment */ @@ -155,7 +155,7 @@ const StyledComponent = styled.div\` } \`; -const StyledComponent = styled.div\` +const StyledComponent2 = styled.div\` \${anInterpolation} /* a comment */ @@ -166,9 +166,9 @@ const StyledComponent = styled.div\` \`; =====================================output===================================== -const ListItem = styled.li\`\`; +const ListItem1 = styled.li\`\`; -const ListItem = styled.li\`\`; +const ListItem2 = styled.li\`\`; const Dropdown = styled.div\` position: relative; @@ -307,7 +307,7 @@ styled.a\` } \`; -const StyledComponent = styled.div\` +const StyledComponent1 = styled.div\` \${anInterpolation} /* a comment */ @@ -316,7 +316,7 @@ const StyledComponent = styled.div\` } \`; -const StyledComponent = styled.div\` +const StyledComponent2 = styled.div\` \${anInterpolation} /* a comment */ diff --git a/tests/multiparser_js_css/styled-components.js b/tests/multiparser_js_css/styled-components.js index 54d2cf02..8c07ef48 100644 --- a/tests/multiparser_js_css/styled-components.js +++ b/tests/multiparser_js_css/styled-components.js @@ -1,6 +1,6 @@ -const ListItem = styled.li``; +const ListItem1 = styled.li``; -const ListItem = styled.li` `; +const ListItem2 = styled.li` `; const Dropdown = styled.div`position: relative;` @@ -138,7 +138,7 @@ styled.a` } ` -const StyledComponent = styled.div` +const StyledComponent1 = styled.div` ${anInterpolation} /* a comment */ @@ -147,7 +147,7 @@ const StyledComponent = styled.div` } `; -const StyledComponent = styled.div` +const StyledComponent2 = styled.div` ${anInterpolation} /* a comment */ diff --git a/tests/no-semi/__snapshots__/jsfmt.spec.js.snap b/tests/no-semi/__snapshots__/jsfmt.spec.js.snap index bd77217c..e0278222 100644 --- a/tests/no-semi/__snapshots__/jsfmt.spec.js.snap +++ b/tests/no-semi/__snapshots__/jsfmt.spec.js.snap @@ -484,19 +484,19 @@ class X {} [1, 2, 3].forEach(fn) // x(){} // } -class C { +class C1 { get; // The semicolon *is* necessary x(){} } -class C { +class C2 { get = () => {}; // The semicolon is *not* necessary x(){} } -class C { +class C3 { set; // The semicolon *is* necessary x(){} } -class C { +class C4 { set = () => {}; // The semicolon is *not* necessary x(){} } @@ -545,16 +545,16 @@ class A { } // being first/last shouldn't break things -class G { +class G1 { x = 1 } -class G { +class G2 { x() {} } -class G { +class G3 { *x() {} } -class G { +class G4 { [x] = 1 } @@ -662,19 +662,19 @@ class X {} // x(){} // } -class C { +class C1 { get; // The semicolon *is* necessary x() {} } -class C { +class C2 { get = () => {}; // The semicolon is *not* necessary x() {} } -class C { +class C3 { set; // The semicolon *is* necessary x() {} } -class C { +class C4 { set = () => {}; // The semicolon is *not* necessary x() {} } @@ -722,16 +722,16 @@ class A { } // being first/last shouldn't break things -class G { +class G1 { x = 1; } -class G { +class G2 { x() {} } -class G { +class G3 { *x() {} } -class G { +class G4 { [x] = 1; } @@ -835,19 +835,19 @@ class X {} [1, 2, 3].forEach(fn) // x(){} // } -class C { +class C1 { get; // The semicolon *is* necessary x(){} } -class C { +class C2 { get = () => {}; // The semicolon is *not* necessary x(){} } -class C { +class C3 { set; // The semicolon *is* necessary x(){} } -class C { +class C4 { set = () => {}; // The semicolon is *not* necessary x(){} } @@ -896,16 +896,16 @@ class A { } // being first/last shouldn't break things -class G { +class G1 { x = 1 } -class G { +class G2 { x() {} } -class G { +class G3 { *x() {} } -class G { +class G4 { [x] = 1 } @@ -1013,19 +1013,19 @@ class X {} // x(){} // } -class C { +class C1 { get; // The semicolon *is* necessary x() {} } -class C { +class C2 { get = () => {} // The semicolon is *not* necessary x() {} } -class C { +class C3 { set; // The semicolon *is* necessary x() {} } -class C { +class C4 { set = () => {} // The semicolon is *not* necessary x() {} } @@ -1073,16 +1073,16 @@ class A { } // being first/last shouldn't break things -class G { +class G1 { x = 1 } -class G { +class G2 { x() {} } -class G { +class G3 { *x() {} } -class G { +class G4 { [x] = 1 } @@ -1186,19 +1186,19 @@ class X {} [1, 2, 3].forEach(fn) // x(){} // } -class C { +class C1 { get; // The semicolon *is* necessary x(){} } -class C { +class C2 { get = () => {}; // The semicolon is *not* necessary x(){} } -class C { +class C3 { set; // The semicolon *is* necessary x(){} } -class C { +class C4 { set = () => {}; // The semicolon is *not* necessary x(){} } @@ -1247,16 +1247,16 @@ class A { } // being first/last shouldn't break things -class G { +class G1 { x = 1 } -class G { +class G2 { x() {} } -class G { +class G3 { *x() {} } -class G { +class G4 { [x] = 1 } @@ -1364,19 +1364,19 @@ class X {} // x(){} // } -class C { +class C1 { get; // The semicolon *is* necessary x() {} } -class C { +class C2 { get = () => {} // The semicolon is *not* necessary x() {} } -class C { +class C3 { set; // The semicolon *is* necessary x() {} } -class C { +class C4 { set = () => {} // The semicolon is *not* necessary x() {} } @@ -1424,16 +1424,16 @@ class A { } // being first/last shouldn't break things -class G { +class G1 { x = 1 } -class G { +class G2 { x() {} } -class G { +class G3 { *x() {} } -class G { +class G4 { [x] = 1 } diff --git a/tests/no-semi/no-semi.js b/tests/no-semi/no-semi.js index 91b370a4..351c104b 100644 --- a/tests/no-semi/no-semi.js +++ b/tests/no-semi/no-semi.js @@ -29,19 +29,19 @@ class X {} [1, 2, 3].forEach(fn) // x(){} // } -class C { +class C1 { get; // The semicolon *is* necessary x(){} } -class C { +class C2 { get = () => {}; // The semicolon is *not* necessary x(){} } -class C { +class C3 { set; // The semicolon *is* necessary x(){} } -class C { +class C4 { set = () => {}; // The semicolon is *not* necessary x(){} } @@ -90,16 +90,16 @@ class A { } // being first/last shouldn't break things -class G { +class G1 { x = 1 } -class G { +class G2 { x() {} } -class G { +class G3 { *x() {} } -class G { +class G4 { [x] = 1 } diff --git a/tests/nullish_coalescing/__snapshots__/jsfmt.spec.js.snap b/tests/nullish_coalescing/__snapshots__/jsfmt.spec.js.snap index 95804430..a85951d9 100644 --- a/tests/nullish_coalescing/__snapshots__/jsfmt.spec.js.snap +++ b/tests/nullish_coalescing/__snapshots__/jsfmt.spec.js.snap @@ -16,11 +16,6 @@ foo ?? (bar ?? baz); (foo ?? baz) || baz; -// Note: this will trigger a syntax error once the parsers have been -// updated to the latest specification. If you are doing the upgrade, -// please remove the following line (and this comment). -foo ?? baz || baz; - (foo && baz) ?? baz; foo && (baz ?? baz); @@ -35,11 +30,6 @@ foo ?? (bar ?? baz); (foo ?? baz) || baz; -// Note: this will trigger a syntax error once the parsers have been -// updated to the latest specification. If you are doing the upgrade, -// please remove the following line (and this comment). -(foo ?? baz) || baz; - (foo && baz) ?? baz; foo && (baz ?? baz); diff --git a/tests/nullish_coalescing/nullish_coalesing_operator.js b/tests/nullish_coalescing/nullish_coalesing_operator.js index aaea1fdc..197fca77 100644 --- a/tests/nullish_coalescing/nullish_coalesing_operator.js +++ b/tests/nullish_coalescing/nullish_coalesing_operator.js @@ -8,10 +8,5 @@ foo ?? (bar ?? baz); (foo ?? baz) || baz; -// Note: this will trigger a syntax error once the parsers have been -// updated to the latest specification. If you are doing the upgrade, -// please remove the following line (and this comment). -foo ?? baz || baz; - (foo && baz) ?? baz; foo && (baz ?? baz); diff --git a/tests/object_property_comment/__snapshots__/jsfmt.spec.js.snap b/tests/object_property_comment/__snapshots__/jsfmt.spec.js.snap index c2d63ec9..e59748f1 100644 --- a/tests/object_property_comment/__snapshots__/jsfmt.spec.js.snap +++ b/tests/object_property_comment/__snapshots__/jsfmt.spec.js.snap @@ -10,7 +10,7 @@ let a = { a /* comment */: () => 1 }; -let a = { +let b = { "a" /* comment */: () => 1 }; @@ -19,7 +19,7 @@ let a = { a /* comment */: () => 1 }; -let a = { +let b = { a /* comment */: () => 1 }; diff --git a/tests/object_property_comment/after-key.js b/tests/object_property_comment/after-key.js index 40b49c87..27388e0c 100644 --- a/tests/object_property_comment/after-key.js +++ b/tests/object_property_comment/after-key.js @@ -2,6 +2,6 @@ let a = { a /* comment */: () => 1 }; -let a = { +let b = { "a" /* comment */: () => 1 }; diff --git a/tests/objects/__snapshots__/jsfmt.spec.js.snap b/tests/objects/__snapshots__/jsfmt.spec.js.snap index f53fea62..74537c03 100644 --- a/tests/objects/__snapshots__/jsfmt.spec.js.snap +++ b/tests/objects/__snapshots__/jsfmt.spec.js.snap @@ -40,17 +40,17 @@ a = () => ({}).x; ({} = 0); (({} = 0), 1); -const a = { +const a1 = { someKey: (shortName, shortName) }; -const a = { +const a2 = { someKey: (longLongLongLongLongLongLongLongLongLongLongLongLongLongName, shortName) }; -const a = { +const a3 = { someKey: (longLongLongLongLongLongLongLongLongLongLongLongLongLongName, longLongLongLongLongLongLongLongLongLongLongLongLongLongName, longLongLongLongLongLongLongLongLongLongLongLongLongLongName) }; @@ -66,16 +66,16 @@ a = () => ({}.x); ({} = 0); ({} = 0), 1; -const a = { +const a1 = { someKey: (shortName, shortName) }; -const a = { +const a2 = { someKey: (longLongLongLongLongLongLongLongLongLongLongLongLongLongName, shortName) }; -const a = { +const a3 = { someKey: (longLongLongLongLongLongLongLongLongLongLongLongLongLongName, longLongLongLongLongLongLongLongLongLongLongLongLongLongName, diff --git a/tests/objects/expression.js b/tests/objects/expression.js index 2878e61f..0487809a 100644 --- a/tests/objects/expression.js +++ b/tests/objects/expression.js @@ -8,17 +8,17 @@ a = () => ({}).x; ({} = 0); (({} = 0), 1); -const a = { +const a1 = { someKey: (shortName, shortName) }; -const a = { +const a2 = { someKey: (longLongLongLongLongLongLongLongLongLongLongLongLongLongName, shortName) }; -const a = { +const a3 = { someKey: (longLongLongLongLongLongLongLongLongLongLongLongLongLongName, longLongLongLongLongLongLongLongLongLongLongLongLongLongName, longLongLongLongLongLongLongLongLongLongLongLongLongLongName) }; diff --git a/tests/template/__snapshots__/jsfmt.spec.js.snap b/tests/template/__snapshots__/jsfmt.spec.js.snap index 6e513373..d62faad0 100644 --- a/tests/template/__snapshots__/jsfmt.spec.js.snap +++ b/tests/template/__snapshots__/jsfmt.spec.js.snap @@ -421,7 +421,7 @@ b.c\`\`; (++b)\`\`; // "YieldExpression" -function* f() { +function* d() { (yield 1)\`\`; } @@ -477,7 +477,7 @@ new B()\`\`; (++b)\`\`; // "YieldExpression" -function* f() { +function* d() { (yield 1)\`\`; } diff --git a/tests/template/parenthesis.js b/tests/template/parenthesis.js index aba40899..d4c43a30 100644 --- a/tests/template/parenthesis.js +++ b/tests/template/parenthesis.js @@ -49,6 +49,6 @@ b.c``; (++b)``; // "YieldExpression" -function* f() { +function* d() { (yield 1)``; } diff --git a/tests/yield/__snapshots__/jsfmt.spec.js.snap b/tests/yield/__snapshots__/jsfmt.spec.js.snap index 78a36fd2..ea0f5bce 100644 --- a/tests/yield/__snapshots__/jsfmt.spec.js.snap +++ b/tests/yield/__snapshots__/jsfmt.spec.js.snap @@ -28,7 +28,7 @@ parsers: ["babel", "typescript"] printWidth: 80 | printWidth =====================================input====================================== -function* f() { +function* f1() { a = (yield) ? 1 : 1; a = yield 1 ? 1 : 1; a = (yield 1) ? 1 : 1; @@ -36,20 +36,20 @@ function* f() { a = 1 ? yield 1 : yield 1; } -function* f() { +function* f2() { a = yield* 1 ? 1 : 1; a = (yield* 1) ? 1 : 1; a = 1 ? yield* 1 : yield* 1; } -async function f() { +async function f3() { a = await 1 ? 1 : 1; a = (await 1) ? 1 : 1; a = 1 ? await 1 : await 1; } =====================================output===================================== -function* f() { +function* f1() { a = (yield) ? 1 : 1; a = yield 1 ? 1 : 1; a = (yield 1) ? 1 : 1; @@ -57,13 +57,13 @@ function* f() { a = 1 ? yield 1 : yield 1; } -function* f() { +function* f2() { a = yield* 1 ? 1 : 1; a = (yield* 1) ? 1 : 1; a = 1 ? yield* 1 : yield* 1; } -async function f() { +async function f3() { a = (await 1) ? 1 : 1; a = (await 1) ? 1 : 1; a = 1 ? await 1 : await 1; diff --git a/tests/yield/conditional.js b/tests/yield/conditional.js index 0dfb0c4c..91256ad8 100644 --- a/tests/yield/conditional.js +++ b/tests/yield/conditional.js @@ -1,4 +1,4 @@ -function* f() { +function* f1() { a = (yield) ? 1 : 1; a = yield 1 ? 1 : 1; a = (yield 1) ? 1 : 1; @@ -6,13 +6,13 @@ function* f() { a = 1 ? yield 1 : yield 1; } -function* f() { +function* f2() { a = yield* 1 ? 1 : 1; a = (yield* 1) ? 1 : 1; a = 1 ? yield* 1 : yield* 1; } -async function f() { +async function f3() { a = await 1 ? 1 : 1; a = (await 1) ? 1 : 1; a = 1 ? await 1 : await 1; diff --git a/yarn.lock b/yarn.lock index 97aa6aa6..fc76f139 100644 --- a/yarn.lock +++ b/yarn.lock @@ -282,9 +282,10 @@ esutils "^2.0.2" js-tokens "^4.0.0" -"@babel/parser@7.2.0": - version "7.2.0" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.2.0.tgz#02d01dbc330b6cbf36b76ac93c50752c69027065" +"@babel/parser@7.6.3": + version "7.6.3" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.6.3.tgz#9eff8b9c3eeae16a74d8d4ff30da2bd0d6f0487e" + integrity sha512-sUZdXlva1dt2Vw2RqbMkmfoImubO0D0gaCrNngV6Hi0DA4x3o4mlrq0tbfY0dZEUIccH8I6wQ4qgEtwcpOR6Qg== "@babel/parser@^7.1.2": version "7.1.2"