Skip to main content
TypeScript compiler options control how the TypeScript compiler processes your code. These options can be specified on the command line with tsc or in a tsconfig.json file.

Language and Environment

target

target
string
default:"ES3"
Set the JavaScript language version for emitted JavaScript and include compatible library declarations.Valid values: ES3, ES5, ES6/ES2015, ES2016, ES2017, ES2018, ES2019, ES2020, ES2021, ES2022, ES2023, ES2024, ES2025, ESNextCommand line:
tsc --target ES2020
tsconfig.json:
{
  "compilerOptions": {
    "target": "ES2020"
  }
}

lib

lib
string[]
Specify a set of bundled library declaration files that describe the target runtime environment.Common values: ES5, ES2015, ES2016, ES2017, ES2018, ES2019, ES2020, ES2021, ES2022, ES2023, ES2024, ES2025, ESNext, DOM, DOM.Iterable, WebWorker, ScriptHostCommand line:
tsc --lib ES2020,DOM,DOM.Iterable
tsconfig.json:
{
  "compilerOptions": {
    "lib": ["ES2020", "DOM", "DOM.Iterable"]
  }
}

jsx

jsx
string
Specify what JSX code is generated.Valid values:
  • preserve - Keep JSX syntax as-is
  • react - Emit React.createElement calls
  • react-jsx - Emit _jsx calls (React 17+)
  • react-jsxdev - Emit _jsxDEV calls (development)
  • react-native - Keep JSX but emit .js files
Command line:
tsc --jsx react-jsx
tsconfig.json:
{
  "compilerOptions": {
    "jsx": "react-jsx"
  }
}

experimentalDecorators

experimentalDecorators
boolean
default:"false"
Enable experimental support for legacy experimental decorators.Command line:
tsc --experimentalDecorators
tsconfig.json:
{
  "compilerOptions": {
    "experimentalDecorators": true
  }
}

emitDecoratorMetadata

emitDecoratorMetadata
boolean
default:"false"
Emit design-type metadata for decorated declarations in source files.Command line:
tsc --emitDecoratorMetadata
tsconfig.json:
{
  "compilerOptions": {
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true
  }
}

jsxFactory

jsxFactory
string
default:"React.createElement"
Specify the JSX factory function used when targeting React JSX emit.Command line:
tsc --jsxFactory h
tsconfig.json:
{
  "compilerOptions": {
    "jsx": "react",
    "jsxFactory": "h"
  }
}

jsxFragmentFactory

jsxFragmentFactory
string
default:"React.Fragment"
Specify the JSX Fragment reference used for fragments when targeting React JSX emit.tsconfig.json:
{
  "compilerOptions": {
    "jsx": "react",
    "jsxFragmentFactory": "Fragment"
  }
}

jsxImportSource

jsxImportSource
string
default:"react"
Specify module specifier used to import the JSX factory functions when using jsx: react-jsx.tsconfig.json:
{
  "compilerOptions": {
    "jsx": "react-jsx",
    "jsxImportSource": "preact"
  }
}

noLib

noLib
boolean
default:"false"
Disable including any library files including the default lib.d.ts.Command line:
tsc --noLib

useDefineForClassFields

useDefineForClassFields
boolean
default:"true for ES2022+"
Emit ECMAScript-standard-compliant class fields.tsconfig.json:
{
  "compilerOptions": {
    "useDefineForClassFields": true
  }
}

moduleDetection

moduleDetection
string
default:"auto"
Control what method is used to detect module-format JS files.Valid values:
  • auto - Treat files with imports/exports as modules
  • legacy - Only .mts/.cts are modules
  • force - All files are modules
tsconfig.json:
{
  "compilerOptions": {
    "moduleDetection": "force"
  }
}

Modules

module

module
string
default:"CommonJS"
Specify what module code is generated.Valid values: CommonJS, AMD, UMD, System, ES6/ES2015, ES2020, ES2022, ESNext, Node16, Node18, Node20, NodeNext, Preserve, NoneCommand line:
tsc --module ESNext
tsconfig.json:
{
  "compilerOptions": {
    "module": "ESNext"
  }
}

moduleResolution

moduleResolution
string
default:"node10"
Specify how TypeScript looks up a file from a given module specifier.Valid values:
  • node10 / node - Classic Node.js resolution
  • node16 - Node.js 16+ with package exports
  • nodenext - Latest Node.js resolution
  • bundler - Bundler-style resolution
  • classic - TypeScript pre-1.6 (deprecated)
Command line:
tsc --moduleResolution bundler
tsconfig.json:
{
  "compilerOptions": {
    "moduleResolution": "bundler"
  }
}

baseUrl

baseUrl
string
Specify the base directory to resolve non-relative module names.Command line:
tsc --baseUrl ./src
tsconfig.json:
{
  "compilerOptions": {
    "baseUrl": "./src"
  }
}

paths

paths
object
Specify a set of entries that re-map imports to additional lookup locations.tsconfig.json only:
{
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "@/*": ["src/*"],
      "@components/*": ["src/components/*"],
      "@utils/*": ["src/utils/*"]
    }
  }
}

rootDirs

rootDirs
string[]
Allow multiple folders to be treated as one when resolving modules.tsconfig.json only:
{
  "compilerOptions": {
    "rootDirs": ["src/views", "generated/templates/views"]
  }
}

typeRoots

typeRoots
string[]
Specify multiple folders that act like ./node_modules/@types.Command line:
tsc --typeRoots ./typings,./vendor/types
tsconfig.json:
{
  "compilerOptions": {
    "typeRoots": ["./typings", "./vendor/types"]
  }
}

types

types
string[]
Specify type package names to be included without being referenced in a source file.Command line:
tsc --types node,jest
tsconfig.json:
{
  "compilerOptions": {
    "types": ["node", "jest"]
  }
}

resolveJsonModule

resolveJsonModule
boolean
default:"false"
Enable importing .json files.Command line:
tsc --resolveJsonModule
tsconfig.json:
{
  "compilerOptions": {
    "resolveJsonModule": true
  }
}
Example:
import config from './config.json';
console.log(config.version);

noResolve

noResolve
boolean
default:"false"
Disallow imports, requires, or references from expanding the number of files TypeScript should add to a project.Command line:
tsc --noResolve

moduleSuffixes

moduleSuffixes
string[]
List of file name suffixes to search when resolving a module.tsconfig.json:
{
  "compilerOptions": {
    "moduleSuffixes": [".ios", ".native", ""]
  }
}

allowImportingTsExtensions

allowImportingTsExtensions
boolean
default:"false"
Allow imports to include TypeScript file extensions. Requires —moduleResolution bundler and either —noEmit or —emitDeclarationOnly.tsconfig.json:
{
  "compilerOptions": {
    "moduleResolution": "bundler",
    "allowImportingTsExtensions": true,
    "noEmit": true
  }
}

rewriteRelativeImportExtensions

rewriteRelativeImportExtensions
boolean
default:"false"
Rewrite .ts, .tsx, .mts, and .cts file extensions in relative import paths to their JavaScript equivalent in output files.tsconfig.json:
{
  "compilerOptions": {
    "rewriteRelativeImportExtensions": true
  }
}

resolvePackageJsonExports

resolvePackageJsonExports
boolean
default:"true for node16/nodenext/bundler"
Use the package.json ‘exports’ field when resolving package imports.tsconfig.json:
{
  "compilerOptions": {
    "resolvePackageJsonExports": true
  }
}

resolvePackageJsonImports

resolvePackageJsonImports
boolean
default:"true for node16/nodenext/bundler"
Use the package.json ‘imports’ field when resolving imports.tsconfig.json:
{
  "compilerOptions": {
    "resolvePackageJsonImports": true
  }
}

customConditions

customConditions
string[]
Conditions to set in addition to the resolver-specific defaults when resolving imports.tsconfig.json:
{
  "compilerOptions": {
    "customConditions": ["development"]
  }
}

noUncheckedSideEffectImports

noUncheckedSideEffectImports
boolean
default:"true"
Check side effect imports.tsconfig.json:
{
  "compilerOptions": {
    "noUncheckedSideEffectImports": true
  }
}

Emit

declaration

declaration
boolean
default:"false"
Generate .d.ts files from TypeScript and JavaScript files in your project.Command line:
tsc --declaration
tsconfig.json:
{
  "compilerOptions": {
    "declaration": true
  }
}

declarationMap

declarationMap
boolean
default:"false"
Create sourcemaps for d.ts files.Command line:
tsc --declarationMap
tsconfig.json:
{
  "compilerOptions": {
    "declaration": true,
    "declarationMap": true
  }
}

emitDeclarationOnly

emitDeclarationOnly
boolean
default:"false"
Only output d.ts files and not JavaScript files.Command line:
tsc --emitDeclarationOnly
tsconfig.json:
{
  "compilerOptions": {
    "declaration": true,
    "emitDeclarationOnly": true
  }
}

