Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: enable flowcheck on CI #11945

Merged
merged 2 commits into from Aug 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

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