Update `@babel/parser` to v7.6.3 (#6386)

* fix flow_function_parentheses

* fix directives

* fix classes

* fix flow_method

* fix `do`

* fix `decorators`

* fix `comments_closure_typecast`

* fix `comments`

* fix `flow_internal_slot`

* fix `flow_comments`

* fix `flow_type_declarations`

* fix `flow_type_spread`

* fix `functional_composition`

* fix `multiparser_js_css`

* fix `no-semi`

* fix `objects`

* fix `template`

* fix `yield`

* update `flow_method` snap

* fix `empty_paren_comment`

* fix `mdx`

* fix `object_property_comment`

* Update `@babel/parser`

* Update @babel/parser to v7.6.2

* Update yarn.lock

* fix `nullish_coalescing` test

* fix `flow_class_field` test

* fix snapshot

* @babel/parser v7.6.3

* fix tests

* update snap
master
fisker Cheung 2019-10-09 19:52:11 +08:00 committed by Evilebot Tnawi
parent 7daf06f4ca
commit 179943ccba
62 changed files with 550 additions and 552 deletions

View File

@ -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",

View File

@ -30,22 +30,22 @@ class MyContractSelectionWidget extends React.Component<void, MyContractSelecti
method() {}
}
class DisplayObject
class DisplayObject1
extends utils.EventEmitter
implements interaction_InteractiveTarget {
}
class DisplayObject extends utils.EventEmitter
class DisplayObject2 extends utils.EventEmitter
implements interaction_InteractiveTarget {
}
class DisplayObject extends utils.EventEmitter
class DisplayObject3 extends utils.EventEmitter
implements interaction_InteractiveTarget,
somethingElse_SomeOtherThing,
somethingElseAgain_RunningOutOfNames {
}
class DisplayObject extends utils.EventEmitter implements interaction_InteractiveTarget {}
class DisplayObject4 extends utils.EventEmitter implements interaction_InteractiveTarget {}
class Readable extends events.EventEmitter implements NodeJS_ReadableStream {}
class InMemoryAppender extends log4javascript.Appender implements ICachedLogMessageProvider {}
@ -69,19 +69,19 @@ class MyContractSelectionWidget
method() {}
}
class DisplayObject extends utils.EventEmitter
class DisplayObject1 extends utils.EventEmitter
implements interaction_InteractiveTarget {}
class DisplayObject extends utils.EventEmitter
class DisplayObject2 extends utils.EventEmitter
implements interaction_InteractiveTarget {}
class DisplayObject extends utils.EventEmitter
class DisplayObject3 extends utils.EventEmitter
implements
interaction_InteractiveTarget,
somethingElse_SomeOtherThing,
somethingElseAgain_RunningOutOfNames {}
class DisplayObject extends utils.EventEmitter
class DisplayObject4 extends utils.EventEmitter
implements interaction_InteractiveTarget {}
class Readable extends events.EventEmitter implements NodeJS_ReadableStream {}
class InMemoryAppender extends log4javascript.Appender
@ -125,32 +125,32 @@ parsers: ["flow", "babel", "typescript"]
printWidth: 80
| printWidth
=====================================input======================================
class A {
class A1 {
// comment
}
class A { // comment
class A2 { // comment
}
class A {
class A3 {
}
class A {
class A4 {
m() {}
}
=====================================output=====================================
class A {
class A1 {
// comment
}
class A {
class A2 {
// comment
}
class A {}
class A3 {}
class A {
class A4 {
m() {}
}

View File

@ -2,22 +2,22 @@ class MyContractSelectionWidget extends React.Component<void, MyContractSelecti
method() {}
}
class DisplayObject
class DisplayObject1
extends utils.EventEmitter
implements interaction_InteractiveTarget {
}
class DisplayObject extends utils.EventEmitter
class DisplayObject2 extends utils.EventEmitter
implements interaction_InteractiveTarget {
}
class DisplayObject extends utils.EventEmitter
class DisplayObject3 extends utils.EventEmitter
implements interaction_InteractiveTarget,
somethingElse_SomeOtherThing,
somethingElseAgain_RunningOutOfNames {
}
class DisplayObject extends utils.EventEmitter implements interaction_InteractiveTarget {}
class DisplayObject4 extends utils.EventEmitter implements interaction_InteractiveTarget {}
class Readable extends events.EventEmitter implements NodeJS_ReadableStream {}
class InMemoryAppender extends log4javascript.Appender implements ICachedLogMessageProvider {}

View File

@ -1,13 +1,13 @@
class A {
class A1 {
// comment
}
class A { // comment
class A2 { // comment
}
class A {
class A3 {
}
class A {
class A4 {
m() {}
}

View File

@ -28,7 +28,7 @@ const { a /* comment */ = 1 } = b;
const { c = 1 /* comment */ } = d;
let {a //comment
let {d //comment
= b} = c
=====================================output=====================================
@ -37,7 +37,7 @@ const { a /* comment */ = 1 } = b;
const { c = 1 /* comment */ } = d;
let {
a = b //comment
d = b //comment
} = c;
================================================================================
@ -347,12 +347,12 @@ parsers: ["flow", "babel"]
printWidth: 80
| printWidth
=====================================input======================================
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 */);
@ -361,16 +361,16 @@ declare class Foo extends Qux<string> {/* 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<E, EM, D>
// Uploading to aws3 and CreatePostMutation succeeded
| {type: "Success", data: D};
type UploadState<E, EM, D>
type UploadState2<E, EM, D>
// The upload hasnt begun yet
= A
// The upload timed out
@ -578,7 +586,7 @@ type UploadState<E, EM, D> =
// Uploading to aws3 and CreatePostMutation succeeded
| { type: "Success", data: D };
type UploadState<E, EM, D> =
type UploadState2<E, EM, D> =
// The upload hasnt begun yet
| A
// The upload timed out
@ -605,14 +613,14 @@ KEYPAD_NUMBERS.map(num => ( // Buttons 0-9
<div />
));
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
) => <div />);
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<SectionMode> {}
};
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));

View File

@ -2,5 +2,5 @@ const { a /* comment */ = 1 } = b;
const { c = 1 /* comment */ } = d;
let {a //comment
let {d //comment
= b} = c

View File

@ -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 */);

View File

@ -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

View File

@ -8,7 +8,7 @@ type UploadState<E, EM, D>
// Uploading to aws3 and CreatePostMutation succeeded
| {type: "Success", data: D};
type UploadState<E, EM, D>
type UploadState2<E, EM, D>
// The upload hasnt begun yet
= A
// The upload timed out

View File

@ -6,14 +6,14 @@ KEYPAD_NUMBERS.map(num => ( // Buttons 0-9
<div />
));
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;
}

View File

@ -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']

View File

@ -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))

View File

@ -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);
================================================================================
`;

View File

@ -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);

View File

@ -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 {
//

View File

@ -8,7 +8,7 @@ const foo = @deco class {
//
};
const foo =
const bar =
@deco
class {
//

View File

@ -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 });

View File

@ -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';

View File

@ -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()) {

View File

@ -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() }

View File

@ -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);
================================================================================
`;

View File

@ -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);

View File

@ -7,12 +7,12 @@ printWidth: 80
| printWidth
=====================================input======================================
class Foo {
constructor: () => this;
bar: () => this;
}
=====================================output=====================================
class Foo {
constructor: () => this;
bar: () => this;
}
================================================================================

View File

@ -1,3 +1,3 @@
class Foo {
constructor: () => this;
bar: () => this;
}

View File

@ -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<void> */ => {}
=====================================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<void> */ => {};
@ -107,11 +107,11 @@ printWidth: 80
| printWidth
=====================================input======================================
let foo /*: Groups<T> */;
let foo /*: string */ = 'a';
let bar /*: string */ = 'a';
=====================================output=====================================
let foo /*: Groups<T> */;
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
};

View File

@ -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<void> */ => {}

View File

@ -1,2 +1,2 @@
let foo /*: Groups<T> */;
let foo /*: string */ = 'a';
let bar /*: string */ = 'a';

View File

@ -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
};

View File

@ -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 = <A>(B<C>) => 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 = <A>(B<C>) => 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 = <A>(B<C>) => 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 = <A>(B<C>) => 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 = <A>(B<C>) => 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 = <A>(B<C>) => 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;
================================================================================
`;

View File

@ -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 = <A>(B<C>) => 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;

View File

@ -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 };
================================================================================
`;

View File

@ -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 }

View File

@ -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;
}

View File

@ -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;

View File

@ -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<T>;
declare export opaque type Baz: Foo;
declare export opaque type Foo<T>: Bar<T>;
declare export opaque type Foo<T>: Bar;
declare export opaque type Foo: Bar<T>;
declare export opaque type Foo1<T>: Bar<T>;
declare export opaque type Foo2<T>: Bar;
declare export opaque type Foo3: Bar<T>;
opaque type ID = string;
opaque type Foo<T> = Bar<T>;
opaque type Foo4<T> = Bar<T>;
opaque type Maybe<T> = _Maybe<T, *>;
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<T>;
declare export opaque type Baz: Foo;
declare export opaque type Foo<T>: Bar<T>;
declare export opaque type Foo<T>: Bar;
declare export opaque type Foo: Bar<T>;
declare export opaque type Foo1<T>: Bar<T>;
declare export opaque type Foo2<T>: Bar;
declare export opaque type Foo3: Bar<T>;
opaque type ID = string;
opaque type Foo<T> = Bar<T>;
opaque type Foo4<T> = Bar<T>;
opaque type Maybe<T> = _Maybe<T, *>;
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<T>;
declare export opaque type Baz: Foo;
declare export opaque type Foo<T>: Bar<T>;
declare export opaque type Foo<T>: Bar;
declare export opaque type Foo: Bar<T>;
declare export opaque type Foo1<T>: Bar<T>;
declare export opaque type Foo2<T>: Bar;
declare export opaque type Foo3: Bar<T>;
opaque type ID = string;
opaque type Foo<T> = Bar<T>;
opaque type Foo4<T> = Bar<T>;
opaque type Maybe<T> = _Maybe<T, *>;
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<T>
declare export opaque type Baz: Foo
declare export opaque type Foo<T>: Bar<T>
declare export opaque type Foo<T>: Bar
declare export opaque type Foo: Bar<T>
declare export opaque type Foo1<T>: Bar<T>
declare export opaque type Foo2<T>: Bar
declare export opaque type Foo3: Bar<T>
opaque type ID = string
opaque type Foo<T> = Bar<T>
opaque type Foo4<T> = Bar<T>
opaque type Maybe<T> = _Maybe<T, *>
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)