sourceMap

sourceMap
boolean
default:"false"
Create source map files for emitted JavaScript files.Command line:
tsc --sourceMap
tsconfig.json:
{
  "compilerOptions": {
    "sourceMap": true
  }
}

inlineSourceMap

inlineSourceMap
boolean
default:"false"
Include sourcemap files inside the emitted JavaScript.Command line:
tsc --inlineSourceMap
tsconfig.json:
{
  "compilerOptions": {
    "inlineSourceMap": true
  }
}

outFile

outFile
string
Specify a file that bundles all outputs into one JavaScript file.Command line:
tsc --outFile bundle.js
tsconfig.json:
{
  "compilerOptions": {
    "module": "amd",
    "outFile": "./dist/bundle.js"
  }
}

outDir

outDir
string
Specify an output folder for all emitted files.Command line:
tsc --outDir dist
tsconfig.json:
{
  "compilerOptions": {
    "outDir": "./dist"
  }
}

removeComments

removeComments
boolean
default:"false"
Disable emitting comments.Command line:
tsc --removeComments
tsconfig.json:
{
  "compilerOptions": {
    "removeComments": true
  }
}

noEmit

noEmit
boolean
default:"false"
Disable emitting files from a compilation.Command line:
tsc --noEmit
tsconfig.json:
{
  "compilerOptions": {
    "noEmit": true
  }
}

importHelpers

importHelpers
boolean
default:"false"
Allow importing helper functions from tslib once per project, instead of including them per-file.Command line:
tsc --importHelpers
tsconfig.json:
{
  "compilerOptions": {
    "importHelpers": true
  }
}

downlevelIteration

downlevelIteration
boolean
default:"false"
Emit more compliant, but verbose and less performant JavaScript for iteration.Command line:
tsc --downlevelIteration
tsconfig.json:
{
  "compilerOptions": {
    "downlevelIteration": true
  }
}

sourceRoot

sourceRoot
string
Specify the root path for debuggers to find the reference source code.Command line:
tsc --sourceRoot https://example.com/src
tsconfig.json:
{
  "compilerOptions": {
    "sourceRoot": "https://example.com/src"
  }
}

mapRoot

mapRoot
string
Specify the location where debugger should locate map files instead of generated locations.tsconfig.json:
{
  "compilerOptions": {
    "mapRoot": "https://example.com/maps"
  }
}

inlineSources

inlineSources
boolean
default:"false"
Include source code in the sourcemaps inside the emitted JavaScript.tsconfig.json:
{
  "compilerOptions": {
    "sourceMap": true,
    "inlineSources": true
  }
}

emitBOM

emitBOM
boolean
default:"false"
Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files.tsconfig.json:
{
  "compilerOptions": {
    "emitBOM": true
  }
}

newLine

newLine
string
default:"lf"
Set the newline character for emitting files.Valid values: crlf, lfCommand line:
tsc --newLine lf
tsconfig.json:
{
  "compilerOptions": {
    "newLine": "lf"
  }
}

stripInternal

stripInternal
boolean
default:"false"
Disable emitting declarations that have @internal in their JSDoc comments.tsconfig.json:
{
  "compilerOptions": {
    "stripInternal": true
  }
}

noEmitHelpers

noEmitHelpers
boolean
default:"false"
Disable generating custom helper functions like __extends in compiled output.tsconfig.json:
{
  "compilerOptions": {
    "noEmitHelpers": true
  }
}

noEmitOnError

noEmitOnError
boolean
default:"false"
Disable emitting files if any type checking errors are reported.Command line:
tsc --noEmitOnError
tsconfig.json:
{
  "compilerOptions": {
    "noEmitOnError": true
  }
}

preserveConstEnums

preserveConstEnums
boolean
default:"false"
Disable erasing const enum declarations in generated code.tsconfig.json:
{
  "compilerOptions": {
    "preserveConstEnums": true
  }
}

declarationDir

declarationDir
string
Specify the output directory for generated declaration files.Command line:
tsc --declarationDir types
tsconfig.json:
{
  "compilerOptions": {
    "declaration": true,
    "declarationDir": "./types"
  }
}

Type Checking

strict

strict
boolean
default:"true"
Enable all strict type-checking options.Enables:
  • noImplicitAny
  • strictNullChecks
  • strictFunctionTypes
  • strictBindCallApply
  • strictPropertyInitialization
  • noImplicitThis
  • useUnknownInCatchVariables
  • alwaysStrict
  • strictBuiltinIteratorReturn
