tsc or in a tsconfig.json file.
Language and Environment
target
Set the JavaScript language version for emitted JavaScript and include compatible library declarations.Valid values: tsconfig.json:
ES3, ES5, ES6/ES2015, ES2016, ES2017, ES2018, ES2019, ES2020, ES2021, ES2022, ES2023, ES2024, ES2025, ESNextCommand line:lib
Specify a set of bundled library declaration files that describe the target runtime environment.Common values: tsconfig.json:
ES5, ES2015, ES2016, ES2017, ES2018, ES2019, ES2020, ES2021, ES2022, ES2023, ES2024, ES2025, ESNext, DOM, DOM.Iterable, WebWorker, ScriptHostCommand line:jsx
Specify what JSX code is generated.Valid values:tsconfig.json:
preserve- Keep JSX syntax as-isreact- Emit React.createElement callsreact-jsx- Emit _jsx calls (React 17+)react-jsxdev- Emit _jsxDEV calls (development)react-native- Keep JSX but emit .js files
experimentalDecorators
Enable experimental support for legacy experimental decorators.Command line:tsconfig.json:
emitDecoratorMetadata
Emit design-type metadata for decorated declarations in source files.Command line:tsconfig.json:
jsxFactory
Specify the JSX factory function used when targeting React JSX emit.Command line:tsconfig.json:
jsxFragmentFactory
Specify the JSX Fragment reference used for fragments when targeting React JSX emit.tsconfig.json:
jsxImportSource
Specify module specifier used to import the JSX factory functions when using jsx: react-jsx.tsconfig.json:
noLib
Disable including any library files including the default lib.d.ts.Command line:
useDefineForClassFields
Emit ECMAScript-standard-compliant class fields.tsconfig.json:
moduleDetection
Control what method is used to detect module-format JS files.Valid values:
auto- Treat files with imports/exports as moduleslegacy- Only .mts/.cts are modulesforce- All files are modules
Modules
module
Specify what module code is generated.Valid values: tsconfig.json:
CommonJS, AMD, UMD, System, ES6/ES2015, ES2020, ES2022, ESNext, Node16, Node18, Node20, NodeNext, Preserve, NoneCommand line:moduleResolution
Specify how TypeScript looks up a file from a given module specifier.Valid values:tsconfig.json:
node10/node- Classic Node.js resolutionnode16- Node.js 16+ with package exportsnodenext- Latest Node.js resolutionbundler- Bundler-style resolutionclassic- TypeScript pre-1.6 (deprecated)
baseUrl
Specify the base directory to resolve non-relative module names.Command line:tsconfig.json:
paths
Specify a set of entries that re-map imports to additional lookup locations.tsconfig.json only:
rootDirs
Allow multiple folders to be treated as one when resolving modules.tsconfig.json only:
typeRoots
Specify multiple folders that act like ./node_modules/@types.Command line:tsconfig.json:
types
Specify type package names to be included without being referenced in a source file.Command line:tsconfig.json:
resolveJsonModule
Enable importing .json files.Command line:tsconfig.json:Example:
noResolve
Disallow imports, requires, or references from expanding the number of files TypeScript should add to a project.Command line:
moduleSuffixes
List of file name suffixes to search when resolving a module.tsconfig.json:
allowImportingTsExtensions
Allow imports to include TypeScript file extensions. Requires —moduleResolution bundler and either —noEmit or —emitDeclarationOnly.tsconfig.json:
rewriteRelativeImportExtensions
Rewrite .ts, .tsx, .mts, and .cts file extensions in relative import paths to their JavaScript equivalent in output files.tsconfig.json:
resolvePackageJsonExports
Use the package.json ‘exports’ field when resolving package imports.tsconfig.json:
resolvePackageJsonImports
Use the package.json ‘imports’ field when resolving imports.tsconfig.json:
customConditions
Conditions to set in addition to the resolver-specific defaults when resolving imports.tsconfig.json:
noUncheckedSideEffectImports
Check side effect imports.tsconfig.json:
Emit
declaration
Generate .d.ts files from TypeScript and JavaScript files in your project.Command line:tsconfig.json:
declarationMap
Create sourcemaps for d.ts files.Command line:tsconfig.json:
emitDeclarationOnly
Only output d.ts files and not JavaScript files.Command line:tsconfig.json:
sourceMap
Create source map files for emitted JavaScript files.Command line:tsconfig.json:
inlineSourceMap
Include sourcemap files inside the emitted JavaScript.Command line:tsconfig.json:
outFile
Specify a file that bundles all outputs into one JavaScript file.Command line:tsconfig.json:
outDir
Specify an output folder for all emitted files.Command line:tsconfig.json:
removeComments
Disable emitting comments.Command line:tsconfig.json:
noEmit
Disable emitting files from a compilation.Command line:tsconfig.json:
importHelpers
Allow importing helper functions from tslib once per project, instead of including them per-file.Command line:tsconfig.json:
downlevelIteration
Emit more compliant, but verbose and less performant JavaScript for iteration.Command line:tsconfig.json:
sourceRoot
Specify the root path for debuggers to find the reference source code.Command line:tsconfig.json:
mapRoot
Specify the location where debugger should locate map files instead of generated locations.tsconfig.json:
inlineSources
Include source code in the sourcemaps inside the emitted JavaScript.tsconfig.json:
emitBOM
Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files.tsconfig.json:
newLine
Set the newline character for emitting files.Valid values: tsconfig.json:
crlf, lfCommand line:stripInternal
Disable emitting declarations that have @internal in their JSDoc comments.tsconfig.json:
noEmitHelpers
Disable generating custom helper functions like __extends in compiled output.tsconfig.json:
noEmitOnError
Disable emitting files if any type checking errors are reported.Command line:tsconfig.json:
preserveConstEnums
Disable erasing const enum declarations in generated code.tsconfig.json:
declarationDir
Specify the output directory for generated declaration files.Command line:tsconfig.json:
Type Checking
strict
Enable all strict type-checking options.Enables:tsconfig.json:
noImplicitAnystrictNullChecksstrictFunctionTypesstrictBindCallApplystrictPropertyInitializationnoImplicitThisuseUnknownInCatchVariablesalwaysStrictstrictBuiltinIteratorReturn
noImplicitAny
Enable error reporting for expressions and declarations with an implied ‘any’ type.Command line:tsconfig.json:Example error:
strictNullChecks
When type checking, take into account null and undefined.Command line:tsconfig.json:Example error:
strictFunctionTypes
When assigning functions, check to ensure parameters and the return values are subtype-compatible.tsconfig.json:
strictBindCallApply
Check that the arguments for bind, call, and apply methods match the original function.tsconfig.json:
strictPropertyInitialization
Check for class properties that are declared but not set in the constructor.tsconfig.json:Example error:
noImplicitThis
Enable error reporting when ‘this’ is given the type ‘any’.tsconfig.json:
useUnknownInCatchVariables
Default catch clause variables as ‘unknown’ instead of ‘any’.tsconfig.json:Example:
alwaysStrict
Ensure ‘use strict’ is always emitted.Command line:tsconfig.json:
strictBuiltinIteratorReturn
Built-in iterators are instantiated with a TReturn type of undefined instead of any.tsconfig.json:
noUnusedLocals
Enable error reporting when local variables aren’t read.Command line:tsconfig.json:
noUnusedParameters
Raise an error when a function parameter isn’t read.Command line:tsconfig.json:
exactOptionalPropertyTypes
Interpret optional property types as written, rather than adding undefined.tsconfig.json:
noImplicitReturns
Enable error reporting for codepaths that do not explicitly return in a function.Command line:tsconfig.json:
noFallthroughCasesInSwitch
Enable error reporting for fallthrough cases in switch statements.Command line:tsconfig.json:
noUncheckedIndexedAccess
Add undefined to a type when accessed using an index.tsconfig.json:Example:
noImplicitOverride
Ensure overriding members in derived classes are marked with an override modifier.tsconfig.json:
noPropertyAccessFromIndexSignature
Enforces using indexed accessors for keys declared using an indexed type.tsconfig.json:
allowUnusedLabels
Disable error reporting for unused labels.tsconfig.json:
allowUnreachableCode
Disable error reporting for unreachable code.tsconfig.json:
Interop Constraints
isolatedModules
Ensure that each file can be safely transpiled without relying on other imports.Command line:tsconfig.json:
verbatimModuleSyntax
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.tsconfig.json:
isolatedDeclarations
Require sufficient annotation on exports so other tools can trivially generate declaration files.tsconfig.json:
allowSyntheticDefaultImports
Allow ‘import x from y’ when a module doesn’t have a default export.Command line:tsconfig.json:
esModuleInterop
Emit additional JavaScript to ease support for importing CommonJS modules. This enables allowSyntheticDefaultImports for type compatibility.Command line:tsconfig.json:
preserveSymlinks
Disable resolving symlinks to their realpath. This correlates to the same flag in node.tsconfig.json:
forceConsistentCasingInFileNames
Ensure that casing is correct in imports.Command line:tsconfig.json:
allowUmdGlobalAccess
Allow accessing UMD globals from modules.tsconfig.json:
JavaScript Support
allowJs
Allow JavaScript files to be a part of your program. Use the checkJs option to get errors from these files.Command line:tsconfig.json:
checkJs
Enable error reporting in type-checked JavaScript files.Command line:tsconfig.json:
maxNodeModuleJsDepth
Specify the maximum folder depth used for checking JavaScript files from node_modules. Only applicable with allowJs.tsconfig.json:
Projects
incremental
Save .tsbuildinfo files to allow for incremental compilation of projects.Command line:tsconfig.json:
composite
Enable constraints that allow a TypeScript project to be used with project references.tsconfig.json only:
tsBuildInfoFile
Specify the path to .tsbuildinfo incremental compilation file.tsconfig.json:
disableSourceOfProjectReferenceRedirect
Disable preferring source files instead of declaration files when referencing composite projects.tsconfig.json only:
disableSolutionSearching
Opt a project out of multi-project reference checking when editing.tsconfig.json only:
disableReferencedProjectLoad
Reduce the number of projects loaded automatically by TypeScript.tsconfig.json only:
Completeness
skipDefaultLibCheck
Skip type checking .d.ts files that are included with TypeScript.tsconfig.json:
skipLibCheck
Skip type checking all .d.ts files.Command line:tsconfig.json:
Editor Support
disableSizeLimit
Remove the 20mb cap on total source code size for JavaScript files in the TypeScript language server.tsconfig.json:
plugins
Specify a list of language service plugins to include.tsconfig.json only:
Watch and Build Modes
assumeChangesOnlyAffectDirectDependencies
Have recompiles in projects that use incremental and watch mode assume that changes within a file will only affect files directly depending on it.tsconfig.json:
Real-World Configuration Examples
Strict Modern TypeScript
tsconfig.json
Node.js Project
tsconfig.json
React Project
tsconfig.json
Library Project
tsconfig.json
Source Code Reference
All compiler options are defined in:- Option definitions:
src/compiler/commandLineParser.ts:637-1688 - Option parsing:
src/compiler/commandLineParser.ts:1958-2037 - Type definitions:
src/compiler/types.ts
This reference is extracted from the actual TypeScript compiler source code and reflects the current implementation.