Overview
This page provides a comprehensive reference for all TypeScript compiler options extracted from the TypeScript source code (src/compiler/commandLineParser.ts).
All compiler options are specified in the
compilerOptions section of your tsconfig.json file.Language and Environment
Options that affect the JavaScript language version and runtime environment.target
string
default:"ES3"
Set the JavaScript language version for emitted JavaScript and include compatible library declarations.Type:
"es3" | "es5" | "es2015" | "es2016" | "es2017" | "es2018" | "es2019" | "es2020" | "es2021" | "es2022" | "es2023" | "es2024" | "es2025" | "esnext"Shorthand: -tSource: src/compiler/commandLineParser.ts:572-602lib
string[]
Specify a set of bundled library declaration files that describe the target runtime environment.Common values:
es5, es2015, es2020, esnext, dom, dom.iterable, webworker, scripthostSource: src/compiler/commandLineParser.ts:704-717All available lib options
All available lib options
JavaScript versions:
es5,es6/es2015,es2016,es2017,es2018,es2019,es2020,es2021,es2022,es2023,es2024,es2025,esnext
dom,dom.iterable,dom.asynciterablewebworker,webworker.importscripts,webworker.iterable,webworker.asynciterablescripthost
es2015.promise, es2020.bigint, esnext.decorators)Source: src/compiler/commandLineParser.ts:151-265jsx
string
Specify what JSX code is generated.Type:
"preserve" | "react-native" | "react" | "react-jsx" | "react-jsxdev"Source: src/compiler/commandLineParser.ts:740-755jsxFactory
string
default:"React.createElement"
Specify the JSX factory function used when targeting React JSX emit.Source:
src/compiler/commandLineParser.ts:1336-1341jsxFragmentFactory
string
default:"React.Fragment"
Specify the JSX Fragment reference used for fragments when targeting React JSX emit.Source:
src/compiler/commandLineParser.ts:1343-1348jsxImportSource
string
default:"react"
Specify module specifier used to import the JSX factory functions when using
jsx: react-jsx*.Source: src/compiler/commandLineParser.ts:1350-1360moduleDetection
string
default:"auto"
Control what method is used to detect module-format JS files.Type:
"auto" | "legacy" | "force"Source: src/compiler/commandLineParser.ts:1671-1682experimentalDecorators
boolean
default:"false"
Enable experimental support for legacy experimental decorators.Source:
src/compiler/commandLineParser.ts:1314-1322emitDecoratorMetadata
boolean
default:"false"
Emit design-type metadata for decorated declarations in source files.Source:
src/compiler/commandLineParser.ts:1324-1332noLib
boolean
default:"false"
Disable including any library files including the default lib.d.ts.Source:
src/compiler/commandLineParser.ts:1448-1457useDefineForClassFields
boolean
default:"true for ES2022+"
Emit ECMAScript-standard-compliant class fields.Source:
src/compiler/commandLineParser.ts:1632-1640Modules
Options that affect module resolution and output.module
string
Specify what module code is generated.Type:
"none" | "commonjs" | "amd" | "system" | "umd" | "es6" | "es2015" | "es2020" | "es2022" | "esnext" | "node16" | "nodenext" | "preserve"Shorthand: -mSource: src/compiler/commandLineParser.ts:605-635moduleResolution
string
Specify how TypeScript looks up a file from a given module specifier.Type:
"node10" | "node" | "classic" | "node16" | "nodenext" | "bundler"Default: "nodenext" if module is nodenext, "node16" if module is node16, otherwise "bundler"Source: src/compiler/commandLineParser.ts:1097-1114baseUrl
string
Specify the base directory to resolve non-relative module names.Source:
src/compiler/commandLineParser.ts:1116-1122paths
object
Specify a set of entries that re-map imports to additional lookup locations.Source:
src/compiler/commandLineParser.ts:1126-1134rootDir
string
Specify the root folder within your source files.Default: Computed from the list of input filesSource:
src/compiler/commandLineParser.ts:782-792rootDirs
string[]
Allow multiple folders to be treated as one when resolving modules.Source:
src/compiler/commandLineParser.ts:1138-1152typeRoots
string[]
Specify multiple folders that act like
./node_modules/@types.Source: src/compiler/commandLineParser.ts:1154-1165types
string[]
Specify type package names to be included without being referenced in a source file.Source:
src/compiler/commandLineParser.ts:1167-1178resolveJsonModule
boolean
default:"false"
Enable importing .json files.Source:
src/compiler/commandLineParser.ts:1362-1368resolvePackageJsonExports
boolean
default:"true for node16/nodenext/bundler"
Use the package.json ‘exports’ field when resolving package imports.Source:
src/compiler/commandLineParser.ts:1247-1253resolvePackageJsonImports
boolean
default:"true for node16/nodenext/bundler"
Use the package.json ‘imports’ field when resolving imports.Source:
src/compiler/commandLineParser.ts:1255-1261customConditions
string[]
Conditions to set in addition to the resolver-specific defaults when resolving imports.Source:
src/compiler/commandLineParser.ts:1263-1272moduleSuffixes
string[]
List of file name suffixes to search when resolving a module.Source:
src/compiler/commandLineParser.ts:1216-1226allowImportingTsExtensions
boolean
default:"false"
Allow imports to include TypeScript file extensions. Requires
--moduleResolution bundler and either --noEmit or --emitDeclarationOnly.Source: src/compiler/commandLineParser.ts:1228-1236rewriteRelativeImportExtensions
boolean
default:"false"
Rewrite
.ts, .tsx, .mts, and .cts file extensions in relative import paths to their JavaScript equivalent in output files.Source: src/compiler/commandLineParser.ts:1238-1245allowArbitraryExtensions
boolean
default:"false"
Enable importing files with any extension, provided a declaration file is present.Source:
src/compiler/commandLineParser.ts:1370-1376noResolve
boolean
default:"false"
Disallow
imports, requires, or <reference>s from expanding the number of files TypeScript should add to a project.Source: src/compiler/commandLineParser.ts:1459-1468noUncheckedSideEffectImports
boolean
default:"true"
Check side effect imports.Source:
src/compiler/commandLineParser.ts:1274-1281Emit
Options that affect JavaScript emit.outFile
string
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.Source: src/compiler/commandLineParser.ts:757-768outDir
string
Specify an output folder for all emitted files.Source:
src/compiler/commandLineParser.ts:770-780declaration
boolean
default:"false (true if composite is set)"
Generate .d.ts files from TypeScript and JavaScript files in your project.Shorthand:
-dSource: src/compiler/commandLineParser.ts:477-487declarationMap
boolean
default:"false"
Create sourcemaps for d.ts files.Source:
src/compiler/commandLineParser.ts:489-497declarationDir
string
Specify the output directory for generated declaration files.Source:
src/compiler/commandLineParser.ts:1548-1558emitDeclarationOnly
boolean
default:"false"
Only output d.ts files and not JavaScript files.Source:
src/compiler/commandLineParser.ts:499-508sourceMap
boolean
default:"false"
Create source map files for emitted JavaScript files.Source:
src/compiler/commandLineParser.ts:510-518inlineSourceMap
boolean
default:"false"
Include sourcemap files inside the emitted JavaScript.Source:
src/compiler/commandLineParser.ts:520-527sourceRoot
string
Specify the root path for debuggers to find the reference source code.Source:
src/compiler/commandLineParser.ts:1285-1292mapRoot
string
Specify the location where debugger should locate map files instead of generated locations.Source:
src/compiler/commandLineParser.ts:1294-1301inlineSources
boolean
default:"false"
Include source code in the sourcemaps inside the emitted JavaScript.Source:
src/compiler/commandLineParser.ts:1303-1310removeComments
boolean
default:"false"
Disable emitting comments.Source:
src/compiler/commandLineParser.ts:817-825noEmit
boolean
default:"false"
Disable emitting files from a compilation.Source:
src/compiler/commandLineParser.ts:539-546noEmitOnError
boolean
default:"false"
Disable emitting files if any type checking errors are reported.Source:
src/compiler/commandLineParser.ts:1529-1537noEmitHelpers
boolean
default:"false"
Disable generating custom helper functions like
__extends in compiled output.Source: src/compiler/commandLineParser.ts:1520-1527importHelpers
boolean
default:"false"
Allow importing helper functions from tslib once per project, instead of including them per-file.Source:
src/compiler/commandLineParser.ts:827-835importsNotUsedAsValues
string
default:"remove"
Specify emit/checking behavior for imports that are only used for types.Type:
"remove" | "preserve" | "error"Source: src/compiler/commandLineParser.ts:837-849downlevelIteration
boolean
default:"false"
Emit more compliant, but verbose and less performant JavaScript for iteration.Source:
src/compiler/commandLineParser.ts:851-858preserveConstEnums
boolean
default:"false"
Disable erasing
const enum declarations in generated code.Source: src/compiler/commandLineParser.ts:1539-1546stripInternal
boolean
default:"false"
Disable emitting declarations that have
@internal in their JSDoc comments.Source: src/compiler/commandLineParser.ts:1470-1477newLine
string
default:"lf"
Set the newline character for emitting files.Type:
"crlf" | "lf"Source: src/compiler/commandLineParser.ts:1426-1437emitBOM
boolean
default:"false"
Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files.Source:
src/compiler/commandLineParser.ts:1417-1424Type Checking
Options that affect type checking behavior.strict
boolean
default:"true"
Enable all strict type-checking options.Source:
src/compiler/commandLineParser.ts:906-917noImplicitAny
boolean
default:"true (unless strict is false)"
Enable error reporting for expressions and declarations with an implied
any type.Source: src/compiler/commandLineParser.ts:919-927strictNullChecks
boolean
default:"true (unless strict is false)"
When type checking, take into account
null and undefined.Source: src/compiler/commandLineParser.ts:929-937strictFunctionTypes
boolean
default:"true (unless strict is false)"
When assigning functions, check to ensure parameters and the return values are subtype-compatible.Source:
src/compiler/commandLineParser.ts:939-947strictBindCallApply
boolean
default:"true (unless strict is false)"
Check that the arguments for
bind, call, and apply methods match the original function.Source: src/compiler/commandLineParser.ts:949-957strictPropertyInitialization
boolean
default:"true (unless strict is false)"
Check for class properties that are declared but not set in the constructor.Source:
src/compiler/commandLineParser.ts:959-967strictBuiltinIteratorReturn
boolean
default:"true (unless strict is false)"
Built-in iterators are instantiated with a
TReturn type of undefined instead of any.Source: src/compiler/commandLineParser.ts:969-977noImplicitThis
boolean
default:"true (unless strict is false)"
Enable error reporting when
this is given the type any.Source: src/compiler/commandLineParser.ts:989-997useUnknownInCatchVariables
boolean
default:"true (unless strict is false)"
Default catch clause variables as
unknown instead of any.Source: src/compiler/commandLineParser.ts:999-1007alwaysStrict
boolean
default:"true"
Ensure ‘use strict’ is always emitted.Source:
src/compiler/commandLineParser.ts:1009-1017noUnusedLocals
boolean
default:"false"
Enable error reporting when local variables aren’t read.Source:
src/compiler/commandLineParser.ts:1021-1028noUnusedParameters
boolean
default:"false"
Raise an error when a function parameter isn’t read.Source:
src/compiler/commandLineParser.ts:1030-1037exactOptionalPropertyTypes
boolean
default:"false"
Interpret optional property types as written, rather than adding
undefined.Source: src/compiler/commandLineParser.ts:1039-1046noImplicitReturns
boolean
default:"false"
Enable error reporting for codepaths that do not explicitly return in a function.Source:
src/compiler/commandLineParser.ts:1048-1055noFallthroughCasesInSwitch
boolean
default:"false"
Enable error reporting for fallthrough cases in switch statements.Source:
src/compiler/commandLineParser.ts:1057-1065noUncheckedIndexedAccess
boolean
default:"false"
Add
undefined to a type when accessed using an index.Source: src/compiler/commandLineParser.ts:1067-1074noImplicitOverride
boolean
default:"false"
Ensure overriding members in derived classes are marked with an override modifier.Source:
src/compiler/commandLineParser.ts:1076-1083noPropertyAccessFromIndexSignature
boolean
default:"false"
Enforces using indexed accessors for keys declared using an indexed type.Source:
src/compiler/commandLineParser.ts:1085-1093allowUnusedLabels
boolean
Disable error reporting for unused labels.Source:
src/compiler/commandLineParser.ts:1569-1577allowUnreachableCode
boolean
Disable error reporting for unreachable code.Source:
src/compiler/commandLineParser.ts:1579-1587noErrorTruncation
boolean
default:"false"
Disable truncating types in error messages.Source:
src/compiler/commandLineParser.ts:1439-1446suppressExcessPropertyErrors
boolean
default:"false"
Disable reporting of excess property errors during the creation of object literals.Source:
src/compiler/commandLineParser.ts:1589-1596suppressImplicitAnyIndexErrors
boolean
default:"false"
Suppress
noImplicitAny errors when indexing objects that lack index signatures.Source: src/compiler/commandLineParser.ts:1598-1605noStrictGenericChecks
boolean
default:"false"
Disable strict checking of generic signatures in function types.Source:
src/compiler/commandLineParser.ts:1623-1630JavaScript Support
Options for JavaScript files.allowJs
boolean
default:"false (true if checkJs is set)"
Allow JavaScript files to be a part of your program. Use the
checkJs option to get errors from these files.Source: src/compiler/commandLineParser.ts:719-727checkJs
boolean
default:"false"
Enable error reporting in type-checked JavaScript files.Source:
src/compiler/commandLineParser.ts:729-738maxNodeModuleJsDepth
number
default:"0"
Specify the maximum folder depth used for checking JavaScript files from
node_modules. Only applicable with allowJs.Source: src/compiler/commandLineParser.ts:1615-1621Interop Constraints
Options that ensure compatibility between different module systems.isolatedModules
boolean
default:"false"
Ensure that each file can be safely transpiled without relying on other imports.Source:
src/compiler/commandLineParser.ts:860-866verbatimModuleSyntax
boolean
default:"false"
Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file’s format based on the ‘module’ setting.Source:
src/compiler/commandLineParser.ts:868-876isolatedDeclarations
boolean
default:"false"
Require sufficient annotation on exports so other tools can trivially generate declaration files.Source:
src/compiler/commandLineParser.ts:878-885allowSyntheticDefaultImports
boolean
default:"true"
Allow ‘import x from y’ when a module doesn’t have a default export.Source:
src/compiler/commandLineParser.ts:1180-1187esModuleInterop
boolean
default:"true"
Emit additional JavaScript to ease support for importing CommonJS modules. This enables
allowSyntheticDefaultImports for type compatibility.Source: src/compiler/commandLineParser.ts:1189-1198preserveSymlinks
boolean
default:"false"
Disable resolving symlinks to their realpath. This correlates to the same flag in node.Source:
src/compiler/commandLineParser.ts:1200-1205forceConsistentCasingInFileNames
boolean
default:"true"
Ensure that casing is correct in imports.Source:
src/compiler/commandLineParser.ts:1607-1613allowUmdGlobalAccess
boolean
default:"false"
Allow accessing UMD globals from modules.Source:
src/compiler/commandLineParser.ts:1207-1214Projects
Options for project references and build configuration.incremental
boolean
default:"false (true if composite is set)"
Save .tsbuildinfo files to allow for incremental compilation of projects.Shorthand:
-iSource: src/compiler/commandLineParser.ts:468-475composite
boolean
default:"false"
Enable constraints that allow a TypeScript project to be used with project references.Source:
src/compiler/commandLineParser.ts:794-803tsBuildInfoFile
string
default:".tsbuildinfo"
Specify the path to .tsbuildinfo incremental compilation file.Source:
src/compiler/commandLineParser.ts:805-815disableSourceOfProjectReferenceRedirect
boolean
default:"false"
Disable preferring source files instead of declaration files when referencing composite projects.Source:
src/compiler/commandLineParser.ts:1487-1493disableSolutionSearching
boolean
default:"false"
Opt a project out of multi-project reference checking when editing.Source:
src/compiler/commandLineParser.ts:1495-1501disableReferencedProjectLoad
boolean
default:"false"
Reduce the number of projects loaded automatically by TypeScript.Source:
src/compiler/commandLineParser.ts:1503-1509Completeness
Options for improving completeness of type checking.skipLibCheck
boolean
default:"false"
Skip type checking all .d.ts files.Source:
src/compiler/commandLineParser.ts:1560-1567skipDefaultLibCheck
boolean
default:"false"
Skip type checking .d.ts files that are included with TypeScript.Source:
src/compiler/commandLineParser.ts:1401-1408Backwards Compatibility
Options for backwards compatibility with older TypeScript versions.charset
string
default:"utf8"
No longer supported. In early versions, manually set the text encoding for reading files.Source:
src/compiler/commandLineParser.ts:1410-1415keyofStringsOnly
boolean
default:"false"
Make keyof only return strings instead of string, numbers or symbols. Legacy option.Source:
src/compiler/commandLineParser.ts:1652-1657noImplicitUseStrict
boolean
default:"false"
Disable adding ‘use strict’ directives in emitted JavaScript files.Source:
src/compiler/commandLineParser.ts:1511-1518out
string
Deprecated setting. Use
outFile instead.Source: src/compiler/commandLineParser.ts:1379-1390preserveValueImports
boolean
default:"false"
Preserve unused imported values in the JavaScript output that would otherwise be removed.Source:
src/compiler/commandLineParser.ts:1642-1649Editor Support
Options for editor integration.plugins
array
Specify a list of language service plugins to include.Source:
src/compiler/commandLineParser.ts:1660-1669disableSizeLimit
boolean
default:"false"
Remove the 20mb cap on total source code size for JavaScript files in the TypeScript language server.Source:
src/compiler/commandLineParser.ts:1479-1485Output Formatting
Options that affect how output is displayed.pretty
boolean
default:"true"
Enable color and formatting in TypeScript’s output to make compiler errors easier to read.Source:
src/compiler/commandLineParser.ts:422-428preserveWatchOutput
boolean
default:"false"
Disable wiping the console in watch mode.Source:
src/compiler/commandLineParser.ts:393-399Watch and Build Modes
Options specific to watch mode and build mode.assumeChangesOnlyAffectDirectDependencies
boolean
default:"false"
Have recompiles in projects that use
incremental and watch mode assume that changes within a file will only affect files directly depending on it.Source: src/compiler/commandLineParser.ts:548-556Compiler Diagnostics
Options for debugging the compiler.listFiles
boolean
default:"false"
Print all of the files read during the compilation.Source:
src/compiler/commandLineParser.ts:401-406explainFiles
boolean
default:"false"
Print files read during the compilation including why it was included.Source:
src/compiler/commandLineParser.ts:408-413listEmittedFiles
boolean
default:"false"
Print the names of emitted files after a compilation.Source:
src/compiler/commandLineParser.ts:415-420traceResolution
boolean
default:"false"
Log paths used during the
moduleResolution process.Source: src/compiler/commandLineParser.ts:430-435diagnostics
boolean
default:"false"
Output compiler performance information after building.Source:
src/compiler/commandLineParser.ts:437-442extendedDiagnostics
boolean
default:"false"
Output more detailed compiler performance information after building.Source:
src/compiler/commandLineParser.ts:444-449generateCpuProfile
string
default:"profile.cpuprofile"
Emit a v8 CPU profile of the compiler run for debugging.Source:
src/compiler/commandLineParser.ts:451-458generateTrace
string
Generates an event trace and a list of types.Source:
src/compiler/commandLineParser.ts:460-466noCheck
boolean
default:"false"
Disable full type checking (only critical parse and emit errors will be reported).Source:
src/compiler/commandLineParser.ts:529-537Default Compiler Options
When you runtsc --init, TypeScript creates a tsconfig.json with these default options:
src/compiler/commandLineParser.ts:1858-1865
Common Configuration Patterns
Strict Mode (Recommended)
Modern Node.js
Library Development
Monorepo with Project References
Related Documentation
tsconfig.json
Learn about the complete tsconfig.json structure
Project References
Structure large TypeScript projects efficiently