View File

@ -5,4 +5,4 @@ export type SomeReallyLongLongLongLongLongLongLongLongLongLongLongLongLongLongKe
export type SomeOtherLongLongLongLongLongLongLongLongLongLongLongLongLongLongKey = null;
type SomeOtherLongLongLongLongLongLongLongLongLongLongLongLongLongLongKey = SomeReallyLongLongLongLongLongLongIdentifier;
type SomeOtherLongLongLongLongLongLongLongLongLongLongLongLongLongLongKey2 = SomeReallyLongLongLongLongLongLongIdentifier;

View File

@ -1,13 +1,13 @@
declare export opaque type Foo;
declare export opaque type Bar<T>;
declare export opaque type Baz: Foo;
declare export opaque type Foo<T>: Bar<T>;
declare export opaque type Foo<T>: Bar;
declare export opaque type Foo: Bar<T>;
declare export opaque type Foo1<T>: Bar<T>;
declare export opaque type Foo2<T>: Bar;
declare export opaque type Foo3: Bar<T>;
opaque type ID = string;
opaque type Foo<T> = Bar<T>;
opaque type Foo4<T> = Bar<T>;
opaque type Maybe<T> = _Maybe<T, *>;
export opaque type Foo = number;
export opaque type Foo5 = number;
opaque type union =
| {type: "A"}
| {type: "B"};

View File

@ -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 };
================================================================================
`;

View File

@ -1,2 +1,2 @@
type X = {...Y/**/};
type X = {/**/...Y};
type X1 = {...Y/**/};
type X2 = {/**/...Y};

View File

@ -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;

View File

@ -4,7 +4,7 @@ interface RelayProps {
} | null> | null | void | 1,
}
interface RelayProps {
interface RelayProps2 {
articles: Array<{
__id: string,
} | null> | null | void,

View File

@ -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])
);

View File

@ -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);

View File

@ -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);

View File

@ -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])
);

View File

@ -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"

View File

@ -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"

View File

@ -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 */

View File

@ -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 */

View File

@ -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
}

View File

@ -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
}

View File

@ -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);

View File

@ -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);

View File

@ -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
};

View File

@ -2,6 +2,6 @@ let a = {
a /* comment */: () => 1
};
let a = {
let b = {
"a" /* comment */: () => 1
};

View File

@ -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,

View File

@ -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)
};

View File

@ -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)\`\`;
}

View File

@ -49,6 +49,6 @@ b.c``;
(++b)``;
// "YieldExpression"
function* f() {
function* d() {
(yield 1)``;
}

View File

@ -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;

View File

@ -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;

View File

@ -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"