Command line:
tsc --strict
tsconfig.json:
{
  "compilerOptions": {
    "strict": true
  }
}

noImplicitAny

noImplicitAny
boolean
default:"true if strict"
Enable error reporting for expressions and declarations with an implied ‘any’ type.Command line:
tsc --noImplicitAny
tsconfig.json:
{
  "compilerOptions": {
    "noImplicitAny": true
  }
}
Example error:
// Error: Parameter 'x' implicitly has an 'any' type
function add(x, y) {
  return x + y;
}

strictNullChecks

strictNullChecks
boolean
default:"true if strict"
When type checking, take into account null and undefined.Command line:
tsc --strictNullChecks
tsconfig.json:
{
  "compilerOptions": {
    "strictNullChecks": true
  }
}
Example error:
let x: string = null; // Error: Type 'null' is not assignable to type 'string'
let y: string | null = null; // OK

strictFunctionTypes

strictFunctionTypes
boolean
default:"true if strict"
When assigning functions, check to ensure parameters and the return values are subtype-compatible.tsconfig.json:
{
  "compilerOptions": {
    "strictFunctionTypes": true
  }
}

strictBindCallApply

strictBindCallApply
boolean
default:"true if strict"
Check that the arguments for bind, call, and apply methods match the original function.tsconfig.json:
{
  "compilerOptions": {
    "strictBindCallApply": true
  }
}

strictPropertyInitialization

strictPropertyInitialization
boolean
default:"true if strict"
Check for class properties that are declared but not set in the constructor.tsconfig.json:
{
  "compilerOptions": {
    "strictPropertyInitialization": true
  }
}
Example error:
class User {
  name: string; // Error: Property 'name' has no initializer
}

noImplicitThis

noImplicitThis
boolean
default:"true if strict"
Enable error reporting when ‘this’ is given the type ‘any’.tsconfig.json:
{
  "compilerOptions": {
    "noImplicitThis": true
  }
}

useUnknownInCatchVariables

useUnknownInCatchVariables
boolean
default:"true if strict"
Default catch clause variables as ‘unknown’ instead of ‘any’.tsconfig.json:
{
  "compilerOptions": {
    "useUnknownInCatchVariables": true
  }
}
Example:
try {
  // ...
} catch (error) {
  // error is 'unknown', not 'any'
  if (error instanceof Error) {
    console.log(error.message);
  }
}

alwaysStrict

alwaysStrict
boolean
default:"true"
Ensure ‘use strict’ is always emitted.Command line:
tsc --alwaysStrict
tsconfig.json:
{
  "compilerOptions": {
    "alwaysStrict": true
  }
}

strictBuiltinIteratorReturn

strictBuiltinIteratorReturn
boolean
default:"true if strict"
Built-in iterators are instantiated with a TReturn type of undefined instead of any.tsconfig.json:
{
  "compilerOptions": {
    "strictBuiltinIteratorReturn": true
  }
}

noUnusedLocals

noUnusedLocals
boolean
default:"false"
Enable error reporting when local variables aren’t read.Command line:
tsc --noUnusedLocals
tsconfig.json:
{
  "compilerOptions": {
    "noUnusedLocals": true
  }
}

noUnusedParameters

noUnusedParameters
boolean
default:"false"
Raise an error when a function parameter isn’t read.Command line:
tsc --noUnusedParameters
tsconfig.json:
{
  "compilerOptions": {
    "noUnusedParameters": true
  }
}

exactOptionalPropertyTypes

exactOptionalPropertyTypes
boolean
default:"false"
Interpret optional property types as written, rather than adding undefined.tsconfig.json:
{
  "compilerOptions": {
    "exactOptionalPropertyTypes": true
  }
}

noImplicitReturns

noImplicitReturns
boolean
default:"false"
Enable error reporting for codepaths that do not explicitly return in a function.Command line:
tsc --noImplicitReturns
tsconfig.json:
{
  "compilerOptions": {
    "noImplicitReturns": true
  }
}

noFallthroughCasesInSwitch

noFallthroughCasesInSwitch
boolean
default:"false"
Enable error reporting for fallthrough cases in switch statements.Command line:
tsc --noFallthroughCasesInSwitch
tsconfig.json:
{
  "compilerOptions": {
    "noFallthroughCasesInSwitch": true
  }
}

