Skip to content

Commit

Permalink
chore: enable flowcheck on CI (#11945)
Browse files Browse the repository at this point in the history
* chore: enable flowcheck on CI

* fix: flow errors
  • Loading branch information
JLHwung committed Aug 10, 2020
1 parent 00b9742 commit a389312
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
3 changes: 1 addition & 2 deletions Makefile
Expand Up @@ -85,8 +85,7 @@ watch: build-no-bundle
BABEL_ENV=development $(YARN) gulp watch

code-quality-ci: build-no-bundle-ci
$(MAKE) flowcheck-ci & $(MAKE) lint-ci

$(MAKE) flowcheck-ci lint-ci

flowcheck-ci:
$(MAKE) flow
Expand Down
4 changes: 2 additions & 2 deletions packages/babel-parser/src/parser/statement.js
Expand Up @@ -639,7 +639,7 @@ export default class StatementParser extends ExpressionParser {
return this.finishNode(node, "ThrowStatement");
}

parseCatchClauseParam(): N.Identifier {
parseCatchClauseParam(): N.Pattern {
const param = this.parseBindingAtom();

const simple = param.type === "Identifier";
Expand Down Expand Up @@ -1199,7 +1199,7 @@ export default class StatementParser extends ExpressionParser {
// https://tc39.es/ecma262/#prod-ClassBody
parseClassBody(
constructorAllowsSuper: boolean,
oldStrict?: boolean,
oldStrict: boolean,
): N.ClassBody {
this.classScope.enter();
Expand Down
1 change: 0 additions & 1 deletion packages/babel-parser/src/plugins/estree.js
Expand Up @@ -45,7 +45,6 @@ export default (superClass: Class<Parser>): Class<Parser> =>

estreeParseDecimalLiteral(value: any): N.Node {
// https://github.com/estree/estree/blob/master/experimental/decimal.md
// $FlowIgnore
// todo: use BigDecimal when node supports it.
const decimal = null;
const node = this.estreeParseLiteral(decimal);
Expand Down
3 changes: 2 additions & 1 deletion packages/babel-parser/src/plugins/placeholders.js
Expand Up @@ -203,6 +203,7 @@ export default (superClass: Class<Parser>): Class<Parser> =>

this.next();
this.takeDecorators(node);
const oldStrict = this.state.strict;

const placeholder = this.parsePlaceholder("Identifier");
if (placeholder) {
Expand All @@ -226,7 +227,7 @@ export default (superClass: Class<Parser>): Class<Parser> =>
this.parseClassSuper(node);
node.body =
this.parsePlaceholder("ClassBody") ||
this.parseClassBody(!!node.superClass);
this.parseClassBody(!!node.superClass, oldStrict);
return this.finishNode(node, type);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/babel-parser/src/plugins/typescript/index.js
Expand Up @@ -2727,7 +2727,7 @@ export default (superClass: Class<Parser>): Class<Parser> =>
return hasContextParam ? baseCount + 1 : baseCount;
}

parseCatchClauseParam(): N.Identifier {
parseCatchClauseParam(): N.Pattern {
const param = super.parseCatchClauseParam();
const type = this.tsTryParseTypeAnnotation();

Expand Down

0 comments on commit a389312

Please sign in to comment.