Propagate breaks upwards automatically, introduce breakParent, and deprecate multilineGroup (#440)

This commit is contained in:
James Long authored and GitHub committed 2017-01-23 18:47:11 -05:00
1 parent 66fe2f78fa
commit cd2f7393ef
10 files changed
+212 -121

No files matched your search

+20 -10
View File
@@ -149,11 +149,16 @@ export type AsyncExecuteOptions = child_process$execFileOpts & {
// optional trailing comma gets moved all the way to the beginning
const regex = new RegExp(
// optional trailing comma
\"^\\\\s*\" + // beginning of the line
\"name\\\\s*=\\\\s*\" + // name =
\"[\'\\\"]\" + // opening quotation mark
escapeStringRegExp(target.name) + // target name
\"[\'\\\"]\" + // closing quotation mark
\"^\\\\s*\" +
// beginning of the line
\"name\\\\s*=\\\\s*\" +
// name =
\"[\'\\\"]\" +
// opening quotation mark
escapeStringRegExp(target.name) +
// target name
\"[\'\\\"]\" +
// closing quotation mark
\",?$\"
);
@@ -345,11 +350,16 @@ export type AsyncExecuteOptions = child_process$execFileOpts & {
// optional trailing comma gets moved all the way to the beginning
const regex = new RegExp(
// optional trailing comma
\"^\\\\s*\" + // beginning of the line
\"name\\\\s*=\\\\s*\" + // name =
\"[\'\\\"]\" + // opening quotation mark
escapeStringRegExp(target.name) + // target name
\"[\'\\\"]\" + // closing quotation mark
\"^\\\\s*\" +
// beginning of the line
\"name\\\\s*=\\\\s*\" +
// name =
\"[\'\\\"]\" +
// opening quotation mark
escapeStringRegExp(target.name) +
// target name
\"[\'\\\"]\" +
// closing quotation mark
\",?$\"
);
@@ -388,7 +388,8 @@ new (function() {
(function() {
});
a = function f() {
} || b;
} ||
b;
"
`;
@@ -2490,7 +2490,8 @@ type Breakfast = Apple | Orange | Broccoli | Carrot;
function bar(x: Breakfast) {
if (x.kind === \"Fruit\") {
(x.taste: \"Good\");
} // error, Apple.taste = Bad else (x.raw: \"No\"); // error, Carrot.raw = Maybe
} // error, Apple.taste = Bad else
(x.raw: \"No\"); // error, Carrot.raw = Maybe
}
function qux(x: Breakfast) {
@@ -17,7 +17,8 @@ function foo(x: ?string): $NonMaybeType<?string> {
function foo(x: ?string): $NonMaybeType<?string> {
if (x != null) {
return x;
} else return 0; // this should be an error
} else
return 0; // this should be an error
}
//(foo(): string); // should not be necessary to expose the error above