Skip to content

Commit

Permalink
enable TS compiler option: strictBindCallApply (#14685)
Browse files Browse the repository at this point in the history
  • Loading branch information
JLHwung committed Jun 22, 2022
1 parent b1e73d6 commit 3636faa
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
9 changes: 6 additions & 3 deletions packages/babel-generator/src/generators/flow.ts
Expand Up @@ -156,13 +156,16 @@ export function DeclareExportDeclaration(
this.space();
}

FlowExportDeclaration.apply(this, arguments);
FlowExportDeclaration.call(this, node);
}

export function DeclareExportAllDeclaration(this: Printer) {
export function DeclareExportAllDeclaration(
this: Printer,
node: t.DeclareExportAllDeclaration,
) {
this.word("declare");
this.space();
ExportAllDeclaration.apply(this, arguments);
ExportAllDeclaration.call(this, node);
}

export function EnumDeclaration(this: Printer, node: t.EnumDeclaration) {
Expand Down
3 changes: 2 additions & 1 deletion packages/babel-generator/src/generators/modules.ts
Expand Up @@ -68,7 +68,7 @@ export function ExportNamespaceSpecifier(

export function ExportAllDeclaration(
this: Printer,
node: t.ExportAllDeclaration,
node: t.ExportAllDeclaration | t.DeclareExportAllDeclaration,
) {
this.word("export");
this.space();
Expand All @@ -81,6 +81,7 @@ export function ExportAllDeclaration(
this.word("from");
this.space();
this.print(node.source, node);
// @ts-expect-error Fixme: assertions is not defined in DeclareExportAllDeclaration
this.printAssertions(node);
this.semicolon();
}
Expand Down
1 change: 1 addition & 0 deletions packages/babel-types/src/converters/valueToNode.ts
Expand Up @@ -31,6 +31,7 @@ export default valueToNode as {
(value: unknown): t.Expression;
};

// @ts-expect-error: Object.prototype.toString must return a string
const objectToString: (value: unknown) => string = Function.call.bind(
Object.prototype.toString,
);
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.base.json
Expand Up @@ -13,6 +13,7 @@
"skipLibCheck": true,
"resolveJsonModule": true,
"noImplicitThis": true,
"noImplicitAny": true
"noImplicitAny": true,
"strictBindCallApply": true
}
}

0 comments on commit 3636faa

Please sign in to comment.