Fix running flow on travis and update flow (#9128)
* Fix running flow on travis and update flow - ensure bootstrap is run before running flow as we need some generated files for correctly doing typechecks - ensure that we only ignore the build directory inside the babel folder as currently we ignore everything because travis checks out into ‘/home/travis/build/’ * Fix all flow errors
This commit is contained in:
parent
4b73818c87
commit
4ca35ef8b9
13
.flowconfig
13
.flowconfig
@ -1,11 +1,10 @@
|
|||||||
[ignore]
|
[ignore]
|
||||||
.*/build/.*
|
<PROJECT_ROOT>/build/.*
|
||||||
.*/packages/.*/lib
|
<PROJECT_ROOT>/packages/.*/lib
|
||||||
.*/packages/.*/test
|
<PROJECT_ROOT>/packages/.*/test
|
||||||
.*/codemods/.*/lib
|
<PROJECT_ROOT>/codemods/.*/lib
|
||||||
.*/codemods/.*/test
|
<PROJECT_ROOT>/codemods/.*/test
|
||||||
.*/node_modules/conventional-changelog-core/
|
<PROJECT_ROOT>/node_modules/module-deps/
|
||||||
.*/node_modules/module-deps/
|
|
||||||
|
|
||||||
[include]
|
[include]
|
||||||
packages/*/src
|
packages/*/src
|
||||||
|
|||||||
15
.travis.yml
15
.travis.yml
@ -20,17 +20,18 @@ before_install:
|
|||||||
|
|
||||||
install:
|
install:
|
||||||
# the `make test-ci` script runs this command already
|
# the `make test-ci` script runs this command already
|
||||||
- if [ "$JOB" != "test" ]; then yarn install; fi
|
- if [ "$JOB" != "test" ] && [ "$JOB" != "lint" ]; then yarn install; fi
|
||||||
|
- if [ "$JOB" = "lint" ]; then make bootstrap; fi
|
||||||
|
|
||||||
before_script:
|
before_script:
|
||||||
- 'if [ "$JOB" = "babel-parser-flow-tests" ]; then make bootstrap-flow; fi'
|
- if [ "$JOB" = "babel-parser-flow-tests" ]; then make bootstrap-flow; fi
|
||||||
- 'if [ "$JOB" = "babel-parser-test262-tests" ]; then make bootstrap-test262; fi'
|
- if [ "$JOB" = "babel-parser-test262-tests" ]; then make bootstrap-test262; fi
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- 'if [ "$JOB" = "test" ]; then make test-ci; fi'
|
- if [ "$JOB" = "test" ]; then make test-ci; fi
|
||||||
- 'if [ "$JOB" = "lint" ]; then make lint && make flow; fi'
|
- if [ "$JOB" = "lint" ]; then make lint && make flow; fi
|
||||||
- 'if [ "$JOB" = "babel-parser-flow-tests" ]; then make test-flow-ci; fi'
|
- if [ "$JOB" = "babel-parser-flow-tests" ]; then make test-flow-ci; fi
|
||||||
- 'if [ "$JOB" = "babel-parser-test262-tests" ]; then make test-test262-ci; fi'
|
- if [ "$JOB" = "babel-parser-test262-tests" ]; then make test-test262-ci; fi
|
||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
fast_finish: true
|
fast_finish: true
|
||||||
|
|||||||
@ -36,7 +36,7 @@
|
|||||||
"eslint-plugin-flowtype": "^3.2.0",
|
"eslint-plugin-flowtype": "^3.2.0",
|
||||||
"eslint-plugin-local-rules": "0.1.0",
|
"eslint-plugin-local-rules": "0.1.0",
|
||||||
"eslint-plugin-prettier": "^3.0.0",
|
"eslint-plugin-prettier": "^3.0.0",
|
||||||
"flow-bin": "^0.82.0",
|
"flow-bin": "^0.87.0",
|
||||||
"graceful-fs": "^4.1.11",
|
"graceful-fs": "^4.1.11",
|
||||||
"gulp": "^4.0.0",
|
"gulp": "^4.0.0",
|
||||||
"gulp-babel": "^8.0.0",
|
"gulp-babel": "^8.0.0",
|
||||||
|
|||||||
@ -43,6 +43,7 @@ export function makeWeakCache<
|
|||||||
>(
|
>(
|
||||||
handler: (ArgT, CacheConfigurator<SideChannel>) => ResultT,
|
handler: (ArgT, CacheConfigurator<SideChannel>) => ResultT,
|
||||||
): (ArgT, SideChannel) => ResultT {
|
): (ArgT, SideChannel) => ResultT {
|
||||||
|
// $FlowIssue https://github.com/facebook/flow/issues/4528
|
||||||
return makeCachedFunction(new WeakMap(), handler);
|
return makeCachedFunction(new WeakMap(), handler);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,6 +55,7 @@ function makeCachedFunction<
|
|||||||
ArgT,
|
ArgT,
|
||||||
ResultT,
|
ResultT,
|
||||||
SideChannel,
|
SideChannel,
|
||||||
|
// $FlowIssue https://github.com/facebook/flow/issues/4528
|
||||||
Cache: CacheMap<ArgT, ResultT, SideChannel>,
|
Cache: CacheMap<ArgT, ResultT, SideChannel>,
|
||||||
>(
|
>(
|
||||||
callCache: Cache,
|
callCache: Cache,
|
||||||
|
|||||||
@ -350,7 +350,7 @@ function validateNested(loc: NestingPath, opts: {}) {
|
|||||||
NONPRESET_VALIDATORS[key] ||
|
NONPRESET_VALIDATORS[key] ||
|
||||||
BABELRC_VALIDATORS[key] ||
|
BABELRC_VALIDATORS[key] ||
|
||||||
ROOT_VALIDATORS[key] ||
|
ROOT_VALIDATORS[key] ||
|
||||||
throwUnknownError;
|
(throwUnknownError: Validator<void>);
|
||||||
|
|
||||||
validator(optLoc, opts[key]);
|
validator(optLoc, opts[key]);
|
||||||
});
|
});
|
||||||
|
|||||||
@ -1759,7 +1759,7 @@ export default class ExpressionParser extends LValParser {
|
|||||||
parseArrowExpression(
|
parseArrowExpression(
|
||||||
node: N.ArrowFunctionExpression,
|
node: N.ArrowFunctionExpression,
|
||||||
params?: ?(N.Expression[]),
|
params?: ?(N.Expression[]),
|
||||||
isAsync?: boolean,
|
isAsync?: boolean = false,
|
||||||
): N.ArrowFunctionExpression {
|
): N.ArrowFunctionExpression {
|
||||||
// if we got there, it's no more "yield in possible arrow parameters";
|
// if we got there, it's no more "yield in possible arrow parameters";
|
||||||
// it's just "yield in arrow parameters"
|
// it's just "yield in arrow parameters"
|
||||||
|
|||||||
@ -896,9 +896,9 @@ export default class StatementParser extends ExpressionParser {
|
|||||||
parseFunction<T: N.NormalFunction>(
|
parseFunction<T: N.NormalFunction>(
|
||||||
node: T,
|
node: T,
|
||||||
isStatement: boolean,
|
isStatement: boolean,
|
||||||
allowExpressionBody?: boolean,
|
allowExpressionBody?: boolean = false,
|
||||||
isAsync?: boolean,
|
isAsync?: boolean = false,
|
||||||
optionalId?: boolean,
|
optionalId?: boolean = false,
|
||||||
): T {
|
): T {
|
||||||
const oldInFunc = this.state.inFunction;
|
const oldInFunc = this.state.inFunction;
|
||||||
const oldInMethod = this.state.inMethod;
|
const oldInMethod = this.state.inMethod;
|
||||||
|
|||||||
@ -300,7 +300,7 @@ export default (superClass: Class<Parser>): Class<Parser> =>
|
|||||||
|
|
||||||
if (node) {
|
if (node) {
|
||||||
node.type = "Property";
|
node.type = "Property";
|
||||||
if (node.kind === "method") node.kind = "init";
|
if (((node: any): N.ClassMethod).kind === "method") node.kind = "init";
|
||||||
node.shorthand = false;
|
node.shorthand = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1842,7 +1842,9 @@ export default (superClass: Class<Parser>): Class<Parser> =>
|
|||||||
super.assertModuleNodeAllowed(node);
|
super.assertModuleNodeAllowed(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
parseExport(node: N.ExportNamedDeclaration): N.ExportNamedDeclaration {
|
parseExport(
|
||||||
|
node: N.ExportNamedDeclaration | N.ExportAllDeclaration,
|
||||||
|
): N.ExportNamedDeclaration | N.ExportAllDeclaration {
|
||||||
node = super.parseExport(node);
|
node = super.parseExport(node);
|
||||||
if (
|
if (
|
||||||
node.type === "ExportNamedDeclaration" ||
|
node.type === "ExportNamedDeclaration" ||
|
||||||
|
|||||||
@ -140,7 +140,10 @@ export default class State {
|
|||||||
// The first yield or await expression inside parenthesized expressions
|
// The first yield or await expression inside parenthesized expressions
|
||||||
// and arrow function parameters. It is used to disallow yield and await in
|
// and arrow function parameters. It is used to disallow yield and await in
|
||||||
// arrow function parameters.
|
// arrow function parameters.
|
||||||
yieldOrAwaitInPossibleArrowParameters: ?N.YieldExpression;
|
yieldOrAwaitInPossibleArrowParameters:
|
||||||
|
| N.YieldExpression
|
||||||
|
| N.AwaitExpression
|
||||||
|
| null;
|
||||||
|
|
||||||
// Token store.
|
// Token store.
|
||||||
tokens: Array<Token | N.Comment>;
|
tokens: Array<Token | N.Comment>;
|
||||||
|
|||||||
@ -3,11 +3,11 @@
|
|||||||
import * as formatters from "./formatters";
|
import * as formatters from "./formatters";
|
||||||
import createTemplateBuilder from "./builder";
|
import createTemplateBuilder from "./builder";
|
||||||
|
|
||||||
export const smart = createTemplateBuilder(formatters.smart);
|
export const smart = createTemplateBuilder<*>(formatters.smart);
|
||||||
export const statement = createTemplateBuilder(formatters.statement);
|
export const statement = createTemplateBuilder<*>(formatters.statement);
|
||||||
export const statements = createTemplateBuilder(formatters.statements);
|
export const statements = createTemplateBuilder<*>(formatters.statements);
|
||||||
export const expression = createTemplateBuilder(formatters.expression);
|
export const expression = createTemplateBuilder<*>(formatters.expression);
|
||||||
export const program = createTemplateBuilder(formatters.program);
|
export const program = createTemplateBuilder<*>(formatters.program);
|
||||||
|
|
||||||
type DefaultTemplateBuilder = typeof smart & {
|
type DefaultTemplateBuilder = typeof smart & {
|
||||||
smart: typeof smart,
|
smart: typeof smart,
|
||||||
|
|||||||
@ -4028,10 +4028,10 @@ flat-cache@^1.2.1:
|
|||||||
graceful-fs "^4.1.2"
|
graceful-fs "^4.1.2"
|
||||||
write "^0.2.1"
|
write "^0.2.1"
|
||||||
|
|
||||||
flow-bin@^0.82.0:
|
flow-bin@^0.87.0:
|
||||||
version "0.82.0"
|
version "0.87.0"
|
||||||
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.82.0.tgz#fbec84c0d6cab7877565eca8214d655f3aefb8db"
|
resolved "https://registry.yarnpkg.com/flow-bin/-/flow-bin-0.87.0.tgz#fab7f984d8cc767e93fa9eb01cf7d57ed744f19d"
|
||||||
integrity sha512-D7ViTCVJSVv19CB6dFWS9k2iKQlavtkRXn9el0ofVTTpGuybe+EPE8DZwdyohzEt6wRhHV8gwkteWvxdcVuOzg==
|
integrity sha512-mnvBXXZkUp4y6A96bR5BHa3q1ioIIN2L10w5osxJqagAakTXFYZwjl0t9cT3y2aCEf1wnK6n91xgYypQS/Dqbw==
|
||||||
|
|
||||||
flush-write-stream@^1.0.2:
|
flush-write-stream@^1.0.2:
|
||||||
version "1.0.3"
|
version "1.0.3"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user