Revisions for the new --help (#44800)

* WIP on refining the new --help

* Fix types in the boolean trivial lint rule

* Update baselines

* More work

* Updates the color logic

* Simplifies the CLI color code

* Use cyan instead of blue for win powershell/command prompt

* Use bright white when blue is probably going to look off

* Fix NO_COLOR

* Adds a test to cover NO_COLOR

* Update src/compiler/diagnosticMessages.json

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>

* Update compiler diagnostic text

Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
This commit is contained in:
Orta Therox 2021-08-05 16:41:01 +01:00 committed by GitHub
parent 635f5bdf8c
commit 1f85123821
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 290 additions and 110 deletions

View file

@ -223,7 +223,7 @@ namespace ts {
type: "boolean",
showInSimplifiedHelpView: true,
category: Diagnostics.Output_Formatting,
description: Diagnostics.Enable_color_and_formatting_in_output_to_make_compiler_errors_easier_to_read,
description: Diagnostics.Enable_color_and_formatting_in_TypeScript_s_output_to_make_compiler_errors_easier_to_read,
defaultValueDescription: "true"
},
{
@ -553,7 +553,7 @@ namespace ts {
type: "boolean",
showInSimplifiedHelpView: true,
category: Diagnostics.Emit,
description: Diagnostics.Disable_emitting_file_from_a_compilation,
description: Diagnostics.Disable_emitting_files_from_a_compilation,
transpileOptionValue: undefined,
defaultValueDescription: "false"
},

View file

@ -5459,7 +5459,7 @@
"category": "Message",
"code": 6659
},
"Disable emitting file from a compilation.": {
"Disable emitting files from a compilation.": {
"category": "Message",
"code": 6660
},
@ -5559,7 +5559,7 @@
"category": "Message",
"code": 6684
},
"Enable color and formatting in output to make compiler errors easier to read": {
"Enable color and formatting in TypeScript's output to make compiler errors easier to read": {
"category": "Message",
"code": 6685
},
@ -5788,7 +5788,7 @@
"category": "Message",
"code": 6923
},
"Ignoring tsconfig.json, compiles the specified files with default compiler options": {
"Ignoring tsconfig.json, compiles the specified files with default compiler options.": {
"category": "Message",
"code": 6924
},
@ -5800,7 +5800,7 @@
"category": "Message",
"code": 6926
},
"Compiles the TypeScript project located at the specified path": {
"Compiles the TypeScript project located at the specified path.": {
"category": "Message",
"code": 6927
},
@ -5808,7 +5808,7 @@
"category": "Message",
"code": 6928
},
"Compiles the current project, with additional settings": {
"Compiles the current project, with additional settings.": {
"category": "Message",
"code": 6929
},

View file

@ -68,7 +68,7 @@ namespace ts {
}
function defaultIsPretty(sys: System) {
return !!sys.writeOutputIsTTY && sys.writeOutputIsTTY();
return !!sys.writeOutputIsTTY && sys.writeOutputIsTTY() && !sys.getEnvironmentVariable("NO_COLOR");
}
function shouldBePretty(sys: System, options: CompilerOptions | BuildOptions) {
@ -96,26 +96,47 @@ namespace ts {
bold: (str: string) => str,
blue: (str: string) => str,
blueBackground: (str: string) => str,
white: (str: string) => str
brightWhite: (str: string) => str
};
}
function bold(str: string) {
return `\x1b[1m${str}\x1b[22m`;
}
const isWindows = sys.getEnvironmentVariable("OS") && stringContains(sys.getEnvironmentVariable("OS").toLowerCase(), "windows");
const isWindowsTerminal = sys.getEnvironmentVariable("WT_SESSION");
const isVSCode = sys.getEnvironmentVariable("TERM_PROGRAM") && sys.getEnvironmentVariable("TERM_PROGRAM") === "vscode";
function blue(str: string) {
return `\x1b[34m${str}\x1b[39m`;
// Effectively Powershell and Command prompt users use cyan instead
// of blue because the default theme doesn't show blue with enough contrast.
if (isWindows && !isWindowsTerminal && !isVSCode) {
return brightWhite(str);
}
return `\x1b[94m${str}\x1b[39m`;
}
// There are ~3 types of terminal color support: 16 colors, 256 and 16m colors
// If there is richer color support, e.g. 256+ we can use extended ANSI codes which are not just generic 'blue'
// but a 'lighter blue' which is closer to the blue in the TS logo.
const supportsRicherColors = sys.getEnvironmentVariable("COLORTERM") === "truecolor" || sys.getEnvironmentVariable("TERM") === "xterm-256color";
function blueBackground(str: string) {
return `\x1b[44m${str}\x1b[49m`;
if (supportsRicherColors) {
return `\x1B[48;5;68m${str}\x1B[39;49m`;
}
else {
return `\x1b[44m${str}\x1B[39;49m`;
}
}
function white(str: string) {
return `\x1b[37m${str}\x1b[39m`;
function brightWhite(str: string) {
return `\x1b[97m${str}\x1b[39m`;
}
return {
bold,
blue,
white,
brightWhite,
blueBackground
};
}
@ -143,7 +164,7 @@ namespace ts {
const terminalWidth = sys.getWidthOfTerminal?.() ?? 0;
// Note: child_process might return `terminalWidth` as undefined.
if (terminalWidth >= 60) {
if (terminalWidth >= 80) {
let description = "";
if (option.description) {
description = getDiagnosticText(option.description);
@ -340,7 +361,7 @@ namespace ts {
example("tsc app.ts util.ts", Diagnostics.Ignoring_tsconfig_json_compiles_the_specified_files_with_default_compiler_options);
example("tsc -b", Diagnostics.Build_a_composite_project_in_the_working_directory);
example("tsc --init", Diagnostics.Creates_a_tsconfig_json_with_the_recommended_settings_in_the_working_directory);
example("tsc -p .path/to/tsconfig.json", Diagnostics.Compiles_the_TypeScript_project_located_at_the_specified_path);
example("tsc -p ./path/to/tsconfig.json", Diagnostics.Compiles_the_TypeScript_project_located_at_the_specified_path);
example("tsc --help --all", Diagnostics.An_expanded_version_of_this_information_showing_all_possible_compiler_options);
example(["tsc --noEmit", "tsc --target esnext"], Diagnostics.Compiles_the_current_project_with_additional_settings);
@ -392,7 +413,7 @@ namespace ts {
const tsIconLength = 5;
const tsIconFirstLine = colors.blueBackground(padLeft("", tsIconLength));
const tsIconSecondLine = colors.blueBackground(colors.white(padLeft("TS ", tsIconLength)));
const tsIconSecondLine = colors.blueBackground(colors.brightWhite(padLeft("TS ", tsIconLength)));
// If we have enough space, print TS icon.
if (terminalWidth >= tscExplanation.length + tsIconLength) {
// right align of the icon is 120 at most.

View file

@ -14,5 +14,14 @@ namespace ts {
fs: () => loadProjectFromFiles({}),
commandLineArgs: [],
});
verifyTsc({
scenario: "runWithoutArgs",
subScenario: "does not add color when NO_COLOR is set",
fs: () => loadProjectFromFiles({}),
commandLineArgs: [],
environmentVariables: { NO_COLOR: "true" }
});
});
}

View file

@ -49,7 +49,7 @@
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */
// "outDir": "./", /* Specify an output folder for all emitted files. */
// "removeComments": true, /* Disable emitting comments. */
// "noEmit": true, /* Disable emitting file from a compilation. */
// "noEmit": true, /* Disable emitting files from a compilation. */
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types */
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */

View file

@ -49,7 +49,7 @@
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */
// "outDir": "./", /* Specify an output folder for all emitted files. */
// "removeComments": true, /* Disable emitting comments. */
// "noEmit": true, /* Disable emitting file from a compilation. */
// "noEmit": true, /* Disable emitting files from a compilation. */
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types */
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */

View file

@ -49,7 +49,7 @@
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */
// "outDir": "./", /* Specify an output folder for all emitted files. */
// "removeComments": true, /* Disable emitting comments. */
// "noEmit": true, /* Disable emitting file from a compilation. */
// "noEmit": true, /* Disable emitting files from a compilation. */
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types */
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */

View file

@ -49,7 +49,7 @@
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */
// "outDir": "./", /* Specify an output folder for all emitted files. */
// "removeComments": true, /* Disable emitting comments. */
// "noEmit": true, /* Disable emitting file from a compilation. */
// "noEmit": true, /* Disable emitting files from a compilation. */
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types */
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */

View file

@ -49,7 +49,7 @@
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */
// "outDir": "./", /* Specify an output folder for all emitted files. */
// "removeComments": true, /* Disable emitting comments. */
// "noEmit": true, /* Disable emitting file from a compilation. */
// "noEmit": true, /* Disable emitting files from a compilation. */
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types */
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */

View file

@ -49,7 +49,7 @@
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */
// "outDir": "./", /* Specify an output folder for all emitted files. */
// "removeComments": true, /* Disable emitting comments. */
// "noEmit": true, /* Disable emitting file from a compilation. */
// "noEmit": true, /* Disable emitting files from a compilation. */
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types */
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */

View file

@ -49,7 +49,7 @@
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */
// "outDir": "./", /* Specify an output folder for all emitted files. */
// "removeComments": true, /* Disable emitting comments. */
// "noEmit": true, /* Disable emitting file from a compilation. */
// "noEmit": true, /* Disable emitting files from a compilation. */
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types */
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */

View file

@ -49,7 +49,7 @@
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */
// "outDir": "./", /* Specify an output folder for all emitted files. */
// "removeComments": true, /* Disable emitting comments. */
// "noEmit": true, /* Disable emitting file from a compilation. */
// "noEmit": true, /* Disable emitting files from a compilation. */
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types */
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */

View file

@ -49,7 +49,7 @@
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */
// "outDir": "./", /* Specify an output folder for all emitted files. */
// "removeComments": true, /* Disable emitting comments. */
// "noEmit": true, /* Disable emitting file from a compilation. */
// "noEmit": true, /* Disable emitting files from a compilation. */
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types */
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */

View file

@ -0,0 +1,150 @@
Input::
//// [/lib/lib.d.ts]
Output::
/lib/tsc
Version FakeTSVersion
tsc: The TypeScript Compiler - Version FakeTSVersion
COMMON COMMANDS
tsc
Compiles the current project (tsconfig.json in the working directory.)
tsc app.ts util.ts
Ignoring tsconfig.json, compiles the specified files with default compiler options.
tsc -b
Build a composite project in the working directory.
tsc --init
Creates a tsconfig.json with the recommended settings in the working directory.
tsc -p ./path/to/tsconfig.json
Compiles the TypeScript project located at the specified path.
tsc --help --all
An expanded version of this information, showing all possible compiler options
tsc --noEmit
tsc --target esnext
Compiles the current project, with additional settings.
COMMAND LINE FLAGS
--help, -h
Print this message.
--watch, -w
Watch input files.
--all
Show all compiler options.
--version, -v
Print the compiler's version.
--init
Initializes a TypeScript project and creates a tsconfig.json file.
--project, -p
Compile the project given the path to its configuration file, or to a folder with a 'tsconfig.json'.
--build, -b
Build one or more projects and their dependencies, if out of date
--showConfig
Print the final configuration instead of building.
COMMON COMPILER OPTIONS
--pretty
Enable color and formatting in TypeScript's output to make compiler errors easier to read
type: boolean
default: true
--target, -t
Set the JavaScript language version for emitted JavaScript and include compatible library declarations.
one of: es3, es5, es6, es2015, es2016, es2017, es2018, es2019, es2020, es2021, esnext
default: ES3
--module, -m
Specify what module code is generated.
one of: none, commonjs, amd, system, umd, es6, es2015, es2020, esnext
--lib
Specify a set of bundled library declaration files that describe the target runtime environment.
one or more: es5, es6, es2015, es7, es2016, es2017, es2018, es2019, es2020, es2021, esnext, dom, dom.iterable, webworker, webworker.importscripts, webworker.iterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol, es2020.bigint, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2021.promise, es2021.string, es2021.weakref, esnext.array, esnext.symbol, esnext.asynciterable, esnext.intl, esnext.bigint, esnext.string, esnext.promise, esnext.weakref
--allowJs
Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files.
type: boolean
default: false
--checkJs
Enable error reporting in type-checked JavaScript files.
type: boolean
default: false
--jsx
Specify what JSX code is generated.
one of: preserve, react-native, react, react-jsx, react-jsxdev
default: undefined
--declaration, -d
Generate .d.ts files from TypeScript and JavaScript files in your project.
type: boolean
default: `false`, unless `composite` is set
--declarationMap
Create sourcemaps for d.ts files.
type: boolean
default: false
--emitDeclarationOnly
Only output d.ts files and not JavaScript files.
type: boolean
default: false
--sourceMap
Create source map files for emitted JavaScript files.
type: boolean
default: false
--outFile
Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output.
--outDir
Specify an output folder for all emitted files.
--removeComments
Disable emitting comments.
type: boolean
default: false
--noEmit
Disable emitting files from a compilation.
type: boolean
default: false
--strict
Enable all strict type-checking options.
type: boolean
default: false
--types
Specify type package names to be included without being referenced in a source file.
--esModuleInterop
Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility.
type: boolean
default: false
You can learn about all of the compiler options at https://aka.ms/tsconfig-reference
exitCode:: ExitStatus.DiagnosticsPresent_OutputsSkipped

View file

@ -11,134 +11,134 @@ tsc: The TypeScript Compiler - Version FakeTSVersion
COMMON COMMANDS
tsc
tsc
Compiles the current project (tsconfig.json in the working directory.)
tsc app.ts util.ts
Ignoring tsconfig.json, compiles the specified files with default compiler options
tsc app.ts util.ts
Ignoring tsconfig.json, compiles the specified files with default compiler options.
tsc -b
tsc -b
Build a composite project in the working directory.
tsc --init
tsc --init
Creates a tsconfig.json with the recommended settings in the working directory.
tsc -p .path/to/tsconfig.json
Compiles the TypeScript project located at the specified path
tsc -p ./path/to/tsconfig.json
Compiles the TypeScript project located at the specified path.
tsc --help --all
tsc --help --all
An expanded version of this information, showing all possible compiler options
tsc --noEmit
tsc --target esnext
Compiles the current project, with additional settings
tsc --noEmit
tsc --target esnext
Compiles the current project, with additional settings.
COMMAND LINE FLAGS
--help, -h
--help, -h
Print this message.
--watch, -w
--watch, -w
Watch input files.
--all
--all
Show all compiler options.
--version, -v
--version, -v
Print the compiler's version.
--init
--init
Initializes a TypeScript project and creates a tsconfig.json file.
--project, -p
--project, -p
Compile the project given the path to its configuration file, or to a folder with a 'tsconfig.json'.
--build, -b
--build, -b
Build one or more projects and their dependencies, if out of date
--showConfig
--showConfig
Print the final configuration instead of building.
COMMON COMPILER OPTIONS
--pretty
Enable color and formatting in output to make compiler errors easier to read
--pretty
Enable color and formatting in TypeScript's output to make compiler errors easier to read
type: boolean
default: true
--target, -t
--target, -t
Set the JavaScript language version for emitted JavaScript and include compatible library declarations.
one of: es3, es5, es6, es2015, es2016, es2017, es2018, es2019, es2020, es2021, esnext
default: ES3
--module, -m
--module, -m
Specify what module code is generated.
one of: none, commonjs, amd, system, umd, es6, es2015, es2020, esnext
--lib
--lib
Specify a set of bundled library declaration files that describe the target runtime environment.
one or more: es5, es6, es2015, es7, es2016, es2017, es2018, es2019, es2020, es2021, esnext, dom, dom.iterable, webworker, webworker.importscripts, webworker.iterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol, es2020.bigint, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2021.promise, es2021.string, es2021.weakref, esnext.array, esnext.symbol, esnext.asynciterable, esnext.intl, esnext.bigint, esnext.string, esnext.promise, esnext.weakref
--allowJs
--allowJs
Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files.
type: boolean
default: false
--checkJs
--checkJs
Enable error reporting in type-checked JavaScript files.
type: boolean
default: false
--jsx
--jsx
Specify what JSX code is generated.
one of: preserve, react-native, react, react-jsx, react-jsxdev
default: undefined
--declaration, -d
--declaration, -d
Generate .d.ts files from TypeScript and JavaScript files in your project.
type: boolean
default: `false`, unless `composite` is set
--declarationMap
--declarationMap
Create sourcemaps for d.ts files.
type: boolean
default: false
--emitDeclarationOnly
--emitDeclarationOnly
Only output d.ts files and not JavaScript files.
type: boolean
default: false
--sourceMap
--sourceMap
Create source map files for emitted JavaScript files.
type: boolean
default: false
--outFile
--outFile
Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output.
--outDir
--outDir
Specify an output folder for all emitted files.
--removeComments
--removeComments
Disable emitting comments.
type: boolean
default: false
--noEmit
Disable emitting file from a compilation.
--noEmit
Disable emitting files from a compilation.
type: boolean
default: false
--strict
--strict
Enable all strict type-checking options.
type: boolean
default: false
--types
--types
Specify type package names to be included without being referenced in a source file.
--esModuleInterop
--esModuleInterop
Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility.
type: boolean
default: false

View file

@ -11,134 +11,134 @@ tsc: The TypeScript Compiler - Version FakeTSVersion
COMMON COMMANDS
tsc
tsc
Compiles the current project (tsconfig.json in the working directory.)
tsc app.ts util.ts
Ignoring tsconfig.json, compiles the specified files with default compiler options
tsc app.ts util.ts
Ignoring tsconfig.json, compiles the specified files with default compiler options.
tsc -b
tsc -b
Build a composite project in the working directory.
tsc --init
tsc --init
Creates a tsconfig.json with the recommended settings in the working directory.
tsc -p .path/to/tsconfig.json
Compiles the TypeScript project located at the specified path
tsc -p ./path/to/tsconfig.json
Compiles the TypeScript project located at the specified path.
tsc --help --all
tsc --help --all
An expanded version of this information, showing all possible compiler options
tsc --noEmit
tsc --target esnext
Compiles the current project, with additional settings
tsc --noEmit
tsc --target esnext
Compiles the current project, with additional settings.
COMMAND LINE FLAGS
--help, -h
--help, -h
Print this message.
--watch, -w
--watch, -w
Watch input files.
--all
--all
Show all compiler options.
--version, -v
--version, -v
Print the compiler's version.
--init
--init
Initializes a TypeScript project and creates a tsconfig.json file.
--project, -p
--project, -p
Compile the project given the path to its configuration file, or to a folder with a 'tsconfig.json'.
--build, -b
--build, -b
Build one or more projects and their dependencies, if out of date
--showConfig
--showConfig
Print the final configuration instead of building.
COMMON COMPILER OPTIONS
--pretty
Enable color and formatting in output to make compiler errors easier to read
--pretty
Enable color and formatting in TypeScript's output to make compiler errors easier to read
type: boolean
default: true
--target, -t
--target, -t
Set the JavaScript language version for emitted JavaScript and include compatible library declarations.
one of: es3, es5, es6, es2015, es2016, es2017, es2018, es2019, es2020, es2021, esnext
default: ES3
--module, -m
--module, -m
Specify what module code is generated.
one of: none, commonjs, amd, system, umd, es6, es2015, es2020, esnext
--lib
--lib
Specify a set of bundled library declaration files that describe the target runtime environment.
one or more: es5, es6, es2015, es7, es2016, es2017, es2018, es2019, es2020, es2021, esnext, dom, dom.iterable, webworker, webworker.importscripts, webworker.iterable, scripthost, es2015.core, es2015.collection, es2015.generator, es2015.iterable, es2015.promise, es2015.proxy, es2015.reflect, es2015.symbol, es2015.symbol.wellknown, es2016.array.include, es2017.object, es2017.sharedmemory, es2017.string, es2017.intl, es2017.typedarrays, es2018.asyncgenerator, es2018.asynciterable, es2018.intl, es2018.promise, es2018.regexp, es2019.array, es2019.object, es2019.string, es2019.symbol, es2020.bigint, es2020.promise, es2020.sharedmemory, es2020.string, es2020.symbol.wellknown, es2020.intl, es2021.promise, es2021.string, es2021.weakref, esnext.array, esnext.symbol, esnext.asynciterable, esnext.intl, esnext.bigint, esnext.string, esnext.promise, esnext.weakref
--allowJs
--allowJs
Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files.
type: boolean
default: false
--checkJs
--checkJs
Enable error reporting in type-checked JavaScript files.
type: boolean
default: false
--jsx
--jsx
Specify what JSX code is generated.
one of: preserve, react-native, react, react-jsx, react-jsxdev
default: undefined
--declaration, -d
--declaration, -d
Generate .d.ts files from TypeScript and JavaScript files in your project.
type: boolean
default: `false`, unless `composite` is set
--declarationMap
--declarationMap
Create sourcemaps for d.ts files.
type: boolean
default: false
--emitDeclarationOnly
--emitDeclarationOnly
Only output d.ts files and not JavaScript files.
type: boolean
default: false
--sourceMap
--sourceMap
Create source map files for emitted JavaScript files.
type: boolean
default: false
--outFile
--outFile
Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output.
--outDir
--outDir
Specify an output folder for all emitted files.
--removeComments
--removeComments
Disable emitting comments.
type: boolean
default: false
--noEmit
Disable emitting file from a compilation.
--noEmit
Disable emitting files from a compilation.
type: boolean
default: false
--strict
--strict
Enable all strict type-checking options.
type: boolean
default: false
--types
--types
Specify type package names to be included without being referenced in a source file.
--esModuleInterop
--esModuleInterop
Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility.
type: boolean
default: false

View file

@ -70,7 +70,7 @@ interface Array<T> { length: number; [n: number]: T; }
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */
// "outDir": "./", /* Specify an output folder for all emitted files. */
// "removeComments": true, /* Disable emitting comments. */
// "noEmit": true, /* Disable emitting file from a compilation. */
// "noEmit": true, /* Disable emitting files from a compilation. */
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types */
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */

View file

@ -70,7 +70,7 @@ interface Array<T> { length: number; [n: number]: T; }
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */
"outDir": "build", /* Specify an output folder for all emitted files. */
// "removeComments": true, /* Disable emitting comments. */
// "noEmit": true, /* Disable emitting file from a compilation. */
// "noEmit": true, /* Disable emitting files from a compilation. */
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types */
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */

View file

@ -70,7 +70,7 @@ interface Array<T> { length: number; [n: number]: T; }
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */
"outDir": "build", /* Specify an output folder for all emitted files. */
// "removeComments": true, /* Disable emitting comments. */
// "noEmit": true, /* Disable emitting file from a compilation. */
// "noEmit": true, /* Disable emitting files from a compilation. */
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types */
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */

View file

@ -70,7 +70,7 @@ interface Array<T> { length: number; [n: number]: T; }
"outFile": "build/outFile.js", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */
// "outDir": "./", /* Specify an output folder for all emitted files. */
// "removeComments": true, /* Disable emitting comments. */
// "noEmit": true, /* Disable emitting file from a compilation. */
// "noEmit": true, /* Disable emitting files from a compilation. */
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types */
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */

View file

@ -70,7 +70,7 @@ interface Array<T> { length: number; [n: number]: T; }
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */
// "outDir": "./", /* Specify an output folder for all emitted files. */
// "removeComments": true, /* Disable emitting comments. */
// "noEmit": true, /* Disable emitting file from a compilation. */
// "noEmit": true, /* Disable emitting files from a compilation. */
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types */
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */

View file

@ -70,7 +70,7 @@ interface Array<T> { length: number; [n: number]: T; }
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If `declaration` is true, also designates a file that bundles all .d.ts output. */
// "outDir": "./", /* Specify an output folder for all emitted files. */
// "removeComments": true, /* Disable emitting comments. */
// "noEmit": true, /* Disable emitting file from a compilation. */
// "noEmit": true, /* Disable emitting files from a compilation. */
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
// "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types */
// "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */