Migrate Babel from Flow to TypeScript (except Babel parser) (#11578)
Co-authored-by: Nicolò Ribaudo <nicolo.ribaudo@gmail.com>
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import { declare } from "@babel/helper-plugin-utils";
|
||||
import syntaxNumericSeparator from "@babel/plugin-syntax-numeric-separator";
|
||||
import type { NodePath } from "@babel/traverse";
|
||||
import type * as t from "@babel/types";
|
||||
|
||||
/**
|
||||
* Given a bigIntLiteral or NumericLiteral, remove numeric
|
||||
@@ -7,9 +9,11 @@ import syntaxNumericSeparator from "@babel/plugin-syntax-numeric-separator";
|
||||
*
|
||||
* @param {NodePath<BigIntLiteral | NumericLiteral>} { node }: A Babel AST node path
|
||||
*/
|
||||
function remover({ node }: NodePath<BigIntLiteral | NumericLiteral>) {
|
||||
function remover({ node }: NodePath<t.BigIntLiteral | t.NumericLiteral>) {
|
||||
const { extra } = node;
|
||||
// @ts-expect-error todo(flow->ts)
|
||||
if (extra?.raw?.includes("_")) {
|
||||
// @ts-expect-error todo(flow->ts)
|
||||
extra.raw = extra.raw.replace(/_/g, "");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user