Skip to content

Commit

Permalink
Add skipBuiltinTransformers option. (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
dumganhar authored Dec 26, 2024
1 parent 44df484 commit 60cac4b
Show file tree
Hide file tree
Showing 34 changed files with 105 additions and 3 deletions.
10 changes: 10 additions & 0 deletions lib/tsc.js
Original file line number Diff line number Diff line change
Expand Up @@ -7280,6 +7280,7 @@ var ts;
_0_is_possibly_undefined: diag(18048, ts.DiagnosticCategory.Error, "_0_is_possibly_undefined_18048", "'{0}' is possibly 'undefined'."),
_0_is_possibly_null_or_undefined: diag(18049, ts.DiagnosticCategory.Error, "_0_is_possibly_null_or_undefined_18049", "'{0}' is possibly 'null' or 'undefined'."),
The_value_0_cannot_be_used_here: diag(18050, ts.DiagnosticCategory.Error, "The_value_0_cannot_be_used_here_18050", "The value '{0}' cannot be used here."),
Skip_the_builtin_transformers: diag(18051, ts.DiagnosticCategory.Message, "Skip_the_builtin_transformers_18051", "Skip the builtin transformers."),
};
})(ts || (ts = {}));
var ts;
Expand Down Expand Up @@ -33660,6 +33661,15 @@ var ts;
type: "string",
defaultValueDescription: undefined,
},
{
name: "skipBuiltinTransformers",
type: "boolean",
affectsEmit: true,
affectsMultiFileEmitBuildInfo: true,
category: ts.Diagnostics.Emit,
description: ts.Diagnostics.Skip_the_builtin_transformers,
defaultValueDescription: false,
},
];
ts.optionDeclarations = __spreadArray(__spreadArray([], ts.commonOptionsWithBuild, true), commandOptionsWithoutBuild, true);
ts.semanticDiagnosticsOptionDeclarations = ts.optionDeclarations.filter(function (option) { return !!option.affectsSemanticDiagnostics; });
Expand Down
10 changes: 10 additions & 0 deletions lib/tsserver.js
Original file line number Diff line number Diff line change
Expand Up @@ -10135,6 +10135,7 @@ var ts;
_0_is_possibly_undefined: diag(18048, ts.DiagnosticCategory.Error, "_0_is_possibly_undefined_18048", "'{0}' is possibly 'undefined'."),
_0_is_possibly_null_or_undefined: diag(18049, ts.DiagnosticCategory.Error, "_0_is_possibly_null_or_undefined_18049", "'{0}' is possibly 'null' or 'undefined'."),
The_value_0_cannot_be_used_here: diag(18050, ts.DiagnosticCategory.Error, "The_value_0_cannot_be_used_here_18050", "The value '{0}' cannot be used here."),
Skip_the_builtin_transformers: diag(18051, ts.DiagnosticCategory.Message, "Skip_the_builtin_transformers_18051", "Skip the builtin transformers."),
};
})(ts || (ts = {}));
var ts;
Expand Down Expand Up @@ -41297,6 +41298,15 @@ var ts;
type: "string",
defaultValueDescription: undefined,
},
{
name: "skipBuiltinTransformers",
type: "boolean",
affectsEmit: true,
affectsMultiFileEmitBuildInfo: true,
category: ts.Diagnostics.Emit,
description: ts.Diagnostics.Skip_the_builtin_transformers,
defaultValueDescription: false,
},
];
/* @internal */
ts.optionDeclarations = __spreadArray(__spreadArray([], ts.commonOptionsWithBuild, true), commandOptionsWithoutBuild, true);
Expand Down
1 change: 1 addition & 0 deletions lib/tsserverlibrary.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3088,6 +3088,7 @@ declare namespace ts {
typeRoots?: string[];
esModuleInterop?: boolean;
useDefineForClassFields?: boolean;
skipBuiltinTransformers?: boolean;
[option: string]: CompilerOptionsValue | TsConfigSourceFile | undefined;
}
export interface WatchOptions {
Expand Down
10 changes: 10 additions & 0 deletions lib/tsserverlibrary.js
Original file line number Diff line number Diff line change
Expand Up @@ -10134,6 +10134,7 @@ var ts;
_0_is_possibly_undefined: diag(18048, ts.DiagnosticCategory.Error, "_0_is_possibly_undefined_18048", "'{0}' is possibly 'undefined'."),
_0_is_possibly_null_or_undefined: diag(18049, ts.DiagnosticCategory.Error, "_0_is_possibly_null_or_undefined_18049", "'{0}' is possibly 'null' or 'undefined'."),
The_value_0_cannot_be_used_here: diag(18050, ts.DiagnosticCategory.Error, "The_value_0_cannot_be_used_here_18050", "The value '{0}' cannot be used here."),
Skip_the_builtin_transformers: diag(18051, ts.DiagnosticCategory.Message, "Skip_the_builtin_transformers_18051", "Skip the builtin transformers."),
};
})(ts || (ts = {}));
var ts;
Expand Down Expand Up @@ -41296,6 +41297,15 @@ var ts;
type: "string",
defaultValueDescription: undefined,
},
{
name: "skipBuiltinTransformers",
type: "boolean",
affectsEmit: true,
affectsMultiFileEmitBuildInfo: true,
category: ts.Diagnostics.Emit,
description: ts.Diagnostics.Skip_the_builtin_transformers,
defaultValueDescription: false,
},
];
/* @internal */
ts.optionDeclarations = __spreadArray(__spreadArray([], ts.commonOptionsWithBuild, true), commandOptionsWithoutBuild, true);
Expand Down
1 change: 1 addition & 0 deletions lib/typescript.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3088,6 +3088,7 @@ declare namespace ts {
typeRoots?: string[];
esModuleInterop?: boolean;
useDefineForClassFields?: boolean;
skipBuiltinTransformers?: boolean;
[option: string]: CompilerOptionsValue | TsConfigSourceFile | undefined;
}
export interface WatchOptions {
Expand Down
10 changes: 10 additions & 0 deletions lib/typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -10125,6 +10125,7 @@ var ts;
_0_is_possibly_undefined: diag(18048, ts.DiagnosticCategory.Error, "_0_is_possibly_undefined_18048", "'{0}' is possibly 'undefined'."),
_0_is_possibly_null_or_undefined: diag(18049, ts.DiagnosticCategory.Error, "_0_is_possibly_null_or_undefined_18049", "'{0}' is possibly 'null' or 'undefined'."),
The_value_0_cannot_be_used_here: diag(18050, ts.DiagnosticCategory.Error, "The_value_0_cannot_be_used_here_18050", "The value '{0}' cannot be used here."),
Skip_the_builtin_transformers: diag(18051, ts.DiagnosticCategory.Message, "Skip_the_builtin_transformers_18051", "Skip the builtin transformers."),
};
})(ts || (ts = {}));
var ts;
Expand Down Expand Up @@ -41287,6 +41288,15 @@ var ts;
type: "string",
defaultValueDescription: undefined,
},
{
name: "skipBuiltinTransformers",
type: "boolean",
affectsEmit: true,
affectsMultiFileEmitBuildInfo: true,
category: ts.Diagnostics.Emit,
description: ts.Diagnostics.Skip_the_builtin_transformers,
defaultValueDescription: false,
},
];
/* @internal */
ts.optionDeclarations = __spreadArray(__spreadArray([], ts.commonOptionsWithBuild, true), commandOptionsWithoutBuild, true);
Expand Down
1 change: 1 addition & 0 deletions lib/typescriptServices.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3088,6 +3088,7 @@ declare namespace ts {
typeRoots?: string[];
esModuleInterop?: boolean;
useDefineForClassFields?: boolean;
skipBuiltinTransformers?: boolean;
[option: string]: CompilerOptionsValue | TsConfigSourceFile | undefined;
}
export interface WatchOptions {
Expand Down
10 changes: 10 additions & 0 deletions lib/typescriptServices.js
Original file line number Diff line number Diff line change
Expand Up @@ -10125,6 +10125,7 @@ var ts;
_0_is_possibly_undefined: diag(18048, ts.DiagnosticCategory.Error, "_0_is_possibly_undefined_18048", "'{0}' is possibly 'undefined'."),
_0_is_possibly_null_or_undefined: diag(18049, ts.DiagnosticCategory.Error, "_0_is_possibly_null_or_undefined_18049", "'{0}' is possibly 'null' or 'undefined'."),
The_value_0_cannot_be_used_here: diag(18050, ts.DiagnosticCategory.Error, "The_value_0_cannot_be_used_here_18050", "The value '{0}' cannot be used here."),
Skip_the_builtin_transformers: diag(18051, ts.DiagnosticCategory.Message, "Skip_the_builtin_transformers_18051", "Skip the builtin transformers."),
};
})(ts || (ts = {}));
var ts;
Expand Down Expand Up @@ -41287,6 +41288,15 @@ var ts;
type: "string",
defaultValueDescription: undefined,
},
{
name: "skipBuiltinTransformers",
type: "boolean",
affectsEmit: true,
affectsMultiFileEmitBuildInfo: true,
category: ts.Diagnostics.Emit,
description: ts.Diagnostics.Skip_the_builtin_transformers,
defaultValueDescription: false,
},
];
/* @internal */
ts.optionDeclarations = __spreadArray(__spreadArray([], ts.commonOptionsWithBuild, true), commandOptionsWithoutBuild, true);
Expand Down
10 changes: 10 additions & 0 deletions lib/typingsInstaller.js
Original file line number Diff line number Diff line change
Expand Up @@ -10115,6 +10115,7 @@ var ts;
_0_is_possibly_undefined: diag(18048, ts.DiagnosticCategory.Error, "_0_is_possibly_undefined_18048", "'{0}' is possibly 'undefined'."),
_0_is_possibly_null_or_undefined: diag(18049, ts.DiagnosticCategory.Error, "_0_is_possibly_null_or_undefined_18049", "'{0}' is possibly 'null' or 'undefined'."),
The_value_0_cannot_be_used_here: diag(18050, ts.DiagnosticCategory.Error, "The_value_0_cannot_be_used_here_18050", "The value '{0}' cannot be used here."),
Skip_the_builtin_transformers: diag(18051, ts.DiagnosticCategory.Message, "Skip_the_builtin_transformers_18051", "Skip the builtin transformers."),
};
})(ts || (ts = {}));
var ts;
Expand Down Expand Up @@ -41277,6 +41278,15 @@ var ts;
type: "string",
defaultValueDescription: undefined,
},
{
name: "skipBuiltinTransformers",
type: "boolean",
affectsEmit: true,
affectsMultiFileEmitBuildInfo: true,
category: ts.Diagnostics.Emit,
description: ts.Diagnostics.Skip_the_builtin_transformers,
defaultValueDescription: false,
},
];
/* @internal */
ts.optionDeclarations = __spreadArray(__spreadArray([], ts.commonOptionsWithBuild, true), commandOptionsWithoutBuild, true);
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@cocos/typescript",
"author": "Microsoft Corp.",
"homepage": "https://www.typescriptlang.org/",
"version": "4.9.5-cocos.2",
"version": "4.9.5-cocos.3",
"license": "Apache-2.0",
"description": "TypeScript is a language for application scale JavaScript development",
"keywords": [
Expand Down
9 changes: 9 additions & 0 deletions src/compiler/commandLineParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1361,6 +1361,15 @@ namespace ts {
type: "string",
defaultValueDescription: undefined,
},
{
name: "skipBuiltinTransformers",
type: "boolean",
affectsEmit: true,
affectsMultiFileEmitBuildInfo: true,
category: Diagnostics.Emit,
description: Diagnostics.Skip_the_builtin_transformers,
defaultValueDescription: false,
},
];

