TSConfig Reference
Basic Options
Additional Checks Copy
Incremental
Enable incremental compilation
Value | incremental |
Default | true |
Target
Specify ECMAScript target version: ‘ES3’ (default), ‘ES5’, ‘ES2015’, ‘ES2016’, ‘ES2017’, ‘ES2018’, ‘ES2019’ or ‘ESNEXT’.
Value | target |
Default | false |
Module
Specify module code generation: ‘none’, ‘commonjs’, ‘amd’, ‘system’, ‘umd’, ‘es2015’, or ‘ESNext’.
Value | module |
Lib
Specify library files to be included in the compilation.
Value | lib |
Default | n/a |
Allow JS
Allow javascript files to be compiled.
Value | allowJs |
Default | false |
Check JS
Report errors in .js files.
Value | checkJs |
Default | false |
JSx
Specify JSX code generation: ‘preserve’, ‘react-native’, or ‘react’.
Value | jsx |
Default | "preserve" |
Declaration
Generates corresponding ‘.d.ts’ file.
Value | declaration |
Default | True when TS |
Declaration Map
Generates a sourcemap for each corresponding ‘.d.ts’ file.
Value | declarationMap |
Default | false |
Source Map
Generates corresponding ‘.map’ file.
Value | sourceMap |
Default | false |
Out File
Concatenate and emit output to single file.
Value | outFile |
Default | n/a |
Related | out , outDir |
Out Dir
Redirect output structure to the directory.
Value | outDir |
Default | n/a |
Related | out , outFile |
Root Dir
Specify the root directory of input files. Use to control the output directory structure with —outDir.
Value | rootDir |
Default | Computed from the list of input files |
Composite
Enable project compilation
Value | composite |
Default | true |
TS Build Info File
Specify file to store incremental compilation information
Value | tsBuildInfoFile |
Default | .tsbuildin |
Remove Comments
Do not emit comments to output.
Value | removeComments |
Default | false |
No Emit
Do not emit outputs.
Value | noEmit |
Default | false |
Import Helpers
Import emit helpers from ‘tslib’.
Value | importHelpers |
Default | false |
Downlevel Iteration
Provide full support for iterables in ‘for-of’, spread, and destructuring when targeting ‘ES5’ or ‘ES3’.
Value | downlevelIteration |
Default | false |
Isolated Modules
Transpile each file as a separate module (similar to ‘ts.transpileModule’).
Value | isolatedModules |
Default | false |
Strict Checks
Additional Checks Copy
Strict
Enable all strict type-checking options.
Value | strict |
Default | false |
Related | strictBindCallApply , strictFunctionTypes , strictPropertyInitialization |
No Implicit Any
Raise error on expressions and declarations with an implied ‘any’ type.
Value | noImplicitAny |
Default | false |
Strict Null Checks
Enable strict null checks.
Value | strictNullChecks |
Default | false |
Strict Function Types
Enable strict checking of function types.
Value | strictFunctionTypes |
Default | false |
Strict Bind Call Apply
Enable strict ‘bind’, ‘call’, and ‘apply’ methods on functions.
Value | strictBindCallApply |
Default | false |
Strict Property Initialization
Enable strict checking of property initialization in classes.
Value | strictPropertyInitialization |
Default | false |
No Implicit This
Raise error on ‘this’ expressions with an implied ‘any’ type.
Value | noImplicitThis |
Default | false |
Always Strict
Parse in strict mode and emit “use strict” for each source file.
Value | alwaysStrict |
Default | false |
Module Resolution
Additional Checks Copy
Module Resolution
Specify module resolution strategy: ‘node’ (Node.js) or ‘classic’ (TypeScript pre-1.6).
Value | moduleResolution |
Base Url
Base directory to resolve non-absolute module names.
Value | baseUrl |
Default | n/a |
Paths
A series of entries which re-map imports to lookup locations relative to the ‘baseUrl’.
Value | paths |
Root Dirs
List of root folders whose combined content represents the structure of the project at runtime.
Value | rootDirs |
Type Roots
List of folders to include type definitions from.
Value | typeRoots |
Types
Type declaration files to be included in compilation.
Value | types |
Allow Synthetic Default Imports
Allow default imports from modules with no default export. This does not affect code emit, just typechecking.
Value | allowSyntheticDefaultImports |
Default | module === “system” or esModuleInterop |
Es Module Interop
Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies ‘allowSyntheticDefaultImports’.
Value | esModuleInterop |
Default | false |
Preserve Symlinks
Do not resolve the real path of symlinks.
Value | preserveSymlinks |
Default | false |
Allow Umd Global Access
Allow accessing UMD globals from modules.
Value | allowUmdGlobalAccess |
Default | false |
Source Maps
Additional Checks Copy
Source Root
Specify the location where debugger should locate TypeScript files instead of source locations.
Value | sourceRoot |
Map Root
Specify the location where debugger should locate map files instead of generated locations.
Value | mapRoot |
Default | n/a |
Inline Source Map
Emit a single file with source maps instead of having a separate file.
Value | inlineSourceMap |
Default | false |
Inline Sources
Emit the source alongside the sourcemaps within a single file; requires ‘—inlineSourceMap’ or ‘—sourceMap’ to be set.
Value | inlineSources |
Default | false |
Additional Checks
Additional Checks Copy
No Unused Locals
Report errors on unused locals.
Value | noUnusedLocals |
Default | false |
No Unused Parameters
Report errors on unused parameters.
Value | noUnusedParameters |
Default | false |
No Implicit Returns
Report error when not all code paths in function return a value.
Value | noImplicitReturns |
Default | false |
No Fallthrough Cases In Switch
Report errors for fallthrough cases in switch statement.
Value | noFallthroughCasesInSwitch |
Default | false |
Experimental
Additional Checks Copy
Experimental Decorators
Enables experimental support for ES7 decorators.
Value | experimentalDecorators |
Emit Decorator Metadata
Enables experimental support for emitting type metadata for decorators.
Value | emitDecoratorMetadata |
Advanced
Additional Checks Copy
List Files
Print names of files part of the compilation.
Value | listFiles |
Default | false |
List Emitted Files
Print names of generated files part of the compilation.
Value | listEmittedFiles |
Default | false |
Trace Resolution
Enable tracing of the name resolution process.
Value | traceResolution |
Default | false |
Diagnostics
Show diagnostic information.
Value | diagnostics |
Default | false |
Extended Diagnostics
Show verbose diagnostic information.
Value | extendedDiagnostics |
Default | false |
Locale
The locale used when displaying messages to the user (e.g. ‘en-us’)
Value | locale |
Default | Platform specific |
Emit Declaration Only
Only emit ‘.d.ts’ declaration files.
Value | emitDeclarationOnly |
Default | false |
JSx Factory
Specify the JSX factory function to use when targeting ‘react’ JSX emit, e.g. ‘React.createElement’ or ‘h’.
Value | jsxFactory |
Default | React" |
Resolve JSon Module
Include modules imported with ‘.json’ extension
Value | resolveJsonModule |
Default | false |
Out
[Deprecated] Use ‘—outFile’ instead. Concatenate and emit output to single file
Value | out |
Status | Deprecated |
Default | n/a |
Related | outDir , outFile |
React Namespace
[Deprecated] Use ‘—jsxFactory’ instead. Specify the object invoked for createElement when targeting ‘react’ JSX emit
Value | reactNamespace |
Default | "React" |
Skip Default Lib Check
[Deprecated] Use ‘—skipLibCheck’ instead. Skip type checking of default library declaration files.
Value | skipDefaultLibCheck |
Default | false |
Charset
The character set of the input files.
Value | charset |
Default | utf8 |
Emit B O M
Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files.
Value | emitBOM |
Default | false |
New Line
Specify the end of line sequence to be used when emitting files: ‘CRLF’ (dos) or ‘LF’ (unix).
Value | newLine |
Default | Platform specific |
No Error Truncation
Do not truncate error messages.
Value | noErrorTruncation |
Default | false |
No Lib
Do not include the default library file (lib.d.ts).
Value | noLib |
Default | false |
No Resolve
Do not add triple-slash references or imported modules to the list of compiled files.
Value | noResolve |
Default | false |
Strip Internal
Do not emit declarations for code that has an ‘@internal’ annotation.
Value | stripInternal |
Disable Size Limit
Disable size limitations on JavaScript projects.
Value | disableSizeLimit |
Default | false |
No Implicit Use Strict
Do not emit ‘use strict’ directives in module output.
Value | noImplicitUseStrict |
Default | false |
No Emit Helpers
Do not generate custom helper functions like ’__extends’ in compiled output.
Value | noEmitHelpers |
Default | false |
No Emit On Error
Do not emit outputs if any errors were reported.
Value | noEmitOnError |
Default | false |
Preserve Const Enums
Do not erase const enum declarations in generated code.
Value | preserveConstEnums |
Default | false |
Declaration Dir
Output directory for generated declaration files.
Value | declarationDir |
Default | n/a |
Skip Lib Check
Skip type checking of declaration files.
Value | skipLibCheck |
Default | false |
Allow Unused Labels
Do not report errors on unused labels.
Value | allowUnusedLabels |
Default | false |
Allow Unreachable Code
Do not report errors on unreachable code.
Value | allowUnreachableCode |
Default | false |
Suppress Excess Property Errors
Suppress excess property checks for object literals.
Value | suppressExcessPropertyErrors |
Default | false |
Suppress Implicit Any Index Errors
Suppress noImplicitAny errors for indexing objects lacking index signatures.
Value | suppressImplicitAnyIndexErrors |
Default | false |
Force Consistent Casing In File Names
Disallow inconsistently-cased references to the same file.
Value | forceConsistentCasingInFileNames |
Default | false |
Max Node Module JS Depth
The maximum dependency depth to search under node_modules and load JavaScript files.
Value | maxNodeModuleJsDepth |
Default | 0 |
No Strict Generic Checks
Disable strict checking of generic signatures in function types.
Value | noStrictGenericChecks |
Default | false |
Keyof Strings Only
Resolve ‘keyof’ to string valued property names only (no numbers or symbols).
Value | keyofStringsOnly |
Default | false |
Command Line
Additional Checks Copy
Preserve Watch Output
Whether to keep outdated console output in watch mode instead of clearing the screen.
Value | preserveWatchOutput |
Default | false |
Pretty
Stylize errors and messages using color and context (experimental).
Value | pretty |
Default | true |