Skip to content

Commit

Permalink
Export File from @babel/parser to use in @babel/core
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Apr 7, 2024
1 parent 774475b commit e64c2ce
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/babel-core/src/parser/index.ts
@@ -1,10 +1,10 @@
import type { Handler } from "gensync";
import { parse } from "@babel/parser";
import { parse, type File as ParseResult } from "@babel/parser";
import { codeFrameColumns } from "@babel/code-frame";
import generateMissingPluginMessage from "./util/missing-plugin-helper.ts";
import type { PluginPasses } from "../config/index.ts";

export type ParseResult = ReturnType<typeof parse>;
export type { ParseResult };

export default function* parser(
pluginPasses: PluginPasses,
Expand Down
1 change: 1 addition & 0 deletions packages/babel-parser/src/index.ts
Expand Up @@ -22,6 +22,7 @@ import {
} from "./tokenizer/types.ts";

import type { Expression, File } from "./types.ts";
export type { File };

export function parse(input: string, options?: Options): File {
if (options?.sourceType === "unambiguous") {
Expand Down

0 comments on commit e64c2ce

Please sign in to comment.