/* @internal */
Expand Down
4 changes: 4 additions & 0 deletions src/compiler/diagnosticMessages.json
Original file line number Diff line number Diff line change
Expand Up @@ -7548,5 +7548,9 @@
"The value '{0}' cannot be used here.": {
"category": "Error",
"code": 18050
},
"Skip the builtin transformers.": {
"category": "Message",
"code": 18051
}
}
2 changes: 2 additions & 0 deletions src/compiler/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6670,6 +6670,8 @@ namespace ts {
/* @internal */ showConfig?: boolean;
useDefineForClassFields?: boolean;

skipBuiltinTransformers?: boolean;

[option: string]: CompilerOptionsValue | TsConfigSourceFile | undefined;
}

Expand Down
1 change: 1 addition & 0 deletions tests/baselines/reference/api/tsserverlibrary.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3088,6 +3088,7 @@ declare namespace ts {
typeRoots?: string[];
esModuleInterop?: boolean;
useDefineForClassFields?: boolean;
skipBuiltinTransformers?: boolean;
[option: string]: CompilerOptionsValue | TsConfigSourceFile | undefined;
}
export interface WatchOptions {
Expand Down
1 change: 1 addition & 0 deletions tests/baselines/reference/api/typescript.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3088,6 +3088,7 @@ declare namespace ts {
typeRoots?: string[];
esModuleInterop?: boolean;
useDefineForClassFields?: boolean;
skipBuiltinTransformers?: boolean;
[option: string]: CompilerOptionsValue | TsConfigSourceFile | undefined;
}
export interface WatchOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
// "skipBuiltinTransformers": true, /* Skip the builtin transformers. */

/* Interop Constraints */
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
// "skipBuiltinTransformers": true, /* Skip the builtin transformers. */

/* Interop Constraints */
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
// "skipBuiltinTransformers": true, /* Skip the builtin transformers. */

/* Interop Constraints */
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
"declarationDir": "lib", /* Specify the output directory for generated declaration files. */
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
// "skipBuiltinTransformers": true, /* Skip the builtin transformers. */

/* Interop Constraints */
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
// "skipBuiltinTransformers": true, /* Skip the builtin transformers. */

/* Interop Constraints */
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
// "skipBuiltinTransformers": true, /* Skip the builtin transformers. */

/* Interop Constraints */
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
// "skipBuiltinTransformers": true, /* Skip the builtin transformers. */

/* Interop Constraints */
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
// "skipBuiltinTransformers": true, /* Skip the builtin transformers. */

/* Interop Constraints */
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
// "skipBuiltinTransformers": true, /* Skip the builtin transformers. */

/* Interop Constraints */
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
// "skipBuiltinTransformers": true, /* Skip the builtin transformers. */

/* Interop Constraints */
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
// "declarationDir": "./", /* Specify the output directory for generated declaration files. */
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
// "skipBuiltinTransformers": true, /* Skip the builtin transformers. */

/* Interop Constraints */
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"compilerOptions": {
"skipBuiltinTransformers": true
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ interface Array<T> { length: number; [n: number]: T; }
// "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */
"declarationDir": "decls", /* Specify the output directory for generated declaration files. */
// "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
// "skipBuiltinTransformers": true, /* Skip the builtin transformers. */

/* Interop Constraints */
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
Expand Down
Loading

0 comments on commit 60cac4b

Please sign in to comment.