Fix missing trailing commas on flow generics (#1381)
parent
96e5c889e3
commit
c0a0bf46bc
|
@ -1864,6 +1864,7 @@ function genericPrintNoParens(path, options, print, args) {
|
||||||
join(concat([",", line]), path.map(print, "params"))
|
join(concat([",", line]), path.map(print, "params"))
|
||||||
])
|
])
|
||||||
),
|
),
|
||||||
|
ifBreak(shouldPrintComma(options, "all") ? "," : ""),
|
||||||
softline,
|
softline,
|
||||||
">"
|
">"
|
||||||
])
|
])
|
||||||
|
|
|
@ -26,3 +26,68 @@ var X = {
|
||||||
};
|
};
|
||||||
|
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
exports[`break.js 2`] = `
|
||||||
|
var X = {
|
||||||
|
perform: function<
|
||||||
|
A, B, C, D, E, F, G,
|
||||||
|
T: (a: A, b: B, c: C, d: D, e: E, f: F) => G // eslint-disable-line space-before-function-paren
|
||||||
|
>(
|
||||||
|
method: T, scope: any,
|
||||||
|
a: A, b: B, c: C, d: D, e: E, f: F,
|
||||||
|
): G {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
var X = {
|
||||||
|
perform: function<
|
||||||
|
A,
|
||||||
|
B,
|
||||||
|
C,
|
||||||
|
D,
|
||||||
|
E,
|
||||||
|
F,
|
||||||
|
G,
|
||||||
|
T: (a: A, b: B, c: C, d: D, e: E, f: F) => G, // eslint-disable-line space-before-function-paren
|
||||||
|
>(method: T, scope: any, a: A, b: B, c: C, d: D, e: E, f: F): G {},
|
||||||
|
};
|
||||||
|
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`trailing.js 1`] = `
|
||||||
|
type State = {
|
||||||
|
errors: Immutable.Map<
|
||||||
|
Ahohohhohohohohohohohohohohooh,
|
||||||
|
Fbt | Immutable.Map<ErrorIndex, Fbt>
|
||||||
|
>,
|
||||||
|
shouldValidate: boolean,
|
||||||
|
};
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
type State = {
|
||||||
|
errors: Immutable.Map<
|
||||||
|
Ahohohhohohohohohohohohohohooh,
|
||||||
|
Fbt | Immutable.Map<ErrorIndex, Fbt>
|
||||||
|
>,
|
||||||
|
shouldValidate: boolean
|
||||||
|
};
|
||||||
|
|
||||||
|
`;
|
||||||
|
|
||||||
|
exports[`trailing.js 2`] = `
|
||||||
|
type State = {
|
||||||
|
errors: Immutable.Map<
|
||||||
|
Ahohohhohohohohohohohohohohooh,
|
||||||
|
Fbt | Immutable.Map<ErrorIndex, Fbt>
|
||||||
|
>,
|
||||||
|
shouldValidate: boolean,
|
||||||
|
};
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
type State = {
|
||||||
|
errors: Immutable.Map<
|
||||||
|
Ahohohhohohohohohohohohohohooh,
|
||||||
|
Fbt | Immutable.Map<ErrorIndex, Fbt>,
|
||||||
|
>,
|
||||||
|
shouldValidate: boolean,
|
||||||
|
};
|
||||||
|
|
||||||
|
`;
|
||||||
|
|
|
@ -1 +1,2 @@
|
||||||
run_spec(__dirname);
|
run_spec(__dirname);
|
||||||
|
run_spec(__dirname, { trailingComma: 'all' });
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
type State = {
|
||||||
|
errors: Immutable.Map<
|
||||||
|
Ahohohhohohohohohohohohohohooh,
|
||||||
|
Fbt | Immutable.Map<ErrorIndex, Fbt>
|
||||||
|
>,
|
||||||
|
shouldValidate: boolean,
|
||||||
|
};
|
Loading…
Reference in New Issue