diff --git a/pages/Compiler Options in MSBuild.md b/pages/Compiler Options in MSBuild.md index 8ef72c22a..2840ae525 100644 --- a/pages/Compiler Options in MSBuild.md +++ b/pages/Compiler Options in MSBuild.md @@ -22,52 +22,68 @@ Compiler options can be specified using MSBuild properties within an MSBuild pro Compiler Option | MSBuild Property Name | Allowed Values ---------------------------------------------|--------------------------------------------|----------------- -`--declaration` | TypeScriptGeneratesDeclarations | boolean -`--module` | TypeScriptModuleKind | `AMD`, `CommonJs`, `UMD`, or `System` -`--target` | TypeScriptTarget | `ES3`, `ES5`, or `ES6` +`--allowJs` | *Not supported in MSBuild* | +`--allowSyntheticDefaultImports` | TypeScriptAllowSyntheticDefaultImports | boolean +`--allowUnreachableCode` | TypeScriptAllowUnreachableCode | boolean +`--allowUnusedLabels` | TypeScriptAllowUnusedLabels | boolean +`--baseUrl` | TypeScriptBaseUrl | File path `--charset` | TypeScriptCharset | +`--declaration` | TypeScriptGeneratesDeclarations | boolean +`--declarationDir` | TypeScriptDeclarationDir | File path +`--diagnostics` | *Not supported in MSBuild* | `--emitBOM` | TypeScriptEmitBOM | boolean `--emitDecoratorMetadata` | TypeScriptEmitDecoratorMetadata | boolean +`--experimentalAsyncFunctions` | TypeScriptExperimentalAsyncFunctions | boolean `--experimentalDecorators` | TypeScriptExperimentalDecorators | boolean +`--forceConsistentCasingInFileNames` | TypeScriptForceConsistentCasingInFileNames | boolean +`--help` | *Not supported in MSBuild* | `--inlineSourceMap` | TypeScriptInlineSourceMap | boolean `--inlineSources` | TypeScriptInlineSources | boolean +`--init` | *Not supported in MSBuild* | +`--isolatedModules` | TypeScriptIsolatedModules | boolean +`--jsx` | TypeScriptJSXEmit | `React` or `Preserve` +`--lib` | TypeScriptLib | Comma-separated list of strings +`--listEmittedFiles` | *Not supported in MSBuild* | +`--listFiles` | *Not supported in MSBuild* | `--locale` | *automatic* | Automatically set to PreferredUILang value `--mapRoot` | TypeScriptMapRoot | File path +`--module` | TypeScriptModuleKind | `AMD`, `CommonJs`, `UMD`, `System` or `ES6` +`--moduleResolution` | TypeScriptModuleResolution | `Classic` or `Node` `--newLine` | TypeScriptNewLine | `CRLF` or `LF` -`--noEmitOnError` | TypeScriptNoEmitOnError | boolean +`--noEmit` | *Not supported in MSBuild* | `--noEmitHelpers` | TypeScriptNoEmitHelpers | boolean +`--noEmitOnError` | TypeScriptNoEmitOnError | boolean +`--noFallthroughCasesInSwitch` | TypeScriptNoFallthroughCasesInSwitch | boolean `--noImplicitAny` | TypeScriptNoImplicitAny | boolean +`--noImplicitReturns` | TypeScriptNoImplicitReturns | boolean +`--noImplicitThis` | TypeScriptNoImplicitThis | boolean +`--noImplicitUseStrict` | TypeScriptNoImplicitUseStrict | boolean `--noLib` | TypeScriptNoLib | boolean `--noResolve` | TypeScriptNoResolve | boolean `--out` | TypeScriptOutFile | File path `--outDir` | TypeScriptOutDir | File path +`--outFile` | TypeScriptOutFile | File path +`--paths` | *Not supported in MSBuild* | `--preserveConstEnums` | TypeScriptPreserveConstEnums | boolean +`--listEmittedFiles` | *Not supported in MSBuild* | +`--pretty` | *Not supported in MSBuild* | +`--reactNamespace` | TypeScriptReactNamespace | string `--removeComments` | TypeScriptRemoveComments | boolean `--rootDir` | TypeScriptRootDir | File path -`--isolatedModules` | TypeScriptIsolatedModules | boolean +`--rootDirs` | *Not supported in MSBuild* | +`--skipLibCheck` | TypeScriptSkipLibCheck | boolean +`--skipDefaultLibCheck` | TypeScriptSkipDefaultLibCheck | boolean `--sourceMap` | TypeScriptSourceMap | File path `--sourceRoot` | TypeScriptSourceRoot | File path -`--suppressImplicitAnyIndexErrors` | TypeScriptSuppressImplicitAnyIndexErrors | boolean +`--strictNullChecks` | TypeScriptStrictNullChecks | File path `--suppressExcessPropertyErrors` | TypeScriptSuppressExcessPropertyErrors | boolean -`--moduleResolution` | TypeScriptModuleResolution | `Classic` or `Node` -`--experimentalAsyncFunctions` | TypeScriptExperimentalAsyncFunctions | boolean -`--jsx` | TypeScriptJSXEmit | `React` or `Preserve` -`--reactNamespace` | TypeScriptReactNamespace | string -`--skipDefaultLibCheck` | TypeScriptSkipDefaultLibCheck | boolean -`--allowUnusedLabels` | TypeScriptAllowUnusedLabels | boolean -`--noImplicitReturns` | TypeScriptNoImplicitReturns | boolean -`--noFallthroughCasesInSwitch` | TypeScriptNoFallthroughCasesInSwitch | boolean -`--allowUnreachableCode` | TypeScriptAllowUnreachableCode | boolean -`--forceConsistentCasingInFileNames` | TypeScriptForceConsistentCasingInFileNames | boolean -`--allowSyntheticDefaultImports` | TypeScriptAllowSyntheticDefaultImports | boolean -`--noImplicitUseStrict` | TypeScriptNoImplicitUseStrict | boolean -`--project` | *Not supported in VS* | -`--watch` | *Not supported in VS* | -`--diagnostics` | *Not supported in VS* | -`--listFiles` | *Not supported in VS* | -`--noEmit` | *Not supported in VS* | -`--allowJs` | *Not supported in VS* | -*VS only option* | TypeScriptAdditionalFlags | *Any compiler option* +`--suppressImplicitAnyIndexErrors` | TypeScriptSuppressImplicitAnyIndexErrors | boolean +`--target` | TypeScriptTarget | `ES3`, `ES5`, or `ES6` +`--traceResolution` | *Not supported in MSBuild* | +`--types` | TypeScriptTypes | Comma-separated list of strings +`--typeRoots` | TypeScriptTypeRoots | Comma-separated list of file path +`--watch` | *Not supported in MSBuild* | +*MSBuild only option* | TypeScriptAdditionalFlags | *Any compiler option* ## What is supported in my version of Visual Studio? diff --git a/pages/Compiler Options.md b/pages/Compiler Options.md index 9e096ca45..a815b3e20 100644 --- a/pages/Compiler Options.md +++ b/pages/Compiler Options.md @@ -4,10 +4,12 @@ Option | Type | Default -----------------------------------------------|-----------|--------------------------------|---------------------------------------------------------------------- `--allowJs` | `boolean` | `true` | Allow JavaScript files to be compiled. `--allowSyntheticDefaultImports` | `boolean` | `(module === "system")` | Allow default imports from modules with no default export. This does not affect code emit, just typechecking. -`--allowUnreachableCode` | `boolean` | `false` | Do not report errors on unreachable code. +`--allowUnreachableCode` | `boolean` | `false` | Do not report errors on unreachable code. `--allowUnusedLabels` | `boolean` | `false` | Do not report errors on unused labels. +`--baseUrl` | `string` | | Base directory to resolve non-relative module names. See [Module Resolution documentation](./Module Resolution.md#base-url) for more details. `--charset` | `string` | `"utf8"` | The character set of the input files. `--declaration`
`-d` | `boolean` | `false` | Generates corresponding '.d.ts' file. +`--declarationDir` | `string` | | Output directory for generated declaration files. `--diagnostics` | `boolean` | `false` | Show diagnostic information. `--emitBOM` | `boolean` | `false` | Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. `--emitDecoratorMetadata`[1] | `boolean` | `false` | Emit design-type metadata for decorated declarations in source. See [issue #2577](https://github.com/Microsoft/TypeScript/issues/2577) for details. @@ -19,6 +21,8 @@ Option | Type | Default `--init` | | | Initializes a TypeScript project and creates a `tsconfig.json` file. `--isolatedModules` | `boolean` | `false` | Unconditionally emit imports for unresolved files. `--jsx` | `string` | `"Preserve"` | Support JSX in '.tsx' files: `'React'` or `'Preserve'`. See [JSX](./JSX.md). +`--lib` | `string[]`| | List of library files to be included in the compilation.
Possible values are:
► `es5`
► `es6`
► `es2015`
► `es7`
► `es2016`
► `es2017` `dom` `webworker` `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` +`--listEmittedFiles` | `boolean` | `false` | Print names of generated files part of the compilation. `--listFiles` | `boolean` | `false` | Print names of files part of the compilation. `--locale` | `string` | *(platform specific)* | The locale to use to show error messages, e.g. en-us. `--mapRoot` | `string` | `null` | Specifies the location where debugger should locate map files instead of generated locations. Use this flag if the .map files will be located at run-time in a different location than than the .js files. The location specified will be embedded in the sourceMap to direct the debugger where the map files where be located. @@ -31,31 +35,38 @@ Option | Type | Default `--noFallthroughCasesInSwitch` | `boolean` | `false` | Report errors for fallthrough cases in switch statement. `--noImplicitAny` | `boolean` | `false` | Raise error on expressions and declarations with an implied 'any' type. `--noImplicitReturns` | `boolean` | `false` | Report error when not all code paths in function return a value. +`--noImplicitThis` | `boolean` | `false` | Raise error on `this` expressions with an implied 'any' type. `--noImplicitUseStrict` | `boolean` | `false` | Do not emit `"use strict"` directives in module output. `--noLib` | `boolean` | `false` | Do not include the default library file (lib.d.ts). `--noResolve` | `boolean` | `false` | Do not add triple-slash references or module import targets to the list of compiled files. ~~`--out`~~ | `string` | `null` | DEPRECATED. Use `--outFile` instead. `--outDir` | `string` | `null` | Redirect output structure to the directory. `--outFile` | `string` | `null` | Concatenate and emit output to single file. The order of concatenation is determined by the list of files passed to the compiler on the command line along with triple-slash references and imports. See output file order documentation for more details. +`paths`[2] | `Object` | | List of path mapping entries for module names to locations relative to the `baseUrl`. See [Module Resolution documentation](./Module Resolution.md#path-mapping) for more details. `--preserveConstEnums` | `boolean` | `false` | Do not erase const enum declarations in generated code. See [const enums documentation](https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md#94-constant-enum-declarations) for more details. `--pretty`[1] | `boolean` | `false` | Stylize errors and messages using color and context. `--project`
`-p` | `string` | `null` | Compile a project given a valid configuration file.
The argument can be an file path to a valid JSON configuration file, or a directory path to a directory containing a `tsconfig.json` file.
See [tsconfig.json](./tsconfig.json.md) documentation for more details. `--reactNamespace` | `string` | `"React"` | Specifies the object invoked for `createElement` and `__spread` when targeting 'react' JSX emit. `--removeComments` | `boolean` | `false` | Remove all comments except copy-right header comments beginning with `/*!` `--rootDir` | `string` | *(common root directory is computed from the list of input files)* | Specifies the root directory of input files. Only use to control the output directory structure with `--outDir`. -`--skipDefaultLibCheck` | `boolean` | `false` | Don't check a user-defined default lib file's valitidy. +`rootDirs`[2] | `string[]`| | List of root folders whose combined content represent the structure of the project at runtime. See [Module Resolution documentation](./Module Resolution.md#virtual-directories-with-rootdirs) for more details. +`--skipLibCheck` | `boolean` | `false` | Don't check a the default library (`lib.d.ts`) file's valitidy. +`--skipDefaultLibCheck` | `boolean` | `false` | Don't check a user-defined default library (`*.d.ts`) file's valitidy. `--sourceMap` | `boolean` | `false` | Generates corresponding '.map' file. `--sourceRoot` | `string` | `null` | Specifies the location where debugger should locate TypeScript files instead of source locations. Use this flag if the sources will be located at run-time in a different location than that at design-time. The location specified will be embedded in the sourceMap to direct the debugger where the source files where be located. `--strictNullChecks` | `boolean` | `false` | In strict null checking mode, the `null` and `undefined` values are not in the domain of every type and are only assignable to themselves and `any` (the one exception being that `undefined` is also assignable to `void`). `--stripInternal`[1] | `boolean` | `false` | Do not emit declarations for code that has an `/** @internal */` JSDoc annotation. `--suppressExcessPropertyErrors` | `boolean` | `false` | Suppress excess property checks for object literals. `--suppressImplicitAnyIndexErrors` | `boolean` | `false` | Suppress `--noImplicitAny` errors for indexing objects lacking index signatures. See [issue #1232](https://github.com/Microsoft/TypeScript/issues/1232#issuecomment-64510362) for more details. -`--target`
`-t` | `string` | `"ES5"` | Specify ECMAScript target version: `'es3'` (default), `'es5'`, or `'es6'`. +`--target`
`-t` | `string` | `"ES3"` | Specify ECMAScript target version: `'es3'` (default), `'es5'`, or `'es6'`. `--traceResolution` | `boolean` | `false` | Report module resolution log messages. +`--types` | `string[]`| | List of names of type definitions to include. +`--typeRoots` | `string[]`| | List of folders to include type definitions from. `--version`
`-v` | | | Print the compiler's version. `--watch`
`-w` | | | Run the compiler in watch mode. Watch input files and trigger recompilation on changes. -[1] These options are experimental. +* [1] These options are experimental. +* [2] These options are only allowed in `tsconfig.json`, and not through command-line switches. ## Related