noUncheckedIndexedAccess

noUncheckedIndexedAccess
boolean
default:"false"
Add undefined to a type when accessed using an index.tsconfig.json:
{
  "compilerOptions": {
    "noUncheckedIndexedAccess": true
  }
}
Example:
const arr: string[] = ['a', 'b'];
const item = arr[0]; // Type: string | undefined

noImplicitOverride

noImplicitOverride
boolean
default:"false"
Ensure overriding members in derived classes are marked with an override modifier.tsconfig.json:
{
  "compilerOptions": {
    "noImplicitOverride": true
  }
}

noPropertyAccessFromIndexSignature

noPropertyAccessFromIndexSignature
boolean
default:"false"
Enforces using indexed accessors for keys declared using an indexed type.tsconfig.json:
{
  "compilerOptions": {
    "noPropertyAccessFromIndexSignature": true
  }
}

allowUnusedLabels

allowUnusedLabels
boolean
Disable error reporting for unused labels.tsconfig.json:
{
  "compilerOptions": {
    "allowUnusedLabels": false
  }
}

allowUnreachableCode

allowUnreachableCode
boolean
Disable error reporting for unreachable code.tsconfig.json:
{
  "compilerOptions": {
    "allowUnreachableCode": false
  }
}

Interop Constraints

isolatedModules

isolatedModules
boolean
default:"false"
Ensure that each file can be safely transpiled without relying on other imports.Command line:
tsc --isolatedModules
tsconfig.json:
{
  "compilerOptions": {
    "isolatedModules": true
  }
}

verbatimModuleSyntax

verbatimModuleSyntax
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.tsconfig.json:
{
  "compilerOptions": {
    "verbatimModuleSyntax": true
  }
}

isolatedDeclarations

isolatedDeclarations
boolean
default:"false"
Require sufficient annotation on exports so other tools can trivially generate declaration files.tsconfig.json:
{
  "compilerOptions": {
    "isolatedDeclarations": true
  }
}

allowSyntheticDefaultImports

allowSyntheticDefaultImports
boolean
default:"true"
Allow ‘import x from y’ when a module doesn’t have a default export.Command line:
tsc --allowSyntheticDefaultImports
tsconfig.json:
{
  "compilerOptions": {
    "allowSyntheticDefaultImports": true
  }
}

esModuleInterop

esModuleInterop
boolean
default:"true"
Emit additional JavaScript to ease support for importing CommonJS modules. This enables allowSyntheticDefaultImports for type compatibility.Command line:
tsc --esModuleInterop
tsconfig.json:
{
  "compilerOptions": {
    "esModuleInterop": true
  }
}
Disable resolving symlinks to their realpath. This correlates to the same flag in node.tsconfig.json:
{
  "compilerOptions": {
    "preserveSymlinks": true
  }
}

forceConsistentCasingInFileNames

forceConsistentCasingInFileNames
boolean
default:"true"
Ensure that casing is correct in imports.Command line:
tsc --forceConsistentCasingInFileNames
tsconfig.json:
{
  "compilerOptions": {
    "forceConsistentCasingInFileNames": true
  }
}

allowUmdGlobalAccess

allowUmdGlobalAccess
boolean
default:"false"
Allow accessing UMD globals from modules.tsconfig.json:
{
  "compilerOptions": {
    "allowUmdGlobalAccess": true
  }
}

JavaScript Support

allowJs

allowJs
boolean
default:"false"
Allow JavaScript files to be a part of your program. Use the checkJs option to get errors from these files.Command line:
tsc --allowJs
tsconfig.json:
{
  "compilerOptions": {
    "allowJs": true
  }
}

checkJs

checkJs
boolean
default:"false"
Enable error reporting in type-checked JavaScript files.Command line:
tsc --checkJs
tsconfig.json:
{
  "compilerOptions": {
    "allowJs": true,
    "checkJs": true
  }
}

maxNodeModuleJsDepth

maxNodeModuleJsDepth
number
default:"0"
Specify the maximum folder depth used for checking JavaScript files from node_modules. Only applicable with allowJs.tsconfig.json:
{
  "compilerOptions": {
    "allowJs": true,
    "maxNodeModuleJsDepth": 2
  }
}

Projects

incremental

incremental
boolean
default:"false"
Save .tsbuildinfo files to allow for incremental compilation of projects.Command line:
tsc --incremental
tsconfig.json:
{
  "compilerOptions": {
    "incremental": true
  }
}

composite

composite
boolean
default:"false"
Enable constraints that allow a TypeScript project to be used with project references.tsconfig.json only:
{
  "compilerOptions": {
    "composite": true,
    "declaration": true
  }
}

tsBuildInfoFile

tsBuildInfoFile
string
default:".tsbuildinfo"
Specify the path to .tsbuildinfo incremental compilation file.tsconfig.json:
{
  "compilerOptions": {
    "incremental": true,
    "tsBuildInfoFile": "./.cache/tsbuildinfo"
  }
}

disableSourceOfProjectReferenceRedirect

disableSourceOfProjectReferenceRedirect
boolean
default:"false"
Disable preferring source files instead of declaration files when referencing composite projects.tsconfig.json only:
{
  "compilerOptions": {
    "disableSourceOfProjectReferenceRedirect": true
  }
}

disableSolutionSearching

disableSolutionSearching
boolean
default:"false"
Opt a project out of multi-project reference checking when editing.tsconfig.json only:
{
  "compilerOptions": {
    "disableSolutionSearching": true
  }
}

disableReferencedProjectLoad

disableReferencedProjectLoad
boolean
default:"false"
Reduce the number of projects loaded automatically by TypeScript.tsconfig.json only:
{
  "compilerOptions": {
    "disableReferencedProjectLoad": true
  }
}

Completeness

skipDefaultLibCheck

skipDefaultLibCheck
boolean
default:"false"
Skip type checking .d.ts files that are included with TypeScript.tsconfig.json:
{
  "compilerOptions": {
    "skipDefaultLibCheck": true
  }
}

skipLibCheck

skipLibCheck
boolean
default:"false"
Skip type checking all .d.ts files.Command line:
tsc --skipLibCheck
tsconfig.json:
{
  "compilerOptions": {
    "skipLibCheck": true
  }
}

Editor Support

disableSizeLimit

disableSizeLimit
boolean
default:"false"
Remove the 20mb cap on total source code size for JavaScript files in the TypeScript language server.tsconfig.json:
{
  "compilerOptions": {
    "disableSizeLimit": true
  }
}

plugins

plugins
array
Specify a list of language service plugins to include.tsconfig.json only:
{
  "compilerOptions": {
    "plugins": [
      {
        "name": "typescript-styled-plugin"
      },
      {
        "name": "typescript-plugin-css-modules"
      }
    ]
  }
}

Watch and Build Modes

assumeChangesOnlyAffectDirectDependencies

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.tsconfig.json:
{
  "compilerOptions": {
    "assumeChangesOnlyAffectDirectDependencies": true
  }
}

Real-World Configuration Examples

Strict Modern TypeScript

tsconfig.json
{
  "compilerOptions": {
    "target": "ES2022",
    "module": "ESNext",
    "lib": ["ES2022", "DOM", "DOM.Iterable"],
    "moduleResolution": "bundler",
    "strict": true,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "forceConsistentCasingInFileNames": true,
    "resolveJsonModule": true,
    "isolatedModules": true,
    "noEmit": true
  }
}

Node.js Project

tsconfig.json
{
  "compilerOptions": {
    "target": "ES2022",
    "module": "Node16",
    "lib": ["ES2022"],
    "moduleResolution": "Node16",
    "outDir": "./dist",
    "rootDir": "./src",
    "strict": true,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "declaration": true,
    "declarationMap": true,
    "sourceMap": true,
    "types": ["node"]
  }
}

React Project

tsconfig.json
{
  "compilerOptions": {
    "target": "ES2020",
    "lib": ["ES2020", "DOM", "DOM.Iterable"],
    "jsx": "react-jsx",
    "module": "ESNext",
    "moduleResolution": "bundler",
    "resolveJsonModule": true,
    "allowImportingTsExtensions": true,
    "isolatedModules": true,
    "noEmit": true,
    "strict": true,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "forceConsistentCasingInFileNames": true
  }
}

Library Project

tsconfig.json
{
  "compilerOptions": {
    "target": "ES2020",
    "module": "ESNext",
    "lib": ["ES2020"],
    "declaration": true,
    "declarationMap": true,
    "sourceMap": true,
    "outDir": "./dist",
    "rootDir": "./src",
    "strict": true,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "forceConsistentCasingInFileNames": true,
    "composite": true,
    "removeComments": true
  }
}

Source Code Reference

All compiler options are defined in:
This reference is extracted from the actual TypeScript compiler source code and reflects the current implementation.

Build docs developers (and LLMs) love