Skip to content

Commit

Permalink
TypeScript error
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Jan 10, 2025
1 parent 92cbaf5 commit 2b100f9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/babel-generator/src/generators/deprecated.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import type Printer from "../printer";
import type * as t from "@babel/types";

export type DeprecatedBabel7ASTTypes = "Noop" | "TSExpressionWithTypeArguments";
export type DeprecatedBabel7ASTTypes =
| "Noop"
| "TSExpressionWithTypeArguments"
| "DecimalLiteral";

export function addDeprecatedGenerators(PrinterClass: typeof Printer) {
// Add Babel 7 generator methods that is removed in Babel 8
Expand All @@ -26,7 +29,10 @@ export function addDeprecatedGenerators(PrinterClass: typeof Printer) {
}
this.word(node.value + "m");
},
};
} satisfies Record<
DeprecatedBabel7ASTTypes,
(this: Printer, node: any) => void
>;
Object.assign(PrinterClass.prototype, deprecatedBabel7Generators);
}
}

0 comments on commit 2b100f9

Please sign in to comment.