Internally use named export in babel parser (#17482)
This commit is contained in:
1 parent
78a0903b37
commit
d932cf70df
3 files changed
+26
-28
No files matched your search
@@ -237,21 +237,21 @@ const babelEstree = createBabelParser({
|
||||
),
|
||||
});
|
||||
|
||||
export default {
|
||||
babel,
|
||||
"babel-flow": babelFlow,
|
||||
"babel-ts": babelTs,
|
||||
/** @internal */
|
||||
__js_expression: babelExpression,
|
||||
__ts_expression: babelTSExpression,
|
||||
export { babel, babelFlow as "babel-flow", babelTs as "babel-ts" };
|
||||
|
||||
/** @internal */
|
||||
// eslint-disable-next-line simple-import-sort/exports
|
||||
export {
|
||||
babelExpression as __js_expression,
|
||||
babelTSExpression as __ts_expression,
|
||||
/** for vue filter */
|
||||
__vue_expression: babelExpression,
|
||||
babelExpression as __vue_expression,
|
||||
/** for vue filter written in TS */
|
||||
__vue_ts_expression: babelTSExpression,
|
||||
babelTSExpression as __vue_ts_expression,
|
||||
/** for vue event binding to handle semicolon */
|
||||
__vue_event_binding: babel,
|
||||
babel as __vue_event_binding,
|
||||
/** for vue event binding written in TS to handle semicolon */
|
||||
__vue_ts_event_binding: babelTs,
|
||||
babelTs as __vue_ts_event_binding,
|
||||
/** verify that we can print this AST */
|
||||
__babel_estree: babelEstree,
|
||||
babelEstree as __babel_estree,
|
||||
};
|
||||
@@ -172,18 +172,16 @@ function assertJsonNode(node) {
|
||||
}
|
||||
}
|
||||
|
||||
const jsonParsers = {
|
||||
json: createParser({
|
||||
parse: (text) => parseJson(text),
|
||||
hasPragma: () => true,
|
||||
hasIgnorePragma: () => false,
|
||||
}),
|
||||
json5: createParser((text) => parseJson(text)),
|
||||
jsonc: createParser((text) => parseJson(text, { allowEmpty: true })),
|
||||
"json-stringify": createParser({
|
||||
parse: (text) => parseJson(text, { allowComments: false }),
|
||||
astFormat: "estree-json",
|
||||
}),
|
||||
};
|
||||
const json = createParser({
|
||||
parse: (text) => parseJson(text),
|
||||
hasPragma: () => true,
|
||||
hasIgnorePragma: () => false,
|
||||
});
|
||||
const json5 = createParser((text) => parseJson(text));
|
||||
const jsonc = createParser((text) => parseJson(text, { allowEmpty: true }));
|
||||
const jsonStringify = createParser({
|
||||
parse: (text) => parseJson(text, { allowComments: false }),
|
||||
astFormat: "estree-json",
|
||||
});
|
||||
|
||||
export default jsonParsers;
|
||||
export { json, json5, jsonc, jsonStringify as "json-stringify" };
|
||||
@@ -1,5 +1,5 @@
|
||||
import babelParsers from "../language-js/parse/babel.js";
|
||||
import * as babelParsers from "../language-js/parse/babel.js";
|
||||
// JSON parsers are based on babel, bundle together to reduce package size
|
||||
import jsonParsers from "../language-json/parser-json.js";
|
||||
import * as jsonParsers from "../language-json/parser-json.js";
|
||||
|
||||
export const parsers = { ...babelParsers, ...jsonParsers };
|
||||
Reference in new issue
Block a user