From 739784cf675abd7ac0da60e747156c84fa534771 Mon Sep 17 00:00:00 2001 From: liuxingbaoyu <30521560+liuxingbaoyu@users.noreply.github.com> Date: Sun, 30 Oct 2022 00:52:50 +0800 Subject: [PATCH 1/6] fix --- packages/babel-parser/typings/babel-parser.d.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/babel-parser/typings/babel-parser.d.ts b/packages/babel-parser/typings/babel-parser.d.ts index 03a00fc61016..ca83113e78e1 100644 --- a/packages/babel-parser/typings/babel-parser.d.ts +++ b/packages/babel-parser/typings/babel-parser.d.ts @@ -141,6 +141,7 @@ export type ParserPlugin = | "doExpressions" | "dynamicImport" | "estree" + | "explicitResourceManagement" | "exportDefaultFrom" | "exportNamespaceFrom" // deprecated | "flow" @@ -151,6 +152,7 @@ export type ParserPlugin = | "jsx" | "logicalAssignment" | "importAssertions" + | "importReflection" | "moduleBlocks" | "moduleStringNames" | "nullishCoalescingOperator" From 1b531ef8277f991b502ea8c967902b109328b7ec Mon Sep 17 00:00:00 2001 From: liuxingbaoyu <30521560+liuxingbaoyu@users.noreply.github.com> Date: Sun, 30 Oct 2022 01:38:03 +0800 Subject: [PATCH 2/6] improve --- Gulpfile.mjs | 46 +++-- package.json | 2 +- .../babel-parser/typings/babel-parser.d.ts | 173 ++++++++++-------- .../typings/babel-parser.source.d.ts | 153 ++++++++++++++++ yarn.lock | 24 +-- 5 files changed, 284 insertions(+), 114 deletions(-) create mode 100644 packages/babel-parser/typings/babel-parser.source.d.ts diff --git a/Gulpfile.mjs b/Gulpfile.mjs index 2abc07253411..048425ec57af 100644 --- a/Gulpfile.mjs +++ b/Gulpfile.mjs @@ -527,29 +527,35 @@ function buildRollup(packages, buildStandalone) { } function buildRollupDts(packages) { - const sourcemap = process.env.NODE_ENV === "production"; - return Promise.all( - packages.map(async packageName => { - const input = `${mapToDts(packageName)}/src/index.d.ts`; - const output = `${packageName}/lib/index.d.ts`; - log(`Bundling '${chalk.cyan(output)}' with rollup ...`); + async function build(input, output) { + log(`Bundling '${chalk.cyan(output)}' with rollup ...`); - const bundle = await rollup({ - input, - plugins: [rollupDts()], - onwarn(warning, warn) { - if (warning.code !== "CIRCULAR_DEPENDENCY") warn(warning); - }, - }); + const bundle = await rollup({ + input, + plugins: [rollupDts()], + }); - await bundle.write({ - file: output, - format: "es", - sourcemap: sourcemap, - exports: "named", - }); - }) + await bundle.write({ + file: output, + format: "es", + }); + } + + const tasks = packages.map(async packageName => { + const input = `${mapToDts(packageName)}/src/index.d.ts`; + const output = `${packageName}/lib/index.d.ts`; + + await build(input, output); + }); + + tasks.push( + build( + "packages/babel-parser/typings/babel-parser.source.d.ts", + "packages/babel-parser/typings/babel-parser.d.ts" + ) ); + + return Promise.all(tasks); } function copyDts(packages) { diff --git a/package.json b/package.json index fb1ebf702ec2..ca990c351970 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "mergeiterator": "^1.4.4", "prettier": "^2.7.1", "rollup": "^2.78.0", - "rollup-plugin-dts": "^4.2.2", + "rollup-plugin-dts": "^5.0.0", "rollup-plugin-polyfill-node": "^0.10.2", "rollup-plugin-terser": "^7.0.2", "semver": "^6.3.0", diff --git a/packages/babel-parser/typings/babel-parser.d.ts b/packages/babel-parser/typings/babel-parser.d.ts index ca83113e78e1..db1c6d9501ff 100644 --- a/packages/babel-parser/typings/babel-parser.d.ts +++ b/packages/babel-parser/typings/babel-parser.d.ts @@ -1,3 +1,83 @@ +import * as _babel_types from '@babel/types'; + +type Plugin = + | "asyncDoExpressions" + | "asyncGenerators" + | "bigInt" + | "classPrivateMethods" + | "classPrivateProperties" + | "classProperties" + | "classStaticBlock" // Enabled by default + | "decimal" + | "decorators-legacy" + | "decoratorAutoAccessors" + | "destructuringPrivate" + | "doExpressions" + | "dynamicImport" + | "explicitResourceManagement" + | "exportDefaultFrom" + | "exportNamespaceFrom" // deprecated + | "flow" + | "flowComments" + | "functionBind" + | "functionSent" + | "importMeta" + | "jsx" + | "logicalAssignment" + | "importAssertions" + | "importReflection" + | "moduleBlocks" + | "moduleStringNames" + | "nullishCoalescingOperator" + | "numericSeparator" + | "objectRestSpread" + | "optionalCatchBinding" + | "optionalChaining" + | "partialApplication" + | "placeholders" + | "privateIn" // Enabled by default + | "regexpUnicodeSets" + | "throwExpressions" + | "topLevelAwait" + | "v8intrinsic" + | ParserPluginWithOptions$1[0]; + +type ParserPluginWithOptions$1 = + | ["decorators", DecoratorsPluginOptions] + | ["estree", { classFeatures?: boolean }] + // @deprecated + | ["moduleAttributes", { version: "may-2020" }] + | ["pipelineOperator", PipelineOperatorPluginOptions] + | ["recordAndTuple", RecordAndTuplePluginOptions] + | ["flow", FlowPluginOptions] + | ["typescript", TypeScriptPluginOptions]; + +type PluginConfig = Plugin | ParserPluginWithOptions$1; + +interface DecoratorsPluginOptions { + decoratorsBeforeExport?: boolean; + allowCallParenthesized?: boolean; +} + +interface PipelineOperatorPluginOptions { + proposal: "minimal" | "fsharp" | "hack" | "smart"; + topicToken?: "%" | "#" | "@@" | "^^" | "^"; +} + +interface RecordAndTuplePluginOptions { + syntaxType: "bar" | "hash"; +} + +interface FlowPluginOptions { + all?: boolean; + enums?: boolean; +} + +interface TypeScriptPluginOptions { + dts?: boolean; + disallowAmbiguousJSXLike?: boolean; +} + // Type definitions for @babel/parser // Project: https://github.com/babel/babel/tree/main/packages/babel-parser // Definitions by: Troy Gerwien @@ -8,20 +88,20 @@ /** * Parse the provided code as an entire ECMAScript program. */ -export function parse( +declare function parse( input: string, options?: ParserOptions -): ParseResult; +): ParseResult<_babel_types.File>; /** * Parse the provided code as a single expression. */ -export function parseExpression( +declare function parseExpression( input: string, options?: ParserOptions -): ParseResult; +): ParseResult<_babel_types.Expression>; -export interface ParserOptions { +interface ParserOptions { /** * By default, import and export declarations can only appear at a program's top level. * Setting this option to true allows them anywhere where a statement is allowed. @@ -125,89 +205,18 @@ export interface ParserOptions { createParenthesizedExpressions?: boolean; } -export type ParserPlugin = - | "asyncDoExpressions" - | "asyncGenerators" - | "bigInt" - | "classPrivateMethods" - | "classPrivateProperties" - | "classProperties" - | "classStaticBlock" // Enabled by default - | "decimal" - | "decorators" - | "decorators-legacy" - | "decoratorAutoAccessors" - | "destructuringPrivate" - | "doExpressions" - | "dynamicImport" - | "estree" - | "explicitResourceManagement" - | "exportDefaultFrom" - | "exportNamespaceFrom" // deprecated - | "flow" - | "flowComments" - | "functionBind" - | "functionSent" - | "importMeta" - | "jsx" - | "logicalAssignment" - | "importAssertions" - | "importReflection" - | "moduleBlocks" - | "moduleStringNames" - | "nullishCoalescingOperator" - | "numericSeparator" - | "objectRestSpread" - | "optionalCatchBinding" - | "optionalChaining" - | "partialApplication" - | "pipelineOperator" - | "placeholders" - | "privateIn" // Enabled by default - | "recordAndTuple" - | "regexpUnicodeSets" - | "throwExpressions" - | "topLevelAwait" - | "typescript" - | "v8intrinsic" - | ParserPluginWithOptions; +type ParserPluginWithOptions = + ParserPluginWithOptions$1; -export type ParserPluginWithOptions = - | ["decorators", DecoratorsPluginOptions] - | ["pipelineOperator", PipelineOperatorPluginOptions] - | ["recordAndTuple", RecordAndTuplePluginOptions] - | ["flow", FlowPluginOptions] - | ["typescript", TypeScriptPluginOptions]; +type ParserPlugin = PluginConfig; -export interface DecoratorsPluginOptions { - decoratorsBeforeExport?: boolean; -} -export interface PipelineOperatorPluginOptions { - proposal: "minimal" | "fsharp" | "hack" | "smart"; - topicToken?: "%" | "#" | "@@" | "^^" | "^"; -} - -export interface RecordAndTuplePluginOptions { - syntaxType?: "bar" | "hash"; -} - -export interface FlowPluginOptions { - all?: boolean; - enums?: boolean; -} - -export interface TypeScriptPluginOptions { - dts?: boolean; - disallowAmbiguousJSXLike?: boolean; -} - -export const tokTypes: { +declare const tokTypes: { // todo(flow->ts) real token type [name: string]: any; }; -export interface ParseError { +interface ParseError { code: string; reasonCode: string; } @@ -215,3 +224,5 @@ export interface ParseError { type ParseResult = Result & { errors: ParseError[]; }; + +export { DecoratorsPluginOptions, FlowPluginOptions, ParseError, ParserOptions, ParserPlugin, ParserPluginWithOptions, PipelineOperatorPluginOptions, RecordAndTuplePluginOptions, TypeScriptPluginOptions, parse, parseExpression, tokTypes }; diff --git a/packages/babel-parser/typings/babel-parser.source.d.ts b/packages/babel-parser/typings/babel-parser.source.d.ts new file mode 100644 index 000000000000..fad98b6bd42c --- /dev/null +++ b/packages/babel-parser/typings/babel-parser.source.d.ts @@ -0,0 +1,153 @@ +// Type definitions for @babel/parser +// Project: https://github.com/babel/babel/tree/main/packages/babel-parser +// Definitions by: Troy Gerwien +// Marvin Hagemeister +// Avi Vahl +// TypeScript Version: 2.9 + +/** + * Parse the provided code as an entire ECMAScript program. + */ +export function parse( + input: string, + options?: ParserOptions +): ParseResult; + +/** + * Parse the provided code as a single expression. + */ +export function parseExpression( + input: string, + options?: ParserOptions +): ParseResult; + +export interface ParserOptions { + /** + * By default, import and export declarations can only appear at a program's top level. + * Setting this option to true allows them anywhere where a statement is allowed. + */ + allowImportExportEverywhere?: boolean; + + /** + * By default, await use is not allowed outside of an async function. + * Set this to true to accept such code. + */ + allowAwaitOutsideFunction?: boolean; + + /** + * By default, a return statement at the top level raises an error. + * Set this to true to accept such code. + */ + allowReturnOutsideFunction?: boolean; + + allowSuperOutsideMethod?: boolean; + + /** + * By default, exported identifiers must refer to a declared variable. + * Set this to true to allow export statements to reference undeclared variables. + */ + allowUndeclaredExports?: boolean; + + /** + * By default, Babel attaches comments to adjacent AST nodes. + * When this option is set to false, comments are not attached. + * It can provide up to 30% performance improvement when the input code has many comments. + * @babel/eslint-parser will set it for you. + * It is not recommended to use attachComment: false with Babel transform, + * as doing so removes all the comments in output code, and renders annotations such as + * /* istanbul ignore next *\/ nonfunctional. + */ + attachComment?: boolean; + + /** + * By default, Babel always throws an error when it finds some invalid code. + * When this option is set to true, it will store the parsing error and + * try to continue parsing the invalid input file. + */ + errorRecovery?: boolean; + + /** + * Indicate the mode the code should be parsed in. + * Can be one of "script", "module", or "unambiguous". Defaults to "script". + * "unambiguous" will make @babel/parser attempt to guess, based on the presence + * of ES6 import or export statements. + * Files with ES6 imports and exports are considered "module" and are otherwise "script". + */ + sourceType?: "script" | "module" | "unambiguous"; + + /** + * Correlate output AST nodes with their source filename. + * Useful when generating code and source maps from the ASTs of multiple input files. + */ + sourceFilename?: string; + + /** + * By default, the first line of code parsed is treated as line 1. + * You can provide a line number to alternatively start with. + * Useful for integration with other source tools. + */ + startLine?: number; + + /** + * By default, the parsed code is treated as if it starts from line 1, column 0. + * You can provide a column number to alternatively start with. + * Useful for integration with other source tools. + */ + startColumn?: number; + + /** + * Array containing the plugins that you want to enable. + */ + plugins?: ParserPlugin[]; + + /** + * Should the parser work in strict mode. + * Defaults to true if sourceType === 'module'. Otherwise, false. + */ + strictMode?: boolean; + + /** + * Adds a ranges property to each node: [node.start, node.end] + */ + ranges?: boolean; + + /** + * Adds all parsed tokens to a tokens property on the File node. + */ + tokens?: boolean; + + /** + * By default, the parser adds information about parentheses by setting + * `extra.parenthesized` to `true` as needed. + * When this option is `true` the parser creates `ParenthesizedExpression` + * AST nodes instead of using the `extra` property. + */ + createParenthesizedExpressions?: boolean; +} + +export type ParserPluginWithOptions = + import("../src/typings").ParserPluginWithOptions; + +export type ParserPlugin = import("../src/typings").PluginConfig; + +export type { + DecoratorsPluginOptions, + PipelineOperatorPluginOptions, + RecordAndTuplePluginOptions, + FlowPluginOptions, + TypeScriptPluginOptions, +} from "../src/typings"; + +export const tokTypes: { + // todo(flow->ts) real token type + [name: string]: any; +}; + +export interface ParseError { + code: string; + reasonCode: string; +} + +type ParseResult = Result & { + errors: ParseError[]; +}; diff --git a/yarn.lock b/yarn.lock index 3bcd979bbf3a..e39c093fc9ba 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5964,7 +5964,7 @@ __metadata: mergeiterator: ^1.4.4 prettier: ^2.7.1 rollup: ^2.78.0 - rollup-plugin-dts: ^4.2.2 + rollup-plugin-dts: ^5.0.0 rollup-plugin-polyfill-node: ^0.10.2 rollup-plugin-terser: ^7.0.2 semver: ^6.3.0 @@ -11172,12 +11172,12 @@ fsevents@^1.2.7: languageName: node linkType: hard -"magic-string@npm:^0.26.1": - version: 0.26.1 - resolution: "magic-string@npm:0.26.1" +"magic-string@npm:^0.26.7": + version: 0.26.7 + resolution: "magic-string@npm:0.26.7" dependencies: sourcemap-codec: ^1.4.8 - checksum: 23f21f5734346ddfbabd7b9834e3ecda3521e3e1db81166c1513b45b729489bbed1eafa8cd052c7db7fdc7c68ebc5c03bc00dd5a23697edda15dbecaf8c98397 + checksum: 89b0d60cbb32bbf3d1e23c46ea93db082d18a8230b972027aecb10a40bba51be519ecce0674f995571e3affe917b76b09f59d8dbc9a1b2c9c4102a2b6e8a2b01 languageName: node linkType: hard @@ -13231,19 +13231,19 @@ fsevents@^1.2.7: languageName: node linkType: hard -"rollup-plugin-dts@npm:^4.2.2": - version: 4.2.2 - resolution: "rollup-plugin-dts@npm:4.2.2" +"rollup-plugin-dts@npm:^5.0.0": + version: 5.0.0 + resolution: "rollup-plugin-dts@npm:5.0.0" dependencies: - "@babel/code-frame": ^7.16.7 - magic-string: ^0.26.1 + "@babel/code-frame": ^7.18.6 + magic-string: ^0.26.7 peerDependencies: - rollup: ^2.55 + rollup: ^3.0.0 typescript: ^4.1 dependenciesMeta: "@babel/code-frame": optional: true - checksum: cf4b45f6cca442a5f44af0f0fb567c8fc540ecb792c763571d1bcda9bf495803bcc8d4eaef451a2dd32f7f391eb822e2b96cc6b86b096db54a4d3935236fd8da + checksum: feb2d614528c255ee698120be0fd404b0a4fa312362a3d687d76551157464decc66be6dfecb624c42bc64a9e6298ed21e13e689dc9b144acab8294cd08a53455 languageName: node linkType: hard From c5a692dde8ab93e9c6ccab3df87aaa18a14a85be Mon Sep 17 00:00:00 2001 From: liuxingbaoyu <30521560+liuxingbaoyu@users.noreply.github.com> Date: Sun, 30 Oct 2022 20:44:08 +0800 Subject: [PATCH 3/6] disable eslint --- Gulpfile.mjs | 6 ++++-- packages/babel-parser/typings/babel-parser.d.ts | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Gulpfile.mjs b/Gulpfile.mjs index 048425ec57af..9f8306084a9c 100644 --- a/Gulpfile.mjs +++ b/Gulpfile.mjs @@ -527,7 +527,7 @@ function buildRollup(packages, buildStandalone) { } function buildRollupDts(packages) { - async function build(input, output) { + async function build(input, output, banner) { log(`Bundling '${chalk.cyan(output)}' with rollup ...`); const bundle = await rollup({ @@ -538,6 +538,7 @@ function buildRollupDts(packages) { await bundle.write({ file: output, format: "es", + banner, }); } @@ -551,7 +552,8 @@ function buildRollupDts(packages) { tasks.push( build( "packages/babel-parser/typings/babel-parser.source.d.ts", - "packages/babel-parser/typings/babel-parser.d.ts" + "packages/babel-parser/typings/babel-parser.d.ts", + "/* eslint-disable import/no-extraneous-dependencies, @typescript-eslint/consistent-type-imports, prettier/prettier */" ) ); diff --git a/packages/babel-parser/typings/babel-parser.d.ts b/packages/babel-parser/typings/babel-parser.d.ts index db1c6d9501ff..9f4cbcca9c6f 100644 --- a/packages/babel-parser/typings/babel-parser.d.ts +++ b/packages/babel-parser/typings/babel-parser.d.ts @@ -1,3 +1,4 @@ +/* eslint-disable import/no-extraneous-dependencies, @typescript-eslint/consistent-type-imports, prettier/prettier */ import * as _babel_types from '@babel/types'; type Plugin = From d683787c3ee4a2228672479a2b3951264704335c Mon Sep 17 00:00:00 2001 From: liuxingbaoyu <30521560+liuxingbaoyu@users.noreply.github.com> Date: Sun, 30 Oct 2022 20:55:09 +0800 Subject: [PATCH 4/6] improve --- packages/babel-parser/typings/babel-parser.d.ts | 13 ++++--------- .../babel-parser/typings/babel-parser.source.d.ts | 7 ++----- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/packages/babel-parser/typings/babel-parser.d.ts b/packages/babel-parser/typings/babel-parser.d.ts index 9f4cbcca9c6f..aedf2c5714bb 100644 --- a/packages/babel-parser/typings/babel-parser.d.ts +++ b/packages/babel-parser/typings/babel-parser.d.ts @@ -41,9 +41,9 @@ type Plugin = | "throwExpressions" | "topLevelAwait" | "v8intrinsic" - | ParserPluginWithOptions$1[0]; + | ParserPluginWithOptions[0]; -type ParserPluginWithOptions$1 = +type ParserPluginWithOptions = | ["decorators", DecoratorsPluginOptions] | ["estree", { classFeatures?: boolean }] // @deprecated @@ -53,7 +53,7 @@ type ParserPluginWithOptions$1 = | ["flow", FlowPluginOptions] | ["typescript", TypeScriptPluginOptions]; -type PluginConfig = Plugin | ParserPluginWithOptions$1; +type PluginConfig = Plugin | ParserPluginWithOptions; interface DecoratorsPluginOptions { decoratorsBeforeExport?: boolean; @@ -206,11 +206,6 @@ interface ParserOptions { createParenthesizedExpressions?: boolean; } -type ParserPluginWithOptions = - ParserPluginWithOptions$1; - -type ParserPlugin = PluginConfig; - declare const tokTypes: { // todo(flow->ts) real token type @@ -226,4 +221,4 @@ type ParseResult = Result & { errors: ParseError[]; }; -export { DecoratorsPluginOptions, FlowPluginOptions, ParseError, ParserOptions, ParserPlugin, ParserPluginWithOptions, PipelineOperatorPluginOptions, RecordAndTuplePluginOptions, TypeScriptPluginOptions, parse, parseExpression, tokTypes }; +export { DecoratorsPluginOptions, FlowPluginOptions, ParseError, ParserOptions, PluginConfig as ParserPlugin, ParserPluginWithOptions, PipelineOperatorPluginOptions, RecordAndTuplePluginOptions, TypeScriptPluginOptions, parse, parseExpression, tokTypes }; diff --git a/packages/babel-parser/typings/babel-parser.source.d.ts b/packages/babel-parser/typings/babel-parser.source.d.ts index fad98b6bd42c..025d77661306 100644 --- a/packages/babel-parser/typings/babel-parser.source.d.ts +++ b/packages/babel-parser/typings/babel-parser.source.d.ts @@ -125,12 +125,9 @@ export interface ParserOptions { createParenthesizedExpressions?: boolean; } -export type ParserPluginWithOptions = - import("../src/typings").ParserPluginWithOptions; - -export type ParserPlugin = import("../src/typings").PluginConfig; - export type { + PluginConfig as ParserPlugin, + ParserPluginWithOptions, DecoratorsPluginOptions, PipelineOperatorPluginOptions, RecordAndTuplePluginOptions, From 566d3808d26334cbc384784efd0c1ddff1845b1c Mon Sep 17 00:00:00 2001 From: liuxingbaoyu <30521560+liuxingbaoyu@users.noreply.github.com> Date: Mon, 31 Oct 2022 20:37:59 +0800 Subject: [PATCH 5/6] fix --- packages/babel-parser/typings/babel-parser.d.ts | 4 +++- packages/babel-parser/typings/babel-parser.source.d.ts | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/babel-parser/typings/babel-parser.d.ts b/packages/babel-parser/typings/babel-parser.d.ts index aedf2c5714bb..4281f0caf536 100644 --- a/packages/babel-parser/typings/babel-parser.d.ts +++ b/packages/babel-parser/typings/babel-parser.d.ts @@ -206,6 +206,8 @@ interface ParserOptions { createParenthesizedExpressions?: boolean; } +type ParserPlugin = PluginConfig; + declare const tokTypes: { // todo(flow->ts) real token type @@ -221,4 +223,4 @@ type ParseResult = Result & { errors: ParseError[]; }; -export { DecoratorsPluginOptions, FlowPluginOptions, ParseError, ParserOptions, PluginConfig as ParserPlugin, ParserPluginWithOptions, PipelineOperatorPluginOptions, RecordAndTuplePluginOptions, TypeScriptPluginOptions, parse, parseExpression, tokTypes }; +export { DecoratorsPluginOptions, FlowPluginOptions, ParseError, ParserOptions, ParserPlugin, ParserPluginWithOptions, PipelineOperatorPluginOptions, RecordAndTuplePluginOptions, TypeScriptPluginOptions, parse, parseExpression, tokTypes }; diff --git a/packages/babel-parser/typings/babel-parser.source.d.ts b/packages/babel-parser/typings/babel-parser.source.d.ts index 025d77661306..0bcbefe602ab 100644 --- a/packages/babel-parser/typings/babel-parser.source.d.ts +++ b/packages/babel-parser/typings/babel-parser.source.d.ts @@ -125,8 +125,9 @@ export interface ParserOptions { createParenthesizedExpressions?: boolean; } +export type ParserPlugin = import("../src/typings").PluginConfig; + export type { - PluginConfig as ParserPlugin, ParserPluginWithOptions, DecoratorsPluginOptions, PipelineOperatorPluginOptions, From 5f1496dcc088a30b082ac86f3fe6d7c636dad633 Mon Sep 17 00:00:00 2001 From: liuxingbaoyu <30521560+liuxingbaoyu@users.noreply.github.com> Date: Wed, 2 Nov 2022 23:31:10 +0800 Subject: [PATCH 6/6] review --- Gulpfile.mjs | 2 +- packages/babel-parser/typings/babel-parser.d.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Gulpfile.mjs b/Gulpfile.mjs index 9f8306084a9c..b46f664da6e1 100644 --- a/Gulpfile.mjs +++ b/Gulpfile.mjs @@ -553,7 +553,7 @@ function buildRollupDts(packages) { build( "packages/babel-parser/typings/babel-parser.source.d.ts", "packages/babel-parser/typings/babel-parser.d.ts", - "/* eslint-disable import/no-extraneous-dependencies, @typescript-eslint/consistent-type-imports, prettier/prettier */" + "// This file is auto-generated! Do not modify it directly.\n/* eslint-disable import/no-extraneous-dependencies, @typescript-eslint/consistent-type-imports, prettier/prettier */" ) ); diff --git a/packages/babel-parser/typings/babel-parser.d.ts b/packages/babel-parser/typings/babel-parser.d.ts index 4281f0caf536..b806352dbb35 100644 --- a/packages/babel-parser/typings/babel-parser.d.ts +++ b/packages/babel-parser/typings/babel-parser.d.ts @@ -1,3 +1,4 @@ +// This file is auto-generated! Do not modify it directly. /* eslint-disable import/no-extraneous-dependencies, @typescript-eslint/consistent-type-imports, prettier/prettier */ import * as _babel_types from '@babel/types';