- 
                Notifications
    You must be signed in to change notification settings 
- Fork 13.1k
Compiler Options
        Daniel Rosenwasser edited this page May 18, 2015 
        ·
        38 revisions
      
    | Option | Shorthand | Description | 
|---|---|---|
| --declaration | --d | Generates corresponding '.d.ts' file. | 
| --help | --h | Print help message. | 
| --version | --v | Print the compiler's version. | 
| --module | --m | Specify module code generation: 'commonjs', 'amd', 'system'[1], or 'umd'[1]. | 
| --project | --p | Compile the project in the given directory. The directory needs to contain a tsconfig.jsonfile to direct compilation. See tsconfig.json documentation for more details. | 
| --target | --t | Specify ECMAScript target version: 'ES3' (default), 'ES5', or 'ES6'[2] | 
| --watch | --w | Run the compiler in watch mode. Watch input files and trigger recompilation on changes. | 
| --charset | The character set of the input files. | |
| --diagnostics | Show diagnostic information. | |
| --emitBOM | Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. | |
| --emitDecoratorMetadata[1][2] | Emit design-type metadata for decorated declarations in source. See issue #2577 for details. | |
| --listFiles | Print names of files part of the compilation. | |
| --locale | The locale to use to show error messages, e.g. en-us. | |
| --mapRoot | 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. | |
| --newLine[1] | Specifies the end of line sequence to be used when emitting files: 'CRLF' (dos) or 'LF' (unix)." | |
| --noEmit | Do not emit outputs. | |
| --noEmitOnError | Do not emit outputs if any type checking errors were reported. | |
| --noImplicitAny | Raise error on expressions and declarations with an implied 'any' type. | |
| --noLib | Do not include the default library file (lib.d.ts). | |
| --noResolve | Do not add triple-slash references or module import targets to the list of compiled files. | |
| --out | 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. | |
| --outDir | Redirect output structure to the directory. | |
| --preserveConstEnums | Do not erase const enum declarations in generated code. See const enums documentation for more details. | |
| --removeComments | Do not emit comments to output. | |
| --rootDir[1] | Specifies the root directory of input files. Use to control the output directory structure with --outDir. | |
| --separateCompilation[1] | Unconditionally emit imports for unresolved files. | |
| --sourceMap | Generates corresponding '.map' file. | |
| --sourceRoot | 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. | |
| --stripInternal[2] | Do not emit declarations for code that has an @internalannotation. | |
| --suppressImplicitAnyIndexErrors | Suppress --noImplicitAnyerrors for indexing objects lacking index signatures. See issue #1232 for more details. | 
[1] These options will only be available in TypeScript 1.5.
[2] These options are experimental.
- For tsconfig.json see tsconfig.json
- For Setting the compiler options in MSBuild projects see Setting Compiler Options in MSBuild projects
News
Debugging TypeScript
- Performance
- Performance-Tracing
- Debugging-Language-Service-in-VS-Code
- Getting-logs-from-TS-Server-in-VS-Code
- JavaScript-Language-Service-in-Visual-Studio
- Providing-Visual-Studio-Repro-Steps
Contributing to TypeScript
- Contributing to TypeScript
- TypeScript Design Goals
- Coding Guidelines
- Useful Links for TypeScript Issue Management
- Writing Good Design Proposals
- Compiler Repo Notes
- Deployment
Building Tools for TypeScript
- Architectural Overview
- Using the Compiler API
- Using the Language Service API
- Standalone Server (tsserver)
- TypeScript MSBuild In Depth
- Debugging Language Service in VS Code
- Writing a Language Service Plugin
- Docker Quickstart
FAQs
The Main Repo