Open-Source Wikis

/

TypeScript

/

Reference

/

Configuration

microsoft/TypeScript

Configuration

tsconfig.json and jsconfig.json

The canonical TypeScript project file. Resolved by commandLineParser.ts. Top-level fields:

  • compilerOptions — typed options (see below).
  • files — explicit list of input files.
  • include / exclude — globs.
  • extends — string or string[]; inherits another config.
  • references — project references.
  • compileOnSave — Visual Studio integration.
  • typeAcquisition — ATA configuration (see systems/automatic-type-acquisition).
  • watchOptions — watcher tuning (see systems/watch-and-builder).

jsconfig.json is identical except compilerOptions.allowJs defaults to true.

CompilerOptions

The full list of compiler options is the master table optionDeclarations in commandLineParser.ts and the typed CompilerOptions interface in types.ts. The user-facing reference is the TypeScript handbook tsconfig page. Categories present in the option declaration:

  • Type Checkingstrict, noImplicitAny, strictNullChecks, strictFunctionTypes, strictBindCallApply, strictPropertyInitialization, alwaysStrict, useUnknownInCatchVariables, exactOptionalPropertyTypes, noImplicitThis, noUnusedLocals, noUnusedParameters, noImplicitReturns, noFallthroughCasesInSwitch, noUncheckedIndexedAccess, noPropertyAccessFromIndexSignature, noImplicitOverride, useDefineForClassFields.
  • Modulesmodule, moduleResolution, baseUrl, paths, rootDir, rootDirs, typeRoots, types, allowUmdGlobalAccess, moduleSuffixes, resolveJsonModule, customConditions, noResolve, allowImportingTsExtensions, verbatimModuleSyntax.
  • Emittarget, lib, noEmit, noEmitOnError, outDir, outFile, removeComments, sourceMap, inlineSources, inlineSourceMap, mapRoot, sourceRoot, declaration, declarationDir, declarationMap, emitDeclarationOnly, importHelpers, importsNotUsedAsValues, downlevelIteration, preserveConstEnums, newLine, stripInternal, noEmitHelpers.
  • JavaScript SupportallowJs, checkJs, maxNodeModuleJsDepth.
  • Editor SupportdisableSourceOfProjectReferenceRedirect, disableSolutionSearching, disableReferencedProjectLoad.
  • Interop ConstraintsisolatedModules, verbatimModuleSyntax, allowSyntheticDefaultImports, esModuleInterop, preserveSymlinks, forceConsistentCasingInFileNames, isolatedDeclarations.
  • Backwards CompatibilitynoStrictGenericChecks, suppressExcessPropertyErrors, suppressImplicitAnyIndexErrors, noImplicitUseStrict.
  • Language and EnvironmentexperimentalDecorators, emitDecoratorMetadata, jsx, jsxFactory, jsxFragmentFactory, jsxImportSource, useDefineForClassFields, reactNamespace.
  • Compiler Diagnosticsdiagnostics, extendedDiagnostics, generateCpuProfile, generateTrace, listEmittedFiles, listFiles, traceResolution, explainFiles.
  • Projectsincremental, composite, tsBuildInfoFile.
  • Output Formattingpretty, noErrorTruncation, preserveWatchOutput.
  • CompletenessskipLibCheck, skipDefaultLibCheck.

Library declaration files

src/lib/ contains the auto-included declaration files. The set selected per project is governed by --lib, --target, and --noLib. The master mapping lives in src/lib/libs.json:

  • lib.es5.d.ts, lib.es2015.*.d.ts, …, lib.es2025.*.d.ts, lib.esnext.*.d.ts — ECMAScript edition.
  • lib.dom.d.ts, lib.dom.iterable.d.ts, lib.dom.asynciterable.d.ts — browser DOM.
  • lib.webworker.d.ts and friends — WebWorker globals.
  • lib.scripthost.d.ts — Windows Scripting Host (legacy).
  • lib.decorators.d.ts, lib.decorators.legacy.d.ts — decorator types.
  • lib.es*.full.d.ts — bundle entries that include the DOM lib (e.g., --lib es2020).

Two of these — dom.generated.d.ts and webworker.generated.d.ts — are auto-generated upstream at microsoft/TSJS-lib-generator. Don't edit them in this repo.

Comment directives

  • // @ts-check, // @ts-nocheck — file-level toggles.
  • // @ts-ignore, // @ts-expect-error — line-level suppression.
  • /// <reference path="..." /> — include another file.
  • /// <reference types="..." /> — include a type-reference directive.
  • /// <reference lib="..." /> — include a lib.*.d.ts.
  • /// <amd-module name="..." /> — used by --module amd.
  • /// <amd-dependency path="..." name="..." /> — UMD dependency.
  • /* @jsx ... */, /* @jsxFrag ... */, /* @jsxRuntime classic */, /* @jsxImportSource react */ — per-file JSX overrides.

package.json interaction

In node16/nodenext modes, package.json#type controls whether .js files are CJS or ESM by default. .cts is always CJS; .mts is always ESM. package.json#exports and package.json#imports shape resolution.

Environment variables

tsserver recognises:

  • TSS_LOG — log file/level/console settings.
  • TSS_REMOTE_PROJECT_LOG — remote project logging.
  • TSDK — language-service plugin directory.

tsc reads:

  • NO_COLOR, FORCE_COLOR — disable/force ANSI colours.
  • NODE_ENV=development — enables source-map support in tsc.
  • TSS_DEBUG, TS_NODE_DEBUG — verbose internal logging.

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

Configuration – TypeScript wiki | Factory