{"componentChunkName":"component---src-templates-tsconfig-reference-tsx","path":"/tsconfig","result":{"data":{"allSitePage":{"nodes":[{"path":"/dev-404-page/"},{"path":"/docs/handbook/advanced-types.html"},{"path":"/docs/handbook/basic-types.html"},{"path":"/docs/handbook/classes.html"},{"path":"/docs/handbook/compiler-options-in-msbuild.html"},{"path":"/docs/handbook/compiler-options.html"},{"path":"/docs/handbook/configuring-watch.html"},{"path":"/docs/handbook/declaration-merging.html"},{"path":"/docs/handbook/decorators.html"},{"path":"/docs/handbook/enums.html"},{"path":"/docs/handbook/functions.html"},{"path":"/docs/handbook/generics.html"},{"path":"/docs/handbook/integrating-with-build-tools.html"},{"path":"/docs/handbook/interfaces.html"},{"path":"/docs/handbook/iterators-and-generators.html"},{"path":"/docs/handbook/jsdoc-supported-types.html"},{"path":"/docs/handbook/jsx.html"},{"path":"/docs/handbook/literal-types.html"},{"path":"/docs/handbook/mixins.html"},{"path":"/docs/handbook/module-resolution.html"},{"path":"/docs/handbook/modules.html"},{"path":"/docs/handbook/namespaces-and-modules.html"},{"path":"/docs/handbook/namespaces.html"},{"path":"/docs/handbook/nightly-builds.html"},{"path":"/docs/handbook/project-references.html"},{"path":"/docs/handbook/symbols.html"},{"path":"/docs/handbook/"},{"path":"/docs/handbook/triple-slash-directives.html"},{"path":"/docs/handbook/type-checking-javascript-files.html"},{"path":"/docs/handbook/type-compatibility.html"},{"path":"/docs/handbook/type-inference.html"},{"path":"/docs/handbook/unions-and-intersections.html"},{"path":"/docs/handbook/utility-types.html"},{"path":"/docs/handbook/variable-declarations.html"},{"path":"/docs/handbook/writing-declaration-files.html"},{"path":"/docs/handbook/declaration-files/by-example.html"},{"path":"/docs/handbook/declaration-files/consumption.html"},{"path":"/docs/handbook/declaration-files/deep-dive.html"},{"path":"/docs/handbook/declaration-files/do-s-and-don-ts.html"},{"path":"/docs/handbook/declaration-files/introduction.html"},{"path":"/docs/handbook/declaration-files/library-structures.html"},{"path":"/docs/handbook/declaration-files/publishing.html"},{"path":"/docs/handbook/declaration-files/templates.html"},{"path":"/docs/handbook/release-notes/typescript-1-1.html"},{"path":"/docs/handbook/release-notes/typescript-1-3.html"},{"path":"/docs/handbook/release-notes/typescript-1-4.html"},{"path":"/docs/handbook/release-notes/typescript-1-5.html"},{"path":"/docs/handbook/release-notes/typescript-1-6.html"},{"path":"/docs/handbook/release-notes/typescript-1-7.html"},{"path":"/docs/handbook/release-notes/typescript-1-8.html"},{"path":"/docs/handbook/release-notes/typescript-2-0.html"},{"path":"/docs/handbook/release-notes/typescript-2-2.html"},{"path":"/docs/handbook/release-notes/typescript-2-1.html"},{"path":"/docs/handbook/release-notes/typescript-2-3.html"},{"path":"/docs/handbook/release-notes/typescript-2-4.html"},{"path":"/docs/handbook/release-notes/typescript-2-5.html"},{"path":"/docs/handbook/release-notes/typescript-2-6.html"},{"path":"/docs/handbook/release-notes/typescript-2-7.html"},{"path":"/docs/handbook/release-notes/typescript-2-8.html"},{"path":"/docs/handbook/release-notes/typescript-2-9.html"},{"path":"/docs/handbook/release-notes/typescript-3-0.html"},{"path":"/docs/handbook/release-notes/typescript-3-1.html"},{"path":"/docs/handbook/release-notes/typescript-3-2.html"},{"path":"/docs/handbook/release-notes/typescript-3-3.html"},{"path":"/docs/handbook/release-notes/typescript-3-4.html"},{"path":"/docs/handbook/release-notes/typescript-3-5.html"},{"path":"/docs/handbook/release-notes/typescript-3-6.html"},{"path":"/docs/handbook/release-notes/typescript-3-7.html"},{"path":"/docs/handbook/release-notes/typescript-3-8.html"},{"path":"/docs/handbook/asp-net-core.html"},{"path":"/docs/handbook/angular.html"},{"path":"/docs/handbook/dom-manipulation.html"},{"path":"/docs/handbook/gulp.html"},{"path":"/docs/handbook/migrating-from-javascript.html"},{"path":"/docs/handbook/react-&-webpack.html"},{"path":"/docs/handbook/react.html"},{"path":"/docs/handbook/typescript-in-5-minutes-func.html"},{"path":"/docs/handbook/typescript-in-5-minutes.html"},{"path":"/docs/handbook/typescript-in-5-minutes-oop.html"},{"path":"/docs/handbook/typescript-from-scratch.html"},{"path":"/docs/handbook/typescript-tooling-in-5-minutes.html"},{"path":"/docs/handbook/tsconfig-json.html"},{"path":"/docs/handbook/declaration-files/templates/global-modifying-module-d-ts.html"},{"path":"/docs/handbook/declaration-files/templates/global-plugin-d-ts.html"},{"path":"/docs/handbook/declaration-files/templates/global-d-ts.html"},{"path":"/docs/handbook/declaration-files/templates/module-class-d-ts.html"},{"path":"/docs/handbook/declaration-files/templates/module-function-d-ts.html"},{"path":"/docs/handbook/declaration-files/templates/module-plugin-d-ts.html"},{"path":"/docs/handbook/declaration-files/templates/module-d-ts.html"},{"path":"/docs/handbook/release-notes/overview.html"},{"path":"/tsconfig"},{"path":"/en/tsconfig"},{"path":"/ja/tsconfig"},{"path":"/vo/tsconfig"},{"path":"/play"},{"path":"/en/play"},{"path":"/es/play"},{"path":"/vo/play"},{"path":"/zh/play"},{"path":"/ja/play"},{"path":"/play/3-7/fixits/big-number-literals.ts"},{"path":"/play/3-7/fixits/const-to-let.ts"},{"path":"/play/3-7/fixits/infer-from-usage-changes.ts"},{"path":"/play/3-7/syntax-and-messaging/flattened-error-reporting.ts"},{"path":"/play/3-7/syntax-and-messaging/nullish-coalescing.ts"},{"path":"/play/3-7/syntax-and-messaging/optional-chaining.ts"},{"path":"/play/3-7/types-and-code-flow/assertion-functions.ts"},{"path":"/play/3-7/types-and-code-flow/recursive-type-references.ts"},{"path":"/play/3-7/types-and-code-flow/uncalled-function-checks.ts"},{"path":"/play/3-8/breaking-changes/checking-unions-with-index-signatures.ts"},{"path":"/play/3-8/jsdoc-improvements/accessibility-modifiers.js"},{"path":"/play/3-8/syntax-and-messaging/export-modules-from.ts"},{"path":"/play/3-8/syntax-and-messaging/private-class-fields.ts"},{"path":"/play/javascript/external-apis/typescript-with-deno.ts"},{"path":"/play/javascript/external-apis/typescript-with-node.js"},{"path":"/play/javascript/external-apis/typescript-with-web.js"},{"path":"/play/javascript/external-apis/typescript-with-webgl.js"},{"path":"/play/javascript/functions-with-javascript/function-chaining.ts"},{"path":"/play/javascript/functions-with-javascript/generic-functions.ts"},{"path":"/play/javascript/functions-with-javascript/typing-functions.ts"},{"path":"/play/javascript/helping-with-javascript/errors.ts"},{"path":"/play/javascript/helping-with-javascript/quick-fixes.ts"},{"path":"/play/javascript/javascript-essentials/code-flow.ts"},{"path":"/play/javascript/javascript-essentials/functions.ts"},{"path":"/play/javascript/javascript-essentials/hello-world.ts"},{"path":"/play/javascript/javascript-essentials/objects-and-arrays.ts"},{"path":"/play/javascript/modern-javascript/async-await.ts"},{"path":"/play/javascript/modern-javascript/immutability.ts"},{"path":"/play/javascript/modern-javascript/import-export.ts"},{"path":"/play/javascript/modern-javascript/jsdoc-support.js"},{"path":"/play/javascript/working-with-classes/classes-101.ts"},{"path":"/play/javascript/working-with-classes/generic-classes.ts"},{"path":"/play/javascript/working-with-classes/mixins.ts"},{"path":"/play/javascript/working-with-classes/this.ts"},{"path":"/play/playground/config/javascript-playgrounds.js"},{"path":"/play/playground/config/new-compiler-defaults.ts"},{"path":"/play/playground/language/automatic-type-acquisition.ts"},{"path":"/play/playground/language/fixits.ts"},{"path":"/play/playground/tooling/mobile-support.ts"},{"path":"/play/playground/tooling/sharable-urls.ts"},{"path":"/play/playground/tooling/typescript-versions.ts"},{"path":"/play/typescript/language/soundness.ts"},{"path":"/play/typescript/language/structural-typing.ts"},{"path":"/play/typescript/language/type-guards.ts"},{"path":"/play/typescript/language/type-widening-and-narrowing.ts"},{"path":"/play/typescript/language-extensions/enums.ts"},{"path":"/play/typescript/language-extensions/nominal-typing.ts"},{"path":"/play/typescript/language-extensions/types-vs-interfaces.ts"},{"path":"/play/typescript/meta-types/conditional-types.ts"},{"path":"/play/typescript/meta-types/discriminate-types.ts"},{"path":"/play/typescript/meta-types/indexed-types.ts"},{"path":"/play/typescript/meta-types/mapped-types.ts"},{"path":"/play/typescript/primitives/any.ts"},{"path":"/play/typescript/primitives/literals.ts"},{"path":"/play/typescript/primitives/union-and-intersection-types.ts"},{"path":"/play/typescript/primitives/unknown-and-never.ts"},{"path":"/play/typescript/type-primitives/built-in-utility-types.ts"},{"path":"/play/typescript/type-primitives/nullable-types.ts"},{"path":"/play/typescript/type-primitives/tuples.ts"},{"path":"/es/play/javascript/external-apis/typescript-with-deno.ts"},{"path":"/es/play/javascript/external-apis/typescript-with-node.js"},{"path":"/es/play/javascript/external-apis/typescript-with-web.js"},{"path":"/es/play/javascript/functions-with-javascript/function-chaining.ts"},{"path":"/es/play/javascript/functions-with-javascript/generic-functions.ts"},{"path":"/es/play/javascript/javascript-essentials/hello-world.ts"},{"path":"/es/play/javascript/javascript-essentials/objects-and-arrays.ts"},{"path":"/es/play/typescript/type-primitives/built-in-utility-types.ts"},{"path":"/es/play/typescript/type-primitives/nullable-types.ts"},{"path":"/es/play/typescript/type-primitives/tuples.ts"},{"path":"/ja/play/typescript/language-extensions/enums.ts"},{"path":"/ja/play/typescript/language-extensions/nominal-typing.ts"},{"path":"/ja/play/typescript/language-extensions/types-vs-interfaces.ts"},{"path":"/ja/play/typescript/primitives/any.ts"},{"path":"/ja/play/typescript/primitives/literals.ts"},{"path":"/ja/play/typescript/primitives/union-and-intersection-types.ts"},{"path":"/ja/play/typescript/type-primitives/built-in-utility-types.ts"},{"path":"/vo/play/javascript/javascript-essentials/code-flow.ts"},{"path":"/vo/play/javascript/javascript-essentials/functions.ts"},{"path":"/vo/play/javascript/javascript-essentials/hello-world.ts"},{"path":"/vo/play/javascript/javascript-essentials/objects-and-arrays.ts"},{"path":"/zh/play/javascript/external-apis/typescript-with-deno.ts"},{"path":"/zh/play/javascript/external-apis/typescript-with-node.js"},{"path":"/zh/play/javascript/external-apis/typescript-with-web.js"},{"path":"/zh/play/javascript/external-apis/typescript-with-webgl.js"},{"path":"/zh/play/javascript/functions-with-javascript/function-chaining.ts"},{"path":"/zh/play/javascript/functions-with-javascript/generic-functions.ts"},{"path":"/zh/play/javascript/functions-with-javascript/typing-functions.ts"},{"path":"/zh/play/javascript/helping-with-javascript/errors.ts"},{"path":"/zh/play/javascript/helping-with-javascript/quick-fixes.ts"},{"path":"/zh/play/javascript/javascript-essentials/code-flow.ts"},{"path":"/zh/play/javascript/javascript-essentials/functions.ts"},{"path":"/zh/play/javascript/javascript-essentials/hello-world.ts"},{"path":"/zh/play/javascript/modern-javascript/import-export.ts"},{"path":"/zh/play/javascript/modern-javascript/jsdoc-support.js"},{"path":"/zh/play/javascript/working-with-classes/classes-101.ts"},{"path":"/zh/play/javascript/working-with-classes/generic-classes.ts"},{"path":"/zh/play/javascript/working-with-classes/mixins.ts"},{"path":"/zh/play/javascript/working-with-classes/this.ts"},{"path":"/zh/play/playground/config/javascript-playgrounds.js"},{"path":"/zh/play/playground/config/new-compiler-defaults.ts"},{"path":"/zh/play/playground/language/automatic-type-acquisition.ts"},{"path":"/zh/play/playground/language/fixits.ts"},{"path":"/zh/play/playground/tooling/mobile-support.ts"},{"path":"/zh/play/playground/tooling/sharable-urls.ts"},{"path":"/zh/play/playground/tooling/typescript-versions.ts"},{"path":"/zh/play/typescript/language/soundness.ts"},{"path":"/zh/play/typescript/language/structural-typing.ts"},{"path":"/zh/play/typescript/language/type-guards.ts"},{"path":"/zh/play/typescript/language/type-widening-and-narrowing.ts"},{"path":"/zh/play/typescript/language-extensions/enums.ts"},{"path":"/zh/play/typescript/language-extensions/nominal-typing.ts"},{"path":"/zh/play/typescript/language-extensions/types-vs-interfaces.ts"},{"path":"/zh/play/typescript/meta-types/conditional-types.ts"},{"path":"/zh/play/typescript/meta-types/discriminate-types.ts"},{"path":"/zh/play/typescript/meta-types/indexed-types.ts"},{"path":"/zh/play/typescript/meta-types/mapped-types.ts"},{"path":"/zh/play/typescript/primitives/any.ts"},{"path":"/zh/play/typescript/primitives/literals.ts"},{"path":"/zh/play/typescript/primitives/union-and-intersection-types.ts"},{"path":"/zh/play/typescript/primitives/unknown-and-never.ts"},{"path":"/zh/play/typescript/type-primitives/built-in-utility-types.ts"},{"path":"/zh/play/typescript/type-primitives/nullable-types.ts"},{"path":"/zh/play/typescript/type-primitives/tuples.ts"},{"path":"/zh/play/javascript/modern-javascript/immutability.ts"},{"path":"/zh/play/javascript/modern-javascript/async-await.ts"},{"path":"/zh/play/javascript/javascript-essentials/objects-and-arrays.ts"},{"path":"/community"},{"path":"/es/community"},{"path":"/ja/community"},{"path":"/vo/community"},{"path":"/zh/community"},{"path":"/download"},{"path":"/es/download"},{"path":"/ja/download"},{"path":"/vo/download"},{"path":"/zh/download"},{"path":"/empty"},{"path":"/es/empty"},{"path":"/ja/empty"},{"path":"/vo/empty"},{"path":"/zh/empty"},{"path":"/"},{"path":"/es/"},{"path":"/ja/"},{"path":"/vo/"},{"path":"/zh/"},{"path":"/tools"},{"path":"/es/tools"},{"path":"/ja/tools"},{"path":"/vo/tools"},{"path":"/zh/tools"},{"path":"/why-create-typescript"},{"path":"/es/why-create-typescript"},{"path":"/ja/why-create-typescript"},{"path":"/vo/why-create-typescript"},{"path":"/zh/why-create-typescript"},{"path":"/docs/home"},{"path":"/es/docs/home"},{"path":"/ja/docs/home"},{"path":"/vo/docs/home"},{"path":"/zh/docs/home"},{"path":"/dev/playground-plugins/"},{"path":"/dev/sandbox/"},{"path":"/dev/twoslash/"},{"path":"/dev/typescript-vfs/"}]},"sitePage":{"id":"SitePage /tsconfig","fields":{"categories":{"categories":[{"display":"File Inclusion","anchor":"Project_Files_0","options":[{"anchor":"files"},{"anchor":"include"},{"anchor":"exclude"},{"anchor":"extends"},{"anchor":"typeAcquisition"},{"anchor":"references"}]},{"display":"Project Options","anchor":"Basic_Options_6172","options":[{"anchor":"incremental"},{"anchor":"target"},{"anchor":"module"},{"anchor":"lib"},{"anchor":"allowJs"},{"anchor":"checkJs"},{"anchor":"jsx"},{"anchor":"declaration"},{"anchor":"declarationMap"},{"anchor":"sourceMap"},{"anchor":"outFile"},{"anchor":"outDir"},{"anchor":"rootDir"},{"anchor":"composite"},{"anchor":"tsBuildInfoFile"},{"anchor":"removeComments"},{"anchor":"noEmit"},{"anchor":"importHelpers"},{"anchor":"downlevelIteration"},{"anchor":"isolatedModules"}]},{"display":"Strict Checks","anchor":"Strict_Type_Checking_Options_6173","options":[{"anchor":"strict"},{"anchor":"noImplicitAny"},{"anchor":"strictNullChecks"},{"anchor":"strictFunctionTypes"},{"anchor":"strictBindCallApply"},{"anchor":"strictPropertyInitialization"},{"anchor":"noImplicitThis"},{"anchor":"alwaysStrict"}]},{"display":"Module Resolution","anchor":"Module_Resolution_Options_6174","options":[{"anchor":"moduleResolution"},{"anchor":"baseUrl"},{"anchor":"paths"},{"anchor":"rootDirs"},{"anchor":"typeRoots"},{"anchor":"types"},{"anchor":"allowSyntheticDefaultImports"},{"anchor":"esModuleInterop"},{"anchor":"preserveSymlinks"},{"anchor":"allowUmdGlobalAccess"}]},{"display":"Source Maps","anchor":"Source_Map_Options_6175","options":[{"anchor":"sourceRoot"},{"anchor":"mapRoot"},{"anchor":"inlineSourceMap"},{"anchor":"inlineSources"}]},{"display":"Linter Checks","anchor":"Additional_Checks_6176","options":[{"anchor":"noUnusedLocals"},{"anchor":"noUnusedParameters"},{"anchor":"noImplicitReturns"},{"anchor":"noFallthroughCasesInSwitch"}]},{"display":"Experimental","anchor":"Experimental_Options_6177","options":[{"anchor":"experimentalDecorators"},{"anchor":"emitDecoratorMetadata"}]},{"display":"Advanced","anchor":"Advanced_Options_6178","options":[{"anchor":"importHelpers"},{"anchor":"listFiles"},{"anchor":"listEmittedFiles"},{"anchor":"traceResolution"},{"anchor":"diagnostics"},{"anchor":"extendedDiagnostics"},{"anchor":"generateCpuProfile"},{"anchor":"assumeChangesOnlyAffectDirectDependencies"},{"anchor":"emitDeclarationOnly"},{"anchor":"importsNotUsedAsValues"},{"anchor":"jsxFactory"},{"anchor":"resolveJsonModule"},{"anchor":"out"},{"anchor":"reactNamespace"},{"anchor":"skipDefaultLibCheck"},{"anchor":"charset"},{"anchor":"emitBOM"},{"anchor":"newLine"},{"anchor":"noErrorTruncation"},{"anchor":"noLib"},{"anchor":"noResolve"},{"anchor":"stripInternal"},{"anchor":"disableSizeLimit"},{"anchor":"disableSourceOfProjectReferenceRedirect"},{"anchor":"disableSolutionSearching"},{"anchor":"noImplicitUseStrict"},{"anchor":"noEmitHelpers"},{"anchor":"noEmitOnError"},{"anchor":"preserveConstEnums"},{"anchor":"declarationDir"},{"anchor":"skipLibCheck"},{"anchor":"allowUnusedLabels"},{"anchor":"allowUnreachableCode"},{"anchor":"suppressExcessPropertyErrors"},{"anchor":"suppressImplicitAnyIndexErrors"},{"anchor":"forceConsistentCasingInFileNames"},{"anchor":"maxNodeModuleJsDepth"},{"anchor":"noStrictGenericChecks"},{"anchor":"useDefineForClassFields"},{"anchor":"keyofStringsOnly"}]},{"display":"Command Line","anchor":"Command_line_Options_6171","options":[{"anchor":"preserveWatchOutput"},{"anchor":"pretty"}]}]}}},"markdownRemark":{"id":"d6a1bc71-ffad-54a1-a8a0-59a7d3fe55eb","html":"<div class='category'>\n<h2 id='Project_Files_0'><a href='#Project_Files_0' name='Project_Files_0'>#</a> File Inclusion</h2>\n<p>These settings help you ensure that TypeScript picks up the right files.</p>\n</div>\n<section class='compiler-option'>\n<h3 id='files'><a aria-label=\"Link to the compiler option:files\" title=\"Link to the compiler option:files\" href='#files' name='files'>#</a> Files - <code>files</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>Specifies an allowlist of files to include in the program. An error occurs if any of the files can’t be found.</p>\n<pre class=\"shiki\"><div class=\"language-id\">json</div><div class='code-container'><code><span style=\"color: #000000\">{</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0451A5\">\"compilerOptions\"</span><span style=\"color: #000000\">: {},</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0451A5\">\"files\"</span><span style=\"color: #000000\">: [</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #A31515\">\"core.ts\"</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #A31515\">\"sys.ts\"</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #A31515\">\"types.ts\"</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #A31515\">\"scanner.ts\"</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #A31515\">\"parser.ts\"</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #A31515\">\"utilities.ts\"</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #A31515\">\"binder.ts\"</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #A31515\">\"checker.ts\"</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #A31515\">\"tsc.ts\"</span>\n<span style=\"color: #000000\">  ]</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n<p>This is useful when you only have a small number of files and don’t need to use a glob to reference many files.\nIf you need that then use <a href=\"#include\"><code>include</code></a>.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>files</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='include'><a aria-label=\"Link to the compiler option:include\" title=\"Link to the compiler option:include\" href='#include' name='include'>#</a> Include - <code>include</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>Specifies an array of filenames or patterns to include in the program.\nThese filenames are resolved relative to the directory containing the <code>tsconfig.json</code> file.</p>\n<pre class=\"shiki\"><div class=\"language-id\">json</div><div class='code-container'><code><span style=\"color: #000000\">{</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0451A5\">\"include\"</span><span style=\"color: #000000\">: [</span><span style=\"color: #A31515\">\"src/**/*\"</span><span style=\"color: #000000\">, </span><span style=\"color: #A31515\">\"tests/**/*\"</span><span style=\"color: #000000\">]</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n<p>Which would include:</p>\n<!-- TODO: #135\n```diff\n  .\n- ├── scripts\n- │   ├── lint.ts\n- │   ├── update_deps.ts\n- │   └── utils.ts\n+ ├── src\n+ │   ├── client\n+ │   │    ├── index.ts\n+ │   │    └── utils.ts\n+ │   ├── server\n+ │   │    └── index.ts\n+ ├── tests\n+ │   ├── app.test.ts\n+ │   ├── utils.ts\n+ │   └── tests.d.ts\n- ├── package.json\n- ├── tsconfig.json\n- └── yarn.lock\n``` -->\n<pre><code>.\n├── scripts                ⨯\n│   ├── lint.ts            ⨯\n│   ├── update_deps.ts     ⨯\n│   └── utils.ts           ⨯\n├── src                    ✓\n│   ├── client             ✓\n│   │    ├── index.ts      ✓\n│   │    └── utils.ts      ✓\n│   ├── server             ✓\n│   │    └── index.ts      ✓\n├── tests                  ✓\n│   ├── app.test.ts        ✓\n│   ├── utils.ts           ✓\n│   └── tests.d.ts         ✓\n├── package.json\n├── tsconfig.json\n└── yarn.lock\n</code></pre>\n<p><code>include</code> and <code>exclude</code> support wildcard characters to make glob patterns:</p>\n<ul>\n<li><code>*</code> matches zero or more characters (excluding directory separators)</li>\n<li><code>?</code> matches any one character (excluding directory separators)</li>\n<li><code>**/</code> matches any directory nested to any level</li>\n</ul>\n<p>If a glob pattern doesn’t include a file extension, then only files with supported extensions are included (e.g. <code>.ts</code>, <code>.tsx</code>, and <code>.d.ts</code> by default, with <code>.js</code> and <code>.jsx</code> if <code>allowJs</code> is set to true).</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>include</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='exclude'><a aria-label=\"Link to the compiler option:exclude\" title=\"Link to the compiler option:exclude\" href='#exclude' name='exclude'>#</a> Exclude - <code>exclude</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>Specifies an array of filenames or patterns that should be skipped when resolving <code>include</code>.</p>\n<p><strong>Important</strong>: <code>exclude</code> <em>only</em> changes which files are included as a result of the <code>include</code> setting.\nA file specified by <code>exclude</code> can still become part of your codebase due to an <code>import</code> statement in your code, a <code>types</code> inclusion, a <code>/// &#x3C;reference</code> directive, or being specified in the <code>files</code> list.</p>\n<p>It is not a mechanism that <strong>prevents</strong> a file from being included in the codebase - it simply changes what the <code>include</code> setting finds.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>exclude</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='extends'><a aria-label=\"Link to the compiler option:extends\" title=\"Link to the compiler option:extends\" href='#extends' name='extends'>#</a> Extends - <code>extends</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>The value of <code>extends</code> is a string which contains a path to another configuration file to inherit from.\nThe path may use Node.js style resolution.</p>\n<p>The configuration from the base file are loaded first, then overridden by those in the inheriting config file. All relative paths found in the configuration file will be resolved relative to the configuration file they originated in.</p>\n<p>It’s worth noting that <code>files</code>, <code>include</code> and <code>exclude</code> from the inheriting config file <em>overwrite</em> those from the\nbase config file, and that circularity between configuration files is not allowed.</p>\n<h5 id=\"example\" style=\"position:relative;\"><a href=\"#example\" aria-label=\"example permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Example</h5>\n<p><code>configs/base.json</code>:</p>\n<pre class=\"shiki\"><div class=\"language-id\">json</div><div class='code-container'><code><span style=\"color: #000000\">{</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0451A5\">\"compilerOptions\"</span><span style=\"color: #000000\">: {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0451A5\">\"noImplicitAny\"</span><span style=\"color: #000000\">: </span><span style=\"color: #0000FF\">true</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0451A5\">\"strictNullChecks\"</span><span style=\"color: #000000\">: </span><span style=\"color: #0000FF\">true</span>\n<span style=\"color: #000000\">  }</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n<p><code>tsconfig.json</code>:</p>\n<pre class=\"shiki\"><div class=\"language-id\">json</div><div class='code-container'><code><span style=\"color: #000000\">{</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0451A5\">\"extends\"</span><span style=\"color: #000000\">: </span><span style=\"color: #A31515\">\"./configs/base\"</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0451A5\">\"files\"</span><span style=\"color: #000000\">: [</span><span style=\"color: #A31515\">\"main.ts\"</span><span style=\"color: #000000\">, </span><span style=\"color: #A31515\">\"supplemental.ts\"</span><span style=\"color: #000000\">]</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n<p><code>tsconfig.nostrictnull.json</code>:</p>\n<pre class=\"shiki\"><div class=\"language-id\">json</div><div class='code-container'><code><span style=\"color: #000000\">{</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0451A5\">\"extends\"</span><span style=\"color: #000000\">: </span><span style=\"color: #A31515\">\"./tsconfig\"</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0451A5\">\"compilerOptions\"</span><span style=\"color: #000000\">: {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0451A5\">\"strictNullChecks\"</span><span style=\"color: #000000\">: </span><span style=\"color: #0000FF\">false</span>\n<span style=\"color: #000000\">  }</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>extends</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='typeAcquisition'><a aria-label=\"Link to the compiler option:typeAcquisition\" title=\"Link to the compiler option:typeAcquisition\" href='#typeAcquisition' name='typeAcquisition'>#</a> Type Acquisition - <code>typeAcquisition</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>When you have a JavaScript project in your editor, TypeScript will provide types for your <code>node_modules</code> automatically using the DefinitelyTyped set of <code>@types</code> definitions.\nThis is called automatic type acquisition, and you can customize it using the <code>typeAcquisition</code> object in your configuration.</p>\n<p>If you would like to disable or customize this feature, create a <code>jsconfig.json</code> in the root of your project:</p>\n<pre class=\"shiki\"><div class=\"language-id\">json</div><div class='code-container'><code><span style=\"color: #000000\">{</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0451A5\">\"typeAcquisition\"</span><span style=\"color: #000000\">: {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0451A5\">\"enable\"</span><span style=\"color: #000000\">: </span><span style=\"color: #0000FF\">false</span>\n<span style=\"color: #000000\">  }</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n<p>If you have a specific module which should be included (but isn’t in <code>node_modules</code>):</p>\n<pre class=\"shiki\"><div class=\"language-id\">json</div><div class='code-container'><code><span style=\"color: #000000\">{</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0451A5\">\"typeAcquisition\"</span><span style=\"color: #000000\">: {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0451A5\">\"include\"</span><span style=\"color: #000000\">: [</span><span style=\"color: #A31515\">\"jest\"</span><span style=\"color: #000000\">]</span>\n<span style=\"color: #000000\">  }</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n<p>If a module should not be automatically acquired, for example if the library is available in your <code>node_modules</code> but your team has agreed to not use it:</p>\n<pre class=\"shiki\"><div class=\"language-id\">json</div><div class='code-container'><code><span style=\"color: #000000\">{</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0451A5\">\"typeAcquisition\"</span><span style=\"color: #000000\">: {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0451A5\">\"exclude\"</span><span style=\"color: #000000\">: [</span><span style=\"color: #A31515\">\"jquery\"</span><span style=\"color: #000000\">]</span>\n<span style=\"color: #000000\">  }</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>typeAcquisition</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='references'><a aria-label=\"Link to the compiler option:references\" title=\"Link to the compiler option:references\" href='#references' name='references'>#</a> References - <code>references</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>Project references are a way to structure your TypeScript programs into smaller pieces.\nUsing Project References can greatly improve build and editor interaction times, enforce logical separation between components, and organize your code in new and improved ways.</p>\n<p>You can read more about how references works in the <a href=\"/docs/handbook/project-references.html\">Project References</a> section of the handbook</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>references</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr></table>\n</div></section>\n<div class='category'>\n<h2 id='Basic_Options_6172'><a href='#Basic_Options_6172' name='Basic_Options_6172'>#</a> Project Options</h2>\n<p>These settings are used to define the runtime expectations of your project, how and where you want the JavaScript to be emitted and the level of integration you want with existing JavaScript code.</p>\n</div>\n<section class='compiler-option'>\n<h3 id='incremental'><a aria-label=\"Link to the compiler option:incremental\" title=\"Link to the compiler option:incremental\" href='#incremental' name='incremental'>#</a> Incremental - <code>incremental</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>Tells TypeScript to save information about the project graph from the last compilation to files stored on disk. This\ncreates a series of <code>.tsbuildinfo</code> files in the same folder as your compilation output. They are not used by your\nJavaScript at runtime and can be safely deleted. You can read more about the flag in the <a href=\"/docs/handbook/release-notes/typescript-3-4.html#faster-subsequent-builds-with-the---incremental-flag\">3.4 release notes</a>.</p>\n<p>To control which folders you want to the files to be built to, use the config option <a href=\"#tsBuildInfoFile\"><code>tsBuildInfoFile</code></a>.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>incremental</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>true</code></p>\n<td/></tr>\n<tr><td>Related</td><td><p><a href=\"#composite\"><code>composite</code></a>, <a href=\"#tsBuildInfoFile\"><code>tsBuildInfoFile</code></a></p>\n<td/></tr>\n<tr><td>Released</td><td><p><a href=\"/docs/handbook/release-notes/typescript-3-4.html\">3.4</a></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='target'><a aria-label=\"Link to the compiler option:target\" title=\"Link to the compiler option:target\" href='#target' name='target'>#</a> Target - <code>target</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>Modern browsers support all ES6 features, so <code>ES6</code> is a good choice.\nYou might choose to set a lower target if your code is deployed to older environments, or a higher target if your code is guaranteed to run in newer environments.</p>\n<p>The <code>target</code> setting changes which JS features are downleveled and which are left intact.\nFor example, an arrow function <code>() => this</code> will be turned into an equivalent <code>function</code> expression if <code>target</code> is ES5 or lower.</p>\n<p>Changing <code>target</code> also changes the default value of <a href=\"#lib\"><code>lib</code></a>.\nYou may “mix and match” <code>target</code> and <code>lib</code> settings as desired, but you could just set <code>target</code> for convenience.</p>\n<p>If your are only working with Node.js, here are recommended <code>target</code> based off of the Node version:</p>\n<table>\n<thead>\n<tr>\n<th>Name</th>\n<th>Supported Target</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>Node 8</td>\n<td><code>ES2017</code></td>\n</tr>\n<tr>\n<td>Node 10</td>\n<td><code>ES2018</code></td>\n</tr>\n<tr>\n<td>Node 12</td>\n<td><code>ES2019</code></td>\n</tr>\n</tbody>\n</table>\n<p>These are based on <a href=\"https://node.green\">node.green</a>’s database of support.</p>\n<p>The special <code>ESNext</code> value refers to the highest version your TypeScript supports.\nThis setting should be used with caution, since it doesn’t mean the same thing between different TypeScript versions and can make upgrades less predictable.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>target</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr>\n<tr><td>Allowed</td><td><p><code>ES3</code> (default), <code>ES5</code>, <code>ES6</code>/<code>ES2015</code> (synonomous), <code>ES7</code>/<code>ES2016</code>, <code>ES2017</code>, <code>ES2018</code>, <code>ES2019</code>, <code>ESNext</code></p>\n<td/></tr>\n<tr><td>Released</td><td><p><a href=\"/docs/handbook/release-notes/typescript-1-0.html\">1.0</a></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='module'><a aria-label=\"Link to the compiler option:module\" title=\"Link to the compiler option:module\" href='#module' name='module'>#</a> Module - <code>module</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>Sets the module system for the program. See the <a href='/docs/handbook/modules.html#ambient-modules'>Modules</a> chapter of the handbook for more information. You very likely want <code>\"CommonJS\"</code>.</p>\n<p>Here’s some example output for this file:</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #008000\">// @filename: index.ts</span>\n<span style=\"color: #0000FF\">import</span><span style=\"color: #000000\"> { valueOfPi } </span><span style=\"color: #0000FF\">from</span><span style=\"color: #000000\"> </span><span style=\"color: #A31515\">\"./constants\"</span><span style=\"color: #000000\">;</span>\n\n<span style=\"color: #0000FF\">export</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> twoPi = valueOfPi * </span><span style=\"color: #09835A\">2</span><span style=\"color: #000000\">;</span></code></div></pre>\n<h4 id=\"commonjs\" style=\"position:relative;\"><a href=\"#commonjs\" aria-label=\"commonjs permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><code>CommonJS</code></h4>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">js</div><div class='code-container'><code><span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> constants_1 = require(</span><span style=\"color: #A31515\">\"./constants\"</span><span style=\"color: #000000\">);</span>\n<span style=\"color: #000000\">exports.twoPi = constants_1.valueOfPi * </span><span style=\"color: #09835A\">2</span><span style=\"color: #000000\">;</span></code></div></pre>\n<h4 id=\"umd\" style=\"position:relative;\"><a href=\"#umd\" aria-label=\"umd permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><code>UMD</code></h4>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">js</div><div class='code-container'><code><span style=\"color: #000000\">(</span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> (factory) {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">if</span><span style=\"color: #000000\"> (</span><span style=\"color: #0000FF\">typeof</span><span style=\"color: #000000\"> module === </span><span style=\"color: #A31515\">\"object\"</span><span style=\"color: #000000\"> && </span><span style=\"color: #0000FF\">typeof</span><span style=\"color: #000000\"> module.exports === </span><span style=\"color: #A31515\">\"object\"</span><span style=\"color: #000000\">) {</span>\n<span style=\"color: #000000\">        </span><span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> v = factory(require, exports);</span>\n<span style=\"color: #000000\">        </span><span style=\"color: #0000FF\">if</span><span style=\"color: #000000\"> (v !== </span><span style=\"color: #0000FF\">undefined</span><span style=\"color: #000000\">) module.exports = v;</span>\n<span style=\"color: #000000\">    }</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">else</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">if</span><span style=\"color: #000000\"> (</span><span style=\"color: #0000FF\">typeof</span><span style=\"color: #000000\"> define === </span><span style=\"color: #A31515\">\"function\"</span><span style=\"color: #000000\"> && define.amd) {</span>\n<span style=\"color: #000000\">        define([</span><span style=\"color: #A31515\">\"require\"</span><span style=\"color: #000000\">, </span><span style=\"color: #A31515\">\"exports\"</span><span style=\"color: #000000\">, </span><span style=\"color: #A31515\">\"./constants\"</span><span style=\"color: #000000\">], factory);</span>\n<span style=\"color: #000000\">    }</span>\n<span style=\"color: #000000\">})(</span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> (require, exports) {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #A31515\">\"use strict\"</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #000000\">    Object.defineProperty(exports, </span><span style=\"color: #A31515\">\"__esModule\"</span><span style=\"color: #000000\">, { value: </span><span style=\"color: #0000FF\">true</span><span style=\"color: #000000\"> });</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> constants_1 = require(</span><span style=\"color: #A31515\">\"./constants\"</span><span style=\"color: #000000\">);</span>\n<span style=\"color: #000000\">    exports.twoPi = constants_1.valueOfPi * </span><span style=\"color: #09835A\">2</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #000000\">});</span></code></div></pre>\n<h4 id=\"amd\" style=\"position:relative;\"><a href=\"#amd\" aria-label=\"amd permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><code>AMD</code></h4>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">js</div><div class='code-container'><code><span style=\"color: #000000\">define([</span><span style=\"color: #A31515\">\"require\"</span><span style=\"color: #000000\">, </span><span style=\"color: #A31515\">\"exports\"</span><span style=\"color: #000000\">, </span><span style=\"color: #A31515\">\"./constants\"</span><span style=\"color: #000000\">], </span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> (require, exports, constants_1) {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #A31515\">\"use strict\"</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #000000\">    Object.defineProperty(exports, </span><span style=\"color: #A31515\">\"__esModule\"</span><span style=\"color: #000000\">, { value: </span><span style=\"color: #0000FF\">true</span><span style=\"color: #000000\"> });</span>\n<span style=\"color: #000000\">    exports.twoPi = constants_1.valueOfPi * </span><span style=\"color: #09835A\">2</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #000000\">});</span></code></div></pre>\n<h4 id=\"system\" style=\"position:relative;\"><a href=\"#system\" aria-label=\"system permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><code>System</code></h4>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">js</div><div class='code-container'><code><span style=\"color: #000000\">System.register([</span><span style=\"color: #A31515\">\"./constants\"</span><span style=\"color: #000000\">], </span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> (exports_1, context_1) {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #A31515\">\"use strict\"</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> constants_1, twoPi;</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> __moduleName = context_1 && context_1.id;</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> {</span>\n<span style=\"color: #000000\">        setters: [</span>\n<span style=\"color: #000000\">            </span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> (constants_1_1) {</span>\n<span style=\"color: #000000\">                constants_1 = constants_1_1;</span>\n<span style=\"color: #000000\">            }</span>\n<span style=\"color: #000000\">        ],</span>\n<span style=\"color: #000000\">        execute: </span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> () {</span>\n<span style=\"color: #000000\">            exports_1(</span><span style=\"color: #A31515\">\"twoPi\"</span><span style=\"color: #000000\">, twoPi = constants_1.valueOfPi * </span><span style=\"color: #09835A\">2</span><span style=\"color: #000000\">);</span>\n<span style=\"color: #000000\">        }</span>\n<span style=\"color: #000000\">    };</span>\n<span style=\"color: #000000\">});</span></code></div></pre>\n<h4 id=\"esnext\" style=\"position:relative;\"><a href=\"#esnext\" aria-label=\"esnext permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a><code>ESNext</code></h4>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">js</div><div class='code-container'><code><span style=\"color: #0000FF\">import</span><span style=\"color: #000000\"> { valueOfPi } </span><span style=\"color: #0000FF\">from</span><span style=\"color: #000000\"> </span><span style=\"color: #A31515\">\"./constants\"</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #0000FF\">export</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> twoPi = valueOfPi * </span><span style=\"color: #09835A\">2</span><span style=\"color: #000000\">;</span></code></div></pre>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>module</p>\n<td/></tr>\n<tr><td>Allowed</td><td><p><code>CommonJS</code> (default if <code>target</code> is <code>ES3</code> or <code>ES5</code>), <code>ES6</code>/<code>ES2015</code> (synonymous, default for <code>target</code> <code>ES6</code> and higher), <code>None</code>, <code>UMD</code>, <code>AMD</code>, <code>System</code>, <code>ESNext</code></p>\n<td/></tr>\n<tr><td>Released</td><td><p><a href=\"/docs/handbook/release-notes/typescript-1-0.html\">1.0</a></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='lib'><a aria-label=\"Link to the compiler option:lib\" title=\"Link to the compiler option:lib\" href='#lib' name='lib'>#</a> Lib - <code>lib</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>TypeScript includes a default set of type definitions for built-in JS APIs (like <code>Math</code>), as well as type definitions for things found in browser environments (like <code>document</code>).\nTypeScript also includes APIs for newer JS features matching the <code>target</code> you specify; for example the definition for <code>Map</code> is available if <code>target</code> is <code>ES6</code> or newer.</p>\n<p>You may want to change these for a few reasons:</p>\n<ul>\n<li>Your program doesn’t run in a browser, so you don’t want the <code>\"dom\"</code> type definitions</li>\n<li>Your runtime platform provides certain JavaScript API objects (maybe through polyfills), but doesn’t yet support the full syntax of a given ECMAScript version</li>\n<li>You have polyfills or native implementations for some, but not all, of a higher level ECMAScript version</li>\n</ul>\n<h3 id=\"high-level-libraries\" style=\"position:relative;\"><a href=\"#high-level-libraries\" aria-label=\"high level libraries permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>High Level libraries</h3>\n<table>\n<thead>\n<tr>\n<th>Name</th>\n<th>Contents</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>ES5</code></td>\n<td>Core definitions for all ES3 and ES5 functionality</td>\n</tr>\n<tr>\n<td><code>ES2015</code></td>\n<td>Additional APIs available in ES2015 (also known as ES6) - <code>array.find</code>, <code>Promise</code>, <code>Proxy</code>, <code>Symbol</code>, <code>Map</code>, <code>Set</code>, <code>Reflect</code>, etc.</td>\n</tr>\n<tr>\n<td><code>ES6</code></td>\n<td>Alias for “ES2015”</td>\n</tr>\n<tr>\n<td><code>ES2016</code></td>\n<td>Additional APIs available in ES2016 - <code>array.include</code>, etc.</td>\n</tr>\n<tr>\n<td><code>ES7</code></td>\n<td>Alias for “ES2016”</td>\n</tr>\n<tr>\n<td><code>ES2017</code></td>\n<td>Additional APIs available in ES2017 - <code>Object.entries</code>, <code>Object.values</code>, <code>Atomics</code>, <code>SharedArrayBuffer</code>, <code>date.formatToParts</code>, typed arrays, etc.</td>\n</tr>\n<tr>\n<td><code>ES2018</code></td>\n<td>Additional APIs available in ES2018 - <code>async</code> iterables, <code>promise.finally</code>, <code>Intl.PluralRules</code>, <code>rexexp.groups</code>, etc.</td>\n</tr>\n<tr>\n<td><code>ES2019</code></td>\n<td>Additional APIs available in ES2019 - <code>array.flat</code>, <code>array.flatMap</code>, <code>Object.fromEntries</code>, <code>string.trimStart</code>, <code>string.trimEnd</code>, etc.</td>\n</tr>\n<tr>\n<td><code>ES2020</code></td>\n<td>Additional APIs available in ES2020 - <code>string.matchAll</code>, etc.</td>\n</tr>\n<tr>\n<td><code>ESNext</code></td>\n<td>Additional APIs available in ESNext - This changes as the JavaScript specification evolves</td>\n</tr>\n<tr>\n<td><code>DOM</code></td>\n<td><a href=\"https://developer.mozilla.org/en-US/docs/Glossary/DOM\">DOM</a> definitions - <code>window</code>, <code>document</code>, etc.</td>\n</tr>\n<tr>\n<td><code>WebWorker</code></td>\n<td>APIs available in <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Using_web_workers\">WebWorker</a> contexts</td>\n</tr>\n<tr>\n<td><code>ScriptHost</code></td>\n<td>APIs for the <a href=\"https://en.wikipedia.org/wiki/Windows_Script_Host\">Windows Script Hosting System</a></td>\n</tr>\n</tbody>\n</table>\n<h3 id=\"individual-library-components\" style=\"position:relative;\"><a href=\"#individual-library-components\" aria-label=\"individual library components permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Individual library components</h3>\n<table>\n<thead>\n<tr>\n<th>Name</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><code>DOM.Iterable</code></td>\n</tr>\n<tr>\n<td><code>ES2015.Core</code></td>\n</tr>\n<tr>\n<td><code>ES2015.Collection</code></td>\n</tr>\n<tr>\n<td><code>ES2015.Generator</code></td>\n</tr>\n<tr>\n<td><code>ES2015.Iterable</code></td>\n</tr>\n<tr>\n<td><code>ES2015.Promise</code></td>\n</tr>\n<tr>\n<td><code>ES2015.Proxy</code></td>\n</tr>\n<tr>\n<td><code>ES2015.Reflect</code></td>\n</tr>\n<tr>\n<td><code>ES2015.Symbol</code></td>\n</tr>\n<tr>\n<td><code>ES2015.Symbol.WellKnown</code></td>\n</tr>\n<tr>\n<td><code>ES2016.Array.Include</code></td>\n</tr>\n<tr>\n<td><code>ES2017.object</code></td>\n</tr>\n<tr>\n<td><code>ES2017.Intl</code></td>\n</tr>\n<tr>\n<td><code>ES2017.SharedMemory</code></td>\n</tr>\n<tr>\n<td><code>ES2017.String</code></td>\n</tr>\n<tr>\n<td><code>ES2017.TypedArrays</code></td>\n</tr>\n<tr>\n<td><code>ES2018.Intl</code></td>\n</tr>\n<tr>\n<td><code>ES2018.Promise</code></td>\n</tr>\n<tr>\n<td><code>ES2018.RegExp</code></td>\n</tr>\n<tr>\n<td><code>ES2019.Array</code></td>\n</tr>\n<tr>\n<td><code>ES2019.Full</code></td>\n</tr>\n<tr>\n<td><code>ES2019.Object</code></td>\n</tr>\n<tr>\n<td><code>ES2019.String</code></td>\n</tr>\n<tr>\n<td><code>ES2019.Symbol</code></td>\n</tr>\n<tr>\n<td><code>ES2020.Full</code></td>\n</tr>\n<tr>\n<td><code>ES2020.String</code></td>\n</tr>\n<tr>\n<td><code>ES2020.Symbol.wellknown</code></td>\n</tr>\n<tr>\n<td><code>ESNext.AsyncIterable</code></td>\n</tr>\n<tr>\n<td><code>ESNext.Array</code></td>\n</tr>\n<tr>\n<td><code>ESNext.Intl</code></td>\n</tr>\n<tr>\n<td><code>ESNext.Symbol</code></td>\n</tr>\n</tbody>\n</table>\n<p>This list may be out of date, you can see the full list in the <a href=\"https://github.com/microsoft/TypeScript/tree/master/lib\">TypeScript source code</a>.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>lib</p>\n<td/></tr>\n<tr><td>Released</td><td><p><a href=\"/docs/handbook/release-notes/typescript-2-0.html\">2.0</a></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='allowJs'><a aria-label=\"Link to the compiler option:allowJs\" title=\"Link to the compiler option:allowJs\" href='#allowJs' name='allowJs'>#</a> Allow JS - <code>allowJs</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>Allow JavaScript files to be imported inside your project, instead of just <code>.ts</code> and <code>.tsx</code> files. For example, this JS file:</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">js</div><div class='code-container'><code><span style=\"color: #008000\">// @filename: card.js</span>\n<span style=\"color: #0000FF\">export</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> defaultCardDeck = </span><span style=\"color: #A31515\">\"Heart\"</span><span style=\"color: #000000\">;</span></code></div></pre>\n<p>When imported into a TypeScript file will raise an error:</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #008000\">// @filename: index.ts</span>\n<span style=\"color: #0000FF\">import</span><span style=\"color: #000000\"> { defaultCardDeck } </span><span style=\"color: #0000FF\">from</span><span style=\"color: #000000\"> </span><span style=\"color: #A31515\">\"./card\"</span><span style=\"color: #000000\">;</span>\n\n<span style=\"color: #000000\">console.log(defaultCardDeck);</span></code></div></pre>\n<p>Imports fine with <code>allowJs</code> enabled:</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #008000\">// @filename: index.ts</span>\n<span style=\"color: #0000FF\">import</span><span style=\"color: #000000\"> { defaultCardDeck } </span><span style=\"color: #0000FF\">from</span><span style=\"color: #000000\"> </span><span style=\"color: #A31515\">\"./card\"</span><span style=\"color: #000000\">;</span>\n\n<span style=\"color: #000000\">console.log(defaultCardDeck);</span></code></div></pre>\n<p>This flag can be used as a way to incrementally add TypeScript files into JS projects by allowing the <code>.ts</code> and <code>.tsx</code> files to live along-side existing JavaScript files.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>allowJs</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr>\n<tr><td>Related</td><td><p><a href=\"#checkJs\"><code>checkJs</code></a>, <a href=\"#emitDeclarationOnly\"><code>emitDeclarationOnly</code></a></p>\n<td/></tr>\n<tr><td>Released</td><td><p><a href=\"/docs/handbook/release-notes/typescript-1-8.html\">1.8</a></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='checkJs'><a aria-label=\"Link to the compiler option:checkJs\" title=\"Link to the compiler option:checkJs\" href='#checkJs' name='checkJs'>#</a> Check JS - <code>checkJs</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>Works in tandem with <code>allowJs</code>. When <code>checkJs</code> is enabled then errors are reported in JavaScript files. This is\nthe equivalent of including <code>// @ts-check</code> at the top of all JavaScript files which are included in your project.</p>\n<p>For example, this is incorrect JavaScript according to the <code>parseFloat</code> type definition which comes with TypeScript:</p>\n<pre class=\"shiki\"><div class=\"language-id\">js</div><div class='code-container'><code><span style=\"color: #008000\">// parseFloat only takes a string</span>\n<span style=\"color: #000000\">module.exports.pi = parseFloat(</span><span style=\"color: #09835A\">3.124</span><span style=\"color: #000000\">);</span></code></div></pre>\n<p>When imported into a TypeScript module:</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #008000\">// @filename: constants.js</span>\n<span style=\"color: #000000\">module.exports.pi = parseFloat(</span><span style=\"color: #09835A\">3.124</span><span style=\"color: #000000\">);</span>\n\n<span style=\"color: #008000\">// @filename: index.ts</span>\n<span style=\"color: #0000FF\">import</span><span style=\"color: #000000\"> { pi } </span><span style=\"color: #0000FF\">from</span><span style=\"color: #000000\"> </span><span style=\"color: #A31515\">\"./constants\"</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #000000\">console.log(pi);</span></code></div></pre>\n<p>You will not get any errors. However, if you turn on <code>checkJs</code> then you will get error messages from the JavaScript file.</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #008000\">// @filename: constants.js</span>\n<span class=\"error\"><span>Argument of type '3.124' is not assignable to parameter of type 'string'.</span><span class=\"code\">2345</span></span><span class=\"error-behind\">Argument of type '3.124' is not assignable to parameter of type 'string'.</span><span style=\"color: #000000\">module.exports.pi = parseFloat(</span><span style=\"color: #09835A\">3.124</span><span style=\"color: #000000\">);</span>\n\n<span style=\"color: #008000\">// @filename: index.ts</span>\n<span style=\"color: #0000FF\">import</span><span style=\"color: #000000\"> { pi } </span><span style=\"color: #0000FF\">from</span><span style=\"color: #000000\"> </span><span style=\"color: #A31515\">\"./constants\"</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #000000\">console.log(pi);</span></code></div></pre>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>checkJs</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr>\n<tr><td>Related</td><td><p><a href=\"#allowJs\"><code>allowJs</code></a>, <a href=\"#emitDeclarationOnly\"><code>emitDeclarationOnly</code></a></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='jsx'><a aria-label=\"Link to the compiler option:jsx\" title=\"Link to the compiler option:jsx\" href='#jsx' name='jsx'>#</a> JSX - <code>jsx</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>Controls how JSX constructs are emitted in JavaScript files.\nThis only affects output of JS files that started in <code>.tsx</code> files.</p>\n<ul>\n<li><code>preserve</code>: Emit <code>.jsx</code> files with the JSX unchanged</li>\n<li><code>react</code>: Emit <code>.js</code> files with JSX changed to the equivalent <code>React.createElement</code> calls</li>\n<li><code>react-native</code>: Emit <code>.js</code> files with the JSX unchanged</li>\n</ul>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>jsx</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>\"preserve\"</code></p>\n<td/></tr>\n<tr><td>Allowed</td><td><p><code>react</code> (default), <code>react-native</code>, <code>preserve</code></p>\n<td/></tr>\n<tr><td>Released</td><td><p><a href=\"/docs/handbook/release-notes/typescript-2-2.html\">2.2</a></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='declaration'><a aria-label=\"Link to the compiler option:declaration\" title=\"Link to the compiler option:declaration\" href='#declaration' name='declaration'>#</a> Declaration - <code>declaration</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>Generate <code>d.ts</code> files for every TypeScript or JavaScript file inside your project.\nThese <code>d.ts</code> files are type definition files which describe the external API of your module.\nWith <code>d.ts</code> files, tools like TypeScript can provide intellisense and accurate types for un-typed code.</p>\n<p>When <code>declaration</code> is set to <code>true</code>, running the compiler with this TypeScript code:</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">export</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">let</span><span style=\"color: #000000\"> <span class='lsp'>helloWorld <span class='lsp-result'>let helloWorld: string</span></span>= </span><span style=\"color: #A31515\">\"hi\"</span><span style=\"color: #000000\">;</span></code></div></pre>\n<p>Will generate an <code>index.js</code> file like this:</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">js</div><div class='code-container'><code><span style=\"color: #0000FF\">export</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">let</span><span style=\"color: #000000\"> helloWorld = </span><span style=\"color: #A31515\">\"hi\"</span><span style=\"color: #000000\">;</span></code></div></pre>\n<p>With a corresponding <code>helloWorld.d.ts</code>:</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">export</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">declare</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">let</span><span style=\"color: #000000\"> helloWorld: string;</span></code></div></pre>\n<p>When working with <code>d.ts</code> files for JavaScript files you may want to use <a href=\"#emitDeclarationOnly\"><code>emitDeclarationOnly</code></a> or use <a href=\"#outDir\"><code>outDir</code></a> to ensure that the JavaScript files are not overwritten.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>declaration</p>\n<td/></tr>\n<tr><td>Default</td><td><p>True when TS</p>\n<td/></tr>\n<tr><td>Related</td><td><p><a href=\"#emitDeclarationOnly\"><code>emitDeclarationOnly</code></a></p>\n<td/></tr>\n<tr><td>Released</td><td><p><a href=\"/docs/handbook/release-notes/typescript-1-0.html\">1.0</a></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='declarationMap'><a aria-label=\"Link to the compiler option:declarationMap\" title=\"Link to the compiler option:declarationMap\" href='#declarationMap' name='declarationMap'>#</a> Declaration Map - <code>declarationMap</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>Generates a source map for <code>.d.ts</code> files which map back to the original <code>.ts</code> source file.\nThis will allow editors such as VS Code to go to the original <code>.ts</code> file when using features like <em>Go to Definition</em>.</p>\n<p>You should strongly consider turning this on if you’re using project references.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>declarationMap</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr>\n<tr><td>Released</td><td><p><a href=\"/docs/handbook/release-notes/typescript-2-9.html\">2.9</a></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='sourceMap'><a aria-label=\"Link to the compiler option:sourceMap\" title=\"Link to the compiler option:sourceMap\" href='#sourceMap' name='sourceMap'>#</a> Source Map - <code>sourceMap</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>Enables the generation of <a href=\"https://developer.mozilla.org/en-US/docs/Tools/Debugger/How_to/Use_a_source_map\">sourcemap files</a>.\nThese files allow debuggers and other tools to display the original TypeScript source code when actually working with the emitted JavaScript files.\nSource map files are emitted as <code>.js.map</code> (or <code>.jsx.map</code>) files next to the corresponding <code>.js</code> output file.</p>\n<p>The <code>.js</code> files will in turn contain a sourcemap comment to indicate to tools where the files are to external tools, for example:</p>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #008000\">// helloWorld.ts</span>\n<span style=\"color: #0000FF\">export</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">declare</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> helloWorld = </span><span style=\"color: #A31515\">\"hi\"</span><span style=\"color: #000000\">;</span></code></div></pre>\n<p>Compiling with <code>sourceMap</code> set to <code>true</code> creates the following JavaScript file:</p>\n<pre class=\"shiki\"><div class=\"language-id\">js</div><div class='code-container'><code><span style=\"color: #008000\">// helloWorld.js</span>\n<span style=\"color: #A31515\">\"use strict\"</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #000000\">Object.defineProperty(exports, </span><span style=\"color: #A31515\">\"__esModule\"</span><span style=\"color: #000000\">, { value: </span><span style=\"color: #0000FF\">true</span><span style=\"color: #000000\"> });</span>\n<span style=\"color: #000000\">exports.helloWorld = </span><span style=\"color: #A31515\">\"hi\"</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #008000\">//# sourceMappingURL=// helloWorld.js.map</span></code></div></pre>\n<p>And this also generates this json map:</p>\n<pre class=\"shiki\"><div class=\"language-id\">json</div><div class='code-container'><code><span style=\"color: #008000\">// helloWorld.js.map</span>\n<span style=\"color: #000000\">{</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0451A5\">\"version\"</span><span style=\"color: #000000\">: </span><span style=\"color: #09835A\">3</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0451A5\">\"file\"</span><span style=\"color: #000000\">: </span><span style=\"color: #A31515\">\"ex.js\"</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0451A5\">\"sourceRoot\"</span><span style=\"color: #000000\">: </span><span style=\"color: #A31515\">\"\"</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0451A5\">\"sources\"</span><span style=\"color: #000000\">: [</span><span style=\"color: #A31515\">\"../ex.ts\"</span><span style=\"color: #000000\">],</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0451A5\">\"names\"</span><span style=\"color: #000000\">: [],</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0451A5\">\"mappings\"</span><span style=\"color: #000000\">: </span><span style=\"color: #A31515\">\";;AAAa,QAAA,UAAU,GAAG,IAAI,CAAA\"</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>sourceMap</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='outFile'><a aria-label=\"Link to the compiler option:outFile\" title=\"Link to the compiler option:outFile\" href='#outFile' name='outFile'>#</a> Out File - <code>outFile</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>If specified, all <em>global</em> (non-module) files will be concatenated into the single output file specified.</p>\n<p>If <code>module</code> is <code>system</code> or <code>amd</code>, all module files will also be concatenated into this file after all global content.</p>\n<p>Note: <code>outFile</code> cannot be used unless <code>module</code> is <code>None</code>, <code>System</code>, or <code>AMD</code>.\nThis option <em>cannot</em> be used to bundle CommonJS or ES6 modules.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>outFile</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>n/a</code></p>\n<td/></tr>\n<tr><td>Related</td><td><p><a href=\"#out\"><code>out</code></a>, <a href=\"#outDir\"><code>outDir</code></a></p>\n<td/></tr>\n<tr><td>Released</td><td><p><a href=\"/docs/handbook/release-notes/typescript-1-0.html\">1.0</a></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='outDir'><a aria-label=\"Link to the compiler option:outDir\" title=\"Link to the compiler option:outDir\" href='#outDir' name='outDir'>#</a> Out Dir - <code>outDir</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>If specified, <code>.js</code> (as well as <code>.d.ts</code>, <code>.js.map</code>, etc.) files will be emitted into this directory.\nThe directory structure of the original source files is preserved; see <a href=\"#rootDir\">rootDir</a> if the computed root is not what you intended.</p>\n<p>If not specified, <code>.js</code> files will be emitted in the same directory as the <code>.ts</code> files they were generated from:</p>\n<pre class=\"shiki\"><div class=\"language-id\">sh</div><div class='code-container'><code><span style=\"color: #000000\">$ tsc</span>\n\n<span style=\"color: #000000\">example</span>\n<span style=\"color: #000000\">├── index.js</span>\n<span style=\"color: #000000\">└── index.ts</span></code></div></pre>\n<p>With a <code>tsconfig.json</code> like this:</p>\n<pre class=\"shiki\"><div class=\"language-id\">json</div><div class='code-container'><code><span style=\"color: #000000\">{</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0451A5\">\"compilerOptions\"</span><span style=\"color: #000000\">: {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0451A5\">\"outDir\"</span><span style=\"color: #000000\">: </span><span style=\"color: #A31515\">\"dist\"</span>\n<span style=\"color: #000000\">  }</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n<p>Running <code>tsc</code> with these settings moves the files into the specified <code>dist</code> folder:</p>\n<pre class=\"shiki\"><div class=\"language-id\">sh</div><div class='code-container'><code><span style=\"color: #000000\">$ tsc</span>\n\n<span style=\"color: #000000\">example</span>\n<span style=\"color: #000000\">├── dist</span>\n<span style=\"color: #000000\">│   └── index.js</span>\n<span style=\"color: #000000\">├── index.ts</span>\n<span style=\"color: #000000\">└── tsconfig.json</span></code></div></pre>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>outDir</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>n/a</code></p>\n<td/></tr>\n<tr><td>Related</td><td><p><a href=\"#out\"><code>out</code></a>, <a href=\"#outFile\"><code>outFile</code></a></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='rootDir'><a aria-label=\"Link to the compiler option:rootDir\" title=\"Link to the compiler option:rootDir\" href='#rootDir' name='rootDir'>#</a> Root Dir - <code>rootDir</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p><strong>Default</strong>: The longest common path of all non-declaration input files. If <code>composite</code> is set, the default is instead the directory containing the <code>tsconfig.json</code> file.</p>\n<p>When TypeScript compiles files, it keeps the same directory structure in the output directory as exists in the input directory.</p>\n<p>For example, let’s say you have some input files:</p>\n<pre><code>MyProj\n├── tsconfig.json\n├── core\n│   ├── a.ts\n│   ├── b.ts\n│   ├── sub\n│   │   ├── c.ts\n├── types.d.ts\n</code></pre>\n<p>The inferred value for <code>rootDir</code> is the longest common path of all non-declaration input files, which in this case is <code>core/</code>.</p>\n<p>If your <code>outDir</code> was <code>dist</code>, TypeScript would write this tree:</p>\n<pre><code>MyProj\n├── dist\n│   ├── a.ts\n│   ├── b.ts\n│   ├── sub\n│   │   ├── c.ts\n</code></pre>\n<p>However, you may have intended for <code>core</code> to be part of the output directory structure.\nBy setting <code>rootDir: \".\"</code> in <code>tsconfig.json</code>, TypeScript would write this tree:</p>\n<pre><code>MyProj\n├── dist\n│   ├── core\n│   │   ├── a.js\n│   │   ├── b.js\n│   │   ├── sub\n│   │   │   ├── c.js\n</code></pre>\n<p>Importantly, <code>rootDir</code> <strong>does not affect which files become part of the compilation</strong>.\nIt has no interaction with the <code>include</code>, <code>exclude</code>, or <code>files</code> <code>tsconfig.json</code> settings.</p>\n<p>Note that TypeScript will never write an output file to a directory outside of <code>outDir</code>, and will never skip emitting a file.\nFor this reason, <code>rootDir</code> also enforces that all files which need to be emitted are underneath the <code>rootDir</code> path.</p>\n<p>For example, let’s say you had this tree:</p>\n<pre><code>MyProj\n├── tsconfig.json\n├── core\n│   ├── a.ts\n│   ├── b.ts\n├── helpers.ts\n</code></pre>\n<p>It would be an error to specify <code>rootDir</code> as <code>core</code> <em>and</em> <code>include</code> as <code>*</code> because it creates a file (<code>helpers.ts</code>) that would need to be emitted <em>outside</em> the <code>outDir</code> (i.e. <code>../helpers.js</code>).</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>rootDir</p>\n<td/></tr>\n<tr><td>Default</td><td><p>Computed from the list of input files</p>\n<td/></tr>\n<tr><td>Released</td><td><p><a href=\"/docs/handbook/release-notes/typescript-1-5.html\">1.5</a></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='composite'><a aria-label=\"Link to the compiler option:composite\" title=\"Link to the compiler option:composite\" href='#composite' name='composite'>#</a> Composite - <code>composite</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>The <code>composite</code> option enforces certain constraints which make it possible for build tools (including TypeScript\nitself, under <code>--build</code> mode) to quickly determine if a project has been built yet.</p>\n<p>When this setting is on:</p>\n<ul>\n<li>The <code>rootDir</code> setting, if not explicitly set, defaults to the directory containing the <code>tsconfig.json</code> file.</li>\n<li>All implementation files must be matched by an <code>include</code> pattern or listed in the <code>files</code> array. If this constraint is violated, <code>tsc</code> will inform you which files weren’t specified.</li>\n<li><code>declaration</code> defaults to <code>true</code></li>\n</ul>\n<p>You can find documentation on TypeScript projects in <a href=\"https://www.typescriptlang.org/docs/handbook/project-references.html\">the handbook</a>.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>composite</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>true</code></p>\n<td/></tr>\n<tr><td>Related</td><td><p><a href=\"#incremental\"><code>incremental</code></a>, <a href=\"#tsBuildInfoFile\"><code>tsBuildInfoFile</code></a></p>\n<td/></tr>\n<tr><td>Released</td><td><p><a href=\"/docs/handbook/release-notes/typescript-3-0.html\">3.0</a></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='tsBuildInfoFile'><a aria-label=\"Link to the compiler option:tsBuildInfoFile\" title=\"Link to the compiler option:tsBuildInfoFile\" href='#tsBuildInfoFile' name='tsBuildInfoFile'>#</a> TS Build Info File - <code>tsBuildInfoFile</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>This setting lets you specify a file for storing incremental compilation information as a part of composite projects which enables faster\nbuilding of larger TypeScript codebases. You can read more about composite projects <a href=\"/docs/handbook/project-references.html\">in the handbook</a>.</p>\n<p>This option offers a way to configure the place where TypeScript keeps track of the files it stores on the disk to\nindicate a project’s build state — by default, they are in the same folder as your emitted JavaScript.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>tsBuildInfoFile</p>\n<td/></tr>\n<tr><td>Default</td><td><p> .tsbuildinfo</p>\n<td/></tr>\n<tr><td>Released</td><td><p><a href=\"/docs/handbook/release-notes/typescript-3-4.html\">3.4</a></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='removeComments'><a aria-label=\"Link to the compiler option:removeComments\" title=\"Link to the compiler option:removeComments\" href='#removeComments' name='removeComments'>#</a> Remove Comments - <code>removeComments</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>Strips all comments from TypeScript files when converting into JavaScript. Defaults to <code>false</code>.</p>\n<p>For example, this is a TypeScript file which has a JSDoc comment:</p>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #008000\">/** The translation of 'Hello world' into Portuguese */</span>\n<span style=\"color: #0000FF\">export</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> helloWorldPTBR = </span><span style=\"color: #A31515\">\"Olá Mundo\"</span><span style=\"color: #000000\">;</span></code></div></pre>\n<p>When <code>removeComments</code> is set to <code>true</code>:</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">js</div><div class='code-container'><code><span style=\"color: #0000FF\">export</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> helloWorldPTBR = </span><span style=\"color: #A31515\">\"Olá Mundo\"</span><span style=\"color: #000000\">;</span></code></div></pre>\n<p>Without setting <code>removeComments</code> or having it as <code>false</code>:</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">js</div><div class='code-container'><code><span style=\"color: #008000\">/** The translation of 'Hello world' into Portuguese */</span>\n<span style=\"color: #0000FF\">export</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> helloWorldPTBR = </span><span style=\"color: #A31515\">\"Olá Mundo\"</span><span style=\"color: #000000\">;</span></code></div></pre>\n<p>This means that your comments will show up in the JavaScript code.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>removeComments</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='noEmit'><a aria-label=\"Link to the compiler option:noEmit\" title=\"Link to the compiler option:noEmit\" href='#noEmit' name='noEmit'>#</a> No Emit - <code>noEmit</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>Do not emit compiler output files like JavaScript source code, source-maps or declarations.</p>\n<p>This makes room for another tool like <a href=\"https://babeljs.io\">Babel</a>, or <a href=\"https://github.com/swc-project/swc\">swc</a> to handle converting the TypeScript file to a file which can run inside a JavaScript environment.</p>\n<p>You can then use TypeScript as a tool for providing editor integration, and as a source code type-checker.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>noEmit</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='importHelpers'><a aria-label=\"Link to the compiler option:importHelpers\" title=\"Link to the compiler option:importHelpers\" href='#importHelpers' name='importHelpers'>#</a> Import Helpers - <code>importHelpers</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>For certain downleveling operations, TypeScript uses some helper code for operations like extending class, spreading arrays or objects, and async operations.\nBy default, these helpers are inserted into files which use them.\nThis can result in code duplication if the same helper is used in many different modules.</p>\n<p>If the <code>importHelpers</code> flag is on, these helper functions are instead imported from the <a href=\"https://www.npmjs.com/package/tslib\">tslib</a> module.\nYou will need to ensure that the <code>tslib</code> module is able to be imported at runtime.\nThis only affects modules; global script files will not attempt to import modules.</p>\n<p>For example, with this TypeScript:</p>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">export</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> fn(arr: number[]) {</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> arr2 = [</span><span style=\"color: #09835A\">1</span><span style=\"color: #000000\">, ...arr];</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n<p>Turning on <a href=\"#downlevelIteration\"><code>downlevelIteration</code></a> and <code>importHelpers</code> is still false:</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">js</div><div class='code-container'><code><span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> __read = (</span><span style=\"color: #0000FF\">this</span><span style=\"color: #000000\"> && </span><span style=\"color: #0000FF\">this</span><span style=\"color: #000000\">.__read) || </span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> (o, n) {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> m = </span><span style=\"color: #0000FF\">typeof</span><span style=\"color: #000000\"> Symbol === </span><span style=\"color: #A31515\">\"function\"</span><span style=\"color: #000000\"> && o[Symbol.iterator];</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">if</span><span style=\"color: #000000\"> (!m) </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> o;</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> i = m.call(o), r, ar = [], e;</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">try</span><span style=\"color: #000000\"> {</span>\n<span style=\"color: #000000\">        </span><span style=\"color: #0000FF\">while</span><span style=\"color: #000000\"> ((n === </span><span style=\"color: #0000FF\">void</span><span style=\"color: #000000\"> </span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\"> || n-- > </span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\">) && !(r = i.next()).done) ar.push(r.value);</span>\n<span style=\"color: #000000\">    }</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">catch</span><span style=\"color: #000000\"> (error) { e = { error: error }; }</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">finally</span><span style=\"color: #000000\"> {</span>\n<span style=\"color: #000000\">        </span><span style=\"color: #0000FF\">try</span><span style=\"color: #000000\"> {</span>\n<span style=\"color: #000000\">            </span><span style=\"color: #0000FF\">if</span><span style=\"color: #000000\"> (r && !r.done && (m = i[</span><span style=\"color: #A31515\">\"return\"</span><span style=\"color: #000000\">])) m.call(i);</span>\n<span style=\"color: #000000\">        }</span>\n<span style=\"color: #000000\">        </span><span style=\"color: #0000FF\">finally</span><span style=\"color: #000000\"> { </span><span style=\"color: #0000FF\">if</span><span style=\"color: #000000\"> (e) </span><span style=\"color: #0000FF\">throw</span><span style=\"color: #000000\"> e.error; }</span>\n<span style=\"color: #000000\">    }</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> ar;</span>\n<span style=\"color: #000000\">};</span>\n<span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> __spread = (</span><span style=\"color: #0000FF\">this</span><span style=\"color: #000000\"> && </span><span style=\"color: #0000FF\">this</span><span style=\"color: #000000\">.__spread) || </span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> () {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">for</span><span style=\"color: #000000\"> (</span><span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> ar = [], i = </span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\">; i < </span><span style=\"color: #0000FF\">arguments</span><span style=\"color: #000000\">.length; i++) ar = ar.concat(__read(</span><span style=\"color: #0000FF\">arguments</span><span style=\"color: #000000\">[i]));</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> ar;</span>\n<span style=\"color: #000000\">};</span>\n<span style=\"color: #0000FF\">export</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> fn(arr) {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> arr2 = __spread([</span><span style=\"color: #09835A\">1</span><span style=\"color: #000000\">], arr);</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n<p>Then turning on both <a href=\"#downlevelIteration\"><code>downlevelIteration</code></a> and <code>importHelpers</code>:</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">js</div><div class='code-container'><code><span style=\"color: #0000FF\">import</span><span style=\"color: #000000\"> { __read, __spread } </span><span style=\"color: #0000FF\">from</span><span style=\"color: #000000\"> </span><span style=\"color: #A31515\">\"tslib\"</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #0000FF\">export</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> fn(arr) {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> arr2 = __spread([</span><span style=\"color: #09835A\">1</span><span style=\"color: #000000\">], arr);</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n<p>You can use <a href=\"#noEmitHelpers\"><code>noEmitHelpers</code></a> when you provide your own implementations of these functions.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>importHelpers</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr>\n<tr><td>Related</td><td><p><a href=\"#noEmitHelpers\"><code>noEmitHelpers</code></a>, <a href=\"#downlevelIteration\"><code>downlevelIteration</code></a>, <a href=\"#importHelpers\"><code>importHelpers</code></a></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='downlevelIteration'><a aria-label=\"Link to the compiler option:downlevelIteration\" title=\"Link to the compiler option:downlevelIteration\" href='#downlevelIteration' name='downlevelIteration'>#</a> Downlevel Iteration - <code>downlevelIteration</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>Downleveling is TypeScript’s term for transpiling to an older version of JavaScript.\nThis flag is to enable support for a more accurate implementation of how modern JavaScript iterates through new concepts in older JavaScript runtimes.</p>\n<p>ECMAScript 6 added several new iteration primitives: the <code>for / of</code> loop (<code>for (el of arr)</code>), Array spread (<code>[a, ...b]</code>), argument spread (<code>fn(...args)</code>), and <code>Symbol.iterator</code>.\n<code>--downlevelIteration</code> allows for these iteration primitives to be used more accurately in ES5 environments if a <code>Symbol.iterator</code> implementation is present.</p>\n<h4 id=\"example-effects-on-for--of\" style=\"position:relative;\"><a href=\"#example-effects-on-for--of\" aria-label=\"example effects on for  of permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Example: Effects on <code>for / of</code></h4>\n<p>Without <code>downlevelIteration</code> on, a <code>for / of</code> loop on any object is downleveled to a traditional <code>for</code> loop:</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">js</div><div class='code-container'><code><span style=\"color: #A31515\">\"use strict\"</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> str = </span><span style=\"color: #A31515\">\"Hello!\"</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #0000FF\">for</span><span style=\"color: #000000\"> (</span><span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> _i = </span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\">, str_1 = str; _i < str_1.length; _i++) {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> s = str_1[_i];</span>\n<span style=\"color: #000000\">    console.log(s);</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n<p>This is often what people expect, but it’s not 100% compliant with ECMAScript 6 behavior.\nCertain strings, such as emoji (😜), have a <code>.length</code> of 2 (or even more!), but should iterate as 1 unit in a <code>for-of</code> loop.\nSee <a href=\"https://blog.jonnew.com/posts/poo-dot-length-equals-two\">this blog post by Jonathan New</a> for a longer explanation.</p>\n<p>When <code>downlevelIteration</code> is enabled, TypeScript will use a helper function that checks for a <code>Symbol.iterator</code> implementation (either native or polyfill).\nIf this implementation is missing, you’ll fall back to index-based iteration.</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">js</div><div class='code-container'><code><span style=\"color: #A31515\">\"use strict\"</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> __values = (</span><span style=\"color: #0000FF\">this</span><span style=\"color: #000000\"> && </span><span style=\"color: #0000FF\">this</span><span style=\"color: #000000\">.__values) || </span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\">(o) {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> s = </span><span style=\"color: #0000FF\">typeof</span><span style=\"color: #000000\"> Symbol === </span><span style=\"color: #A31515\">\"function\"</span><span style=\"color: #000000\"> && Symbol.iterator, m = s && o[s], i = </span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">if</span><span style=\"color: #000000\"> (m) </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> m.call(o);</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">if</span><span style=\"color: #000000\"> (o && </span><span style=\"color: #0000FF\">typeof</span><span style=\"color: #000000\"> o.length === </span><span style=\"color: #A31515\">\"number\"</span><span style=\"color: #000000\">) </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> {</span>\n<span style=\"color: #000000\">        next: </span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> () {</span>\n<span style=\"color: #000000\">            </span><span style=\"color: #0000FF\">if</span><span style=\"color: #000000\"> (o && i >= o.length) o = </span><span style=\"color: #0000FF\">void</span><span style=\"color: #000000\"> </span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #000000\">            </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> { value: o && o[i++], done: !o };</span>\n<span style=\"color: #000000\">        }</span>\n<span style=\"color: #000000\">    };</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">throw</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">new</span><span style=\"color: #000000\"> TypeError(s ? </span><span style=\"color: #A31515\">\"Object is not iterable.\"</span><span style=\"color: #000000\"> : </span><span style=\"color: #A31515\">\"Symbol.iterator is not defined.\"</span><span style=\"color: #000000\">);</span>\n<span style=\"color: #000000\">};</span>\n<span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> e_1, _a;</span>\n<span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> str = </span><span style=\"color: #A31515\">\"Hello!\"</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #0000FF\">try</span><span style=\"color: #000000\"> {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">for</span><span style=\"color: #000000\"> (</span><span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> str_1 = __values(str), str_1_1 = str_1.next(); !str_1_1.done; str_1_1 = str_1.next()) {</span>\n<span style=\"color: #000000\">        </span><span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> s = str_1_1.value;</span>\n<span style=\"color: #000000\">        console.log(s);</span>\n<span style=\"color: #000000\">    }</span>\n<span style=\"color: #000000\">}</span>\n<span style=\"color: #0000FF\">catch</span><span style=\"color: #000000\"> (e_1_1) { e_1 = { error: e_1_1 }; }</span>\n<span style=\"color: #0000FF\">finally</span><span style=\"color: #000000\"> {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">try</span><span style=\"color: #000000\"> {</span>\n<span style=\"color: #000000\">        </span><span style=\"color: #0000FF\">if</span><span style=\"color: #000000\"> (str_1_1 && !str_1_1.done && (_a = str_1.return)) _a.call(str_1);</span>\n<span style=\"color: #000000\">    }</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">finally</span><span style=\"color: #000000\"> { </span><span style=\"color: #0000FF\">if</span><span style=\"color: #000000\"> (e_1) </span><span style=\"color: #0000FF\">throw</span><span style=\"color: #000000\"> e_1.error; }</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n<blockquote>\n<blockquote>\n<p><strong>Note:</strong> enabling <code>downlevelIteration</code> does not improve compliance if <code>Symbol.iterator</code> is not present in the runtime.</p>\n</blockquote>\n</blockquote>\n<h4 id=\"example-effects-on-array-spreads\" style=\"position:relative;\"><a href=\"#example-effects-on-array-spreads\" aria-label=\"example effects on array spreads permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Example: Effects on Array Spreads</h4>\n<p>This is an array spread:</p>\n<pre class=\"shiki\"><div class=\"language-id\">js</div><div class='code-container'><code><span style=\"color: #008000\">// Make a new array who elements are 1 followed by the elements of arr2</span>\n<span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> arr = [</span><span style=\"color: #09835A\">1</span><span style=\"color: #000000\">, ...arr2];</span></code></div></pre>\n<p>Based on the description, it sounds easy to downlevel to ES5:</p>\n<pre class=\"shiki\"><div class=\"language-id\">js</div><div class='code-container'><code><span style=\"color: #008000\">// The same, right?</span>\n<span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> arr = [</span><span style=\"color: #09835A\">1</span><span style=\"color: #000000\">].concat(arr2);</span></code></div></pre>\n<p>However, this is observably different in certain rare cases.\nFor example, if an array has a “hole” in it, the missing index will create an <em>own</em> property if spreaded, but will not if built using <code>concat</code>:</p>\n<pre class=\"shiki\"><div class=\"language-id\">js</div><div class='code-container'><code><span style=\"color: #008000\">// Make an array where the '1' element is missing</span>\n<span style=\"color: #0000FF\">let</span><span style=\"color: #000000\"> missing = [</span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\">, , </span><span style=\"color: #09835A\">1</span><span style=\"color: #000000\">];</span>\n<span style=\"color: #0000FF\">let</span><span style=\"color: #000000\"> spreaded = [...missing];</span>\n<span style=\"color: #0000FF\">let</span><span style=\"color: #000000\"> concated = [].concat(missing);</span>\n\n<span style=\"color: #008000\">// true</span>\n<span style=\"color: #A31515\">\"1\"</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">in</span><span style=\"color: #000000\"> spreaded;</span>\n<span style=\"color: #008000\">// false</span>\n<span style=\"color: #A31515\">\"1\"</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">in</span><span style=\"color: #000000\"> concated;</span></code></div></pre>\n<p>Just as with <code>for / of</code>, <code>downlevelIteration</code> will use <code>Symbol.iterator</code> (if present) to more accurately emulate ES 6 behavior.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>downlevelIteration</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr>\n<tr><td>Released</td><td><p><a href=\"/docs/handbook/release-notes/typescript-2-3.html\">2.3</a></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='isolatedModules'><a aria-label=\"Link to the compiler option:isolatedModules\" title=\"Link to the compiler option:isolatedModules\" href='#isolatedModules' name='isolatedModules'>#</a> Isolated Modules - <code>isolatedModules</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>While you can use TypeScript to produce JavaScript code from TypeScript code, it’s also common to use other transpilers such as <a href=\"https://babeljs.io\">Babel</a> to do this.\nHowever, other transpilers only operate on a single file at a time, which means they can’t apply code transforms that depend on understanding the full type system.\nThis restriction also applies to TypeScript’s <code>ts.transpileModule</code> API which is used by some build tools.</p>\n<p>These limitations can cause runtime problems with some TypeScript features like <code>const enum</code>s and <code>namespace</code>s.\nSetting the <code>isolatedModules</code> flag tells TypeScript to warn you if you write certain code that can’t be correctly interpreted by a single-file transpilation process.</p>\n<p>It does not change the behavior of your code, or otherwise change the behavior of TypeScript’s checking and emitting process.</p>\n<p>Some examples of code which does not work when <code>isolatedModules</code> is enabled.</p>\n<h4 id=\"exports-of-non-value-identifiers\" style=\"position:relative;\"><a href=\"#exports-of-non-value-identifiers\" aria-label=\"exports of non value identifiers permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Exports of Non-Value Identifiers</h4>\n<p>In TypeScript, you can import a <em>type</em> and then subsequently export it:</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">import</span><span style=\"color: #000000\"> { <span class='lsp'>someType,<span class='lsp-result'>import someType</span></span> <span class='lsp'>someFunction <span class='lsp-result'>import someFunction</span></span>} </span><span style=\"color: #0000FF\">from</span><span style=\"color: #000000\"> </span><span style=\"color: #A31515\">\"someModule\"</span><span style=\"color: #000000\">;</span>\n\n<span style=\"color: #000000\"><span class='lsp'>someFunction(<span class='lsp-result'>import someFunction</span></span>);</span>\n\n<span style=\"color: #0000FF\">export</span><span style=\"color: #000000\"> { <span class='lsp'>someType,<span class='lsp-result'>export someType</span></span> <span class='lsp'>someFunction <span class='lsp-result'>export someFunction</span></span>};</span></code></div></pre>\n<p>Because there’s no value for <code>someType</code>, the emitted <code>export</code> will not try to export it (this would be a runtime error in JavaScript):</p>\n<pre class=\"shiki\"><div class=\"language-id\">js</div><div class='code-container'><code><span style=\"color: #0000FF\">export</span><span style=\"color: #000000\"> { someFunction };</span></code></div></pre>\n<p>Single-file transpilers don’t know whether <code>someType</code> produces a value or not, so it’s an error to export a name that only refers to a type.</p>\n<h4 id=\"non-module-files\" style=\"position:relative;\"><a href=\"#non-module-files\" aria-label=\"non module files permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Non-Module Files</h4>\n<p>If <code>isolatedModules</code> is set, all implementation files must be <em>modules</em> (which means it has some form of <code>import</code>/<code>export</code>). An error occurs if any file isn’t a module:</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\"></span><span style=\"color: #000000\"> <span class='lsp'>fn(<span class='lsp-result'>function fn(): void</span></span>) {}</span>\n<span class=\"error\"><span>All files must be modules when the '--isolatedModules' flag is provided.</span><span class=\"code\">1208</span></span><span class=\"error-behind\">All files must be modules when the '--isolatedModules' flag is provided.</span></code></div></pre>\n<p>This restriction doesn’t apply to <code>.d.ts</code> files</p>\n<h4 id=\"references-to-const-enum-members\" style=\"position:relative;\"><a href=\"#references-to-const-enum-members\" aria-label=\"references to const enum members permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>References to <code>const enum</code> members</h4>\n<p>In TypeScript, when you reference a <code>const enum</code> member, the reference is replaced by its actual value in the emitted JavaScript. Changing this TypeScript:</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">declare</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">enum</span><span style=\"color: #000000\"> <span class='lsp'>Numbers <span class='lsp-result'>const enum Numbers</span></span></span>\n<span style=\"color: #000000\">  <span class='lsp'>Zero <span class='lsp-result'>(enum member) Numbers.Zero = 0</span></span>= </span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">  <span class='lsp'>One <span class='lsp-result'>(enum member) Numbers.One = 1</span></span>= </span><span style=\"color: #09835A\">1</span>\n<span style=\"color: #000000\">}</span>\n<span style=\"color: #000000\"><span class='lsp'>console.<span class='lsp-result'>var console: Console</span></span><span class='lsp'>log(<span class='lsp-result'>(method) Console.log(message?: any, ...optionalParams: any[]): void</span></span><span class='lsp'>Numbers.<span class='lsp-result'>const enum Numbers</span></span><span class='lsp'>Zero <span class='lsp-result'>(enum member) Numbers.Zero = 0</span></span>+ <span class='lsp'>Numbers.<span class='lsp-result'>const enum Numbers</span></span><span class='lsp'>One)<span class='lsp-result'>(enum member) Numbers.One = 1</span></span></span></code></div></pre>\n<p>To this JavaScript:</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">js</div><div class='code-container'><code><span style=\"color: #A31515\">\"use strict\"</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #000000\">console.log(</span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\"> + </span><span style=\"color: #09835A\">1</span><span style=\"color: #000000\">);</span></code></div></pre>\n<p>Without knowledge of the values of these members, other transpilers can’t replace the references to <code>Number</code>, which would be a runtime error if left alone (since there are no <code>Numbers</code> object at runtime).\nBecause of this, when <code>isolatedModules</code> is set, it is an error to reference an ambient <code>const enum</code> member.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>isolatedModules</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr></table>\n</div></section>\n<div class='category'>\n<h2 id='Strict_Type_Checking_Options_6173'><a href='#Strict_Type_Checking_Options_6173' name='Strict_Type_Checking_Options_6173'>#</a> Strict Checks</h2>\n<p>We recommend using the option <a href=\"#strict\"><code>strict</code></a> to opt-in to every possible improvement as they are built.</p>\n<p>TypeScript supports a wide spectrum of JavaScript patterns and defaults to allowing for quite a lot of flexibility in accommodating these styles.\nOften the safety and potential scalability of a codebase can be at odds with some of these techniques.</p>\n<p>Because of the variety of supported JavaScript, upgrading to a new version of TypeScript can uncover two types of errors:</p>\n<ul>\n<li>Errors which already exist in your codebase, which TypeScript has uncovered because the language has refined it’s understanding of JavaScript.</li>\n<li>A new suite of errors which tackle a new problem domain.</li>\n</ul>\n<p>TypeScript will usually add a compiler flag for the latter set of errors, and by default these are not enabled.</p>\n</div>\n<section class='compiler-option'>\n<h3 id='strict'><a aria-label=\"Link to the compiler option:strict\" title=\"Link to the compiler option:strict\" href='#strict' name='strict'>#</a> Strict - <code>strict</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>The <code>strict</code> flag enables a wide range of type checking behavior that results in stronger guarantees of program correctness.\nTurning this on is equivalent to enabling all of the <em>strict mode family</em> options, which are outlined below.\nYou can then turn off individual strict mode family checks as needed.</p>\n<p>Future versions of TypeScript may introduce additional stricter checking under this flag, so upgrades of TypeScript might result in new type errors in your program.\nWhen appropriate and possible, a corresponding flag will be added to disable that behavior.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>strict</p>\n<td/></tr>\n<tr><td>Recommended</td><td><p>True</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr>\n<tr><td>Related</td><td><p><a href=\"#strictBindCallApply\"><code>strictBindCallApply</code></a>, <a href=\"#strictFunctionTypes\"><code>strictFunctionTypes</code></a>, <a href=\"#strictPropertyInitialization\"><code>strictPropertyInitialization</code></a></p>\n<td/></tr>\n<tr><td>Released</td><td><p><a href=\"/docs/handbook/release-notes/typescript-2-3.html\">2.3</a></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='noImplicitAny'><a aria-label=\"Link to the compiler option:noImplicitAny\" title=\"Link to the compiler option:noImplicitAny\" href='#noImplicitAny' name='noImplicitAny'>#</a> No Implicit Any - <code>noImplicitAny</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>In some cases where no type annotations are present, TypeScript will fall back to a type of <code>any</code> for a variable when it cannot infer the type.</p>\n<p>This can cause some errors to be missed, for example:</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> <span class='lsp'>fn(<span class='lsp-result'>function fn(s: any): void</span></span><span class='lsp'>s)<span class='lsp-result'>(parameter) s: any</span></span> {</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #008000\">// No error?</span>\n<span style=\"color: #000000\">  <span class='lsp'>console.<span class='lsp-result'>var console: Console</span></span><span class='lsp'>log(<span class='lsp-result'>(method) Console.log(message?: any, ...optionalParams: any[]): void</span></span><span class='lsp'>s.<span class='lsp-result'>(parameter) s: any</span></span><span class='lsp'>subtr(<span class='lsp-result'>any</span></span></span><span style=\"color: #09835A\">3</span><span style=\"color: #000000\">));</span>\n<span style=\"color: #000000\">}</span>\n<span style=\"color: #000000\"><span class='lsp'>fn(<span class='lsp-result'>function fn(s: any): void</span></span></span><span style=\"color: #09835A\">42</span><span style=\"color: #000000\">);</span></code></div></pre>\n<p>Turning on <code>noImplicitAny</code> however TypeScript will issue an error whenever it would have inferred <code>any</code>:</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> <span class='lsp'>fn(<span class='lsp-result'>function fn(s: any): void</span></span><span class='err lsp'>s)<span class='lsp-result'>(parameter) s: any</span></span> {</span>\n<span class=\"error\"><span>Parameter 's' implicitly has an 'any' type.</span><span class=\"code\">7006</span></span><span class=\"error-behind\">Parameter 's' implicitly has an 'any' type.</span><span style=\"color: #000000\">  <span class='lsp'>console.<span class='lsp-result'>var console: Console</span></span><span class='lsp'>log(<span class='lsp-result'>(method) Console.log(message?: any, ...optionalParams: any[]): void</span></span><span class='lsp'>s.<span class='lsp-result'>(parameter) s: any</span></span><span class='lsp'>subtr(<span class='lsp-result'>any</span></span></span><span style=\"color: #09835A\">3</span><span style=\"color: #000000\">));</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>noImplicitAny</p>\n<td/></tr>\n<tr><td>Recommended</td><td><p>True</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code>, unless <code>strict</code> is set</p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='strictNullChecks'><a aria-label=\"Link to the compiler option:strictNullChecks\" title=\"Link to the compiler option:strictNullChecks\" href='#strictNullChecks' name='strictNullChecks'>#</a> Strict Null Checks - <code>strictNullChecks</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>When <code>strictNullChecks</code> is <code>false</code>, <code>null</code> and <code>undefined</code> are effectively ignored by the language.\nThis can lead to unexpected errors at runtime.</p>\n<p>When <code>strictNullChecks</code> is <code>true</code>, <code>null</code> and <code>undefined</code> have their own distinct types and you’ll get a type error if you try to use them where a concrete value is expected.</p>\n<p>For example with this TypeScript code, <code>users.find</code> has no guarantee that it will actually find a user, but you can\nwrite code as though it will:</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">declare</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> <span class='lsp'>loggedInUsername:<span class='lsp-result'>const loggedInUsername: string</span></span> string;</span>\n\n<span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> <span class='lsp'>users <span class='lsp-result'>const users: {&#13;    name: string;&#13;    age: number;&#13;}[]</span></span>= [</span>\n<span style=\"color: #000000\">  { <span class='lsp'>name:<span class='lsp-result'>(property) name: string</span></span></span><span style=\"color: #A31515\">\"Oby\"</span><span style=\"color: #000000\">, <span class='lsp'>age:<span class='lsp-result'>(property) age: number</span></span></span><span style=\"color: #09835A\">12</span><span style=\"color: #000000\"> },</span>\n<span style=\"color: #000000\">  { <span class='lsp'>name:<span class='lsp-result'>(property) name: string</span></span></span><span style=\"color: #A31515\">\"Heera\"</span><span style=\"color: #000000\">, <span class='lsp'>age:<span class='lsp-result'>(property) age: number</span></span></span><span style=\"color: #09835A\">32</span><span style=\"color: #000000\"> }</span>\n<span style=\"color: #000000\">];</span>\n\n<span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> <span class='lsp'>loggedInUser <span class='lsp-result'>const loggedInUser: {&#13;    name: string;&#13;    age: number;&#13;}</span></span>= <span class='lsp'>users.<span class='lsp-result'>const users: {&#13;    name: string;&#13;    age: number;&#13;}[]</span></span><span class='lsp'>find(<span class='lsp-result'>(method) Array&lt;{ name: string; age: number; }&gt;.find(predicate: (value: {&#13;    name: string;&#13;    age: number;&#13;}, index: number, obj: {&#13;    name: string;&#13;    age: number;&#13;}[]) =&gt; unknown, thisArg?: any): {&#13;    name: string;&#13;    age: number;&#13;} (+1 overload)</span></span><span class='lsp'>u <span class='lsp-result'>(parameter) u: {&#13;    name: string;&#13;    age: number;&#13;}</span></span></span><span style=\"color: #0000FF\">=></span><span style=\"color: #000000\"> <span class='lsp'>u.<span class='lsp-result'>(parameter) u: {&#13;    name: string;&#13;    age: number;&#13;}</span></span><span class='lsp'>name <span class='lsp-result'>(property) name: string</span></span>=== <span class='lsp'>loggedInUsername)<span class='lsp-result'>const loggedInUsername: string</span></span></span>\n<span style=\"color: #000000\"><span class='lsp'>console.<span class='lsp-result'>var console: Console</span></span><span class='lsp'>log(<span class='lsp-result'>(method) Console.log(message?: any, ...optionalParams: any[]): void</span></span><span class='lsp'>loggedInUser.<span class='lsp-result'>const loggedInUser: {&#13;    name: string;&#13;    age: number;&#13;}</span></span><span class='lsp'>age)<span class='lsp-result'>(property) age: number</span></span></span></code></div></pre>\n<p>Setting <code>strictNullChecks</code> to <code>true</code> will raise an error that you have not made a guarantee that the <code>loggedInUser</code> exists before trying to use it.</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">declare</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> <span class='lsp'>loggedInUsername:<span class='lsp-result'>const loggedInUsername: string</span></span> string;</span>\n\n<span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> <span class='lsp'>users <span class='lsp-result'>const users: {&#13;    name: string;&#13;    age: number;&#13;}[]</span></span>= [</span>\n<span style=\"color: #000000\">  { <span class='lsp'>name:<span class='lsp-result'>(property) name: string</span></span></span><span style=\"color: #A31515\">\"Oby\"</span><span style=\"color: #000000\">, <span class='lsp'>age:<span class='lsp-result'>(property) age: number</span></span></span><span style=\"color: #09835A\">12</span><span style=\"color: #000000\"> },</span>\n<span style=\"color: #000000\">  { <span class='lsp'>name:<span class='lsp-result'>(property) name: string</span></span></span><span style=\"color: #A31515\">\"Heera\"</span><span style=\"color: #000000\">, <span class='lsp'>age:<span class='lsp-result'>(property) age: number</span></span></span><span style=\"color: #09835A\">32</span><span style=\"color: #000000\"> }</span>\n<span style=\"color: #000000\">];</span>\n\n<span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> <span class='lsp'>loggedInUser <span class='lsp-result'>const loggedInUser: {&#13;    name: string;&#13;    age: number;&#13;} | undefined</span></span>= <span class='lsp'>users.<span class='lsp-result'>const users: {&#13;    name: string;&#13;    age: number;&#13;}[]</span></span><span class='lsp'>find(<span class='lsp-result'>(method) Array&lt;{ name: string; age: number; }&gt;.find(predicate: (value: {&#13;    name: string;&#13;    age: number;&#13;}, index: number, obj: {&#13;    name: string;&#13;    age: number;&#13;}[]) =&gt; unknown, thisArg?: any): {&#13;    name: string;&#13;    age: number;&#13;} | undefined (+1 overload)</span></span><span class='lsp'>u <span class='lsp-result'>(parameter) u: {&#13;    name: string;&#13;    age: number;&#13;}</span></span></span><span style=\"color: #0000FF\">=></span><span style=\"color: #000000\"> <span class='lsp'>u.<span class='lsp-result'>(parameter) u: {&#13;    name: string;&#13;    age: number;&#13;}</span></span><span class='lsp'>name <span class='lsp-result'>(property) name: string</span></span>=== <span class='lsp'>loggedInUsername)<span class='lsp-result'>const loggedInUsername: string</span></span></span>\n<span style=\"color: #000000\"><span class='lsp'>console.<span class='lsp-result'>var console: Console</span></span><span class='lsp'>log(<span class='lsp-result'>(method) Console.log(message?: any, ...optionalParams: any[]): void</span></span><span class='err lsp'>loggedInUser.<span class='lsp-result'>const loggedInUser: {&#13;    name: string;&#13;    age: number;&#13;} | undefined</span></span><span class='lsp'>age)<span class='lsp-result'>(property) age: number</span></span></span>\n<span class=\"error\"><span>Object is possibly 'undefined'.</span><span class=\"code\">2532</span></span><span class=\"error-behind\">Object is possibly 'undefined'.</span></code></div></pre>\n<p>The second example failed because the array’s <code>find</code> function looks a bit like this simplification:</p>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #008000\">// When strictNullChecks: true</span>\n<span style=\"color: #0000FF\">type</span><span style=\"color: #000000\"> Array = {</span>\n<span style=\"color: #000000\">  find(predicate: (value: any, index: number) </span><span style=\"color: #0000FF\">=&gt;</span><span style=\"color: #000000\"> boolean): S | undefined;</span>\n<span style=\"color: #000000\">};</span>\n\n<span style=\"color: #008000\">// When strictNullChecks: false the undefined is removed from the type system,</span>\n<span style=\"color: #008000\">// allowing you to write code which assumes it always found a result</span>\n<span style=\"color: #0000FF\">type</span><span style=\"color: #000000\"> Array = {</span>\n<span style=\"color: #000000\">  find(predicate: (value: any, index: number) </span><span style=\"color: #0000FF\">=&gt;</span><span style=\"color: #000000\"> boolean): S;</span>\n<span style=\"color: #000000\">};</span></code></div></pre>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>strictNullChecks</p>\n<td/></tr>\n<tr><td>Recommended</td><td><p>True</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr>\n<tr><td>Released</td><td><p><a href=\"/docs/handbook/release-notes/typescript-2-0.html\">2.0</a></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='strictFunctionTypes'><a aria-label=\"Link to the compiler option:strictFunctionTypes\" title=\"Link to the compiler option:strictFunctionTypes\" href='#strictFunctionTypes' name='strictFunctionTypes'>#</a> Strict Function Types - <code>strictFunctionTypes</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>When enabled, this flag causes functions parameters to be checked more correctly.</p>\n<p>Here’s a basic example with <code>strictFunctionTypes</code> off:</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> <span class='lsp'>fn(<span class='lsp-result'>function fn(x: string): void</span></span><span class='lsp'>x:<span class='lsp-result'>(parameter) x: string</span></span> string) {</span>\n<span style=\"color: #000000\">  <span class='lsp'>console.<span class='lsp-result'>var console: Console</span></span><span class='lsp'>log(<span class='lsp-result'>(method) Console.log(message?: any, ...optionalParams: any[]): void</span></span></span><span style=\"color: #A31515\">\"Hello, \"</span><span style=\"color: #000000\"> + <span class='lsp'>x.<span class='lsp-result'>(parameter) x: string</span></span><span class='lsp'>toLowerCase(<span class='lsp-result'>(method) String.toLowerCase(): string</span></span>));</span>\n<span style=\"color: #000000\">}</span>\n\n<span style=\"color: #0000FF\">type</span><span style=\"color: #000000\"> <span class='lsp'>StringOrNumberFunc <span class='lsp-result'>type StringOrNumberFunc = (ns: string | number) =&gt; void</span></span>= (<span class='lsp'>ns:<span class='lsp-result'>(parameter) ns: string | number</span></span> string | number) </span><span style=\"color: #0000FF\">=></span><span style=\"color: #000000\"> void;</span>\n\n<span style=\"color: #008000\">// Unsafe assignment</span>\n<span style=\"color: #0000FF\">let</span><span style=\"color: #000000\"> <span class='lsp'>func:<span class='lsp-result'>let func: StringOrNumberFunc</span></span> <span class='lsp'>StringOrNumberFunc <span class='lsp-result'>type StringOrNumberFunc = (ns: string | number) =&gt; void</span></span>= <span class='lsp'>fn;<span class='lsp-result'>function fn(x: string): void</span></span></span>\n<span style=\"color: #008000\">// Unsafe call - will crash</span>\n<span style=\"color: #000000\"><span class='lsp'>func(<span class='lsp-result'>let func: (ns: string | number) =&gt; void</span></span></span><span style=\"color: #09835A\">10</span><span style=\"color: #000000\">);</span></code></div></pre>\n<p>With <code>strictFunctionTypes</code> <em>on</em>, the error is correctly detected:</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> <span class='lsp'>fn(<span class='lsp-result'>function fn(x: string): void</span></span><span class='lsp'>x:<span class='lsp-result'>(parameter) x: string</span></span> string) {</span>\n<span style=\"color: #000000\">  <span class='lsp'>console.<span class='lsp-result'>var console: Console</span></span><span class='lsp'>log(<span class='lsp-result'>(method) Console.log(message?: any, ...optionalParams: any[]): void</span></span></span><span style=\"color: #A31515\">\"Hello, \"</span><span style=\"color: #000000\"> + <span class='lsp'>x.<span class='lsp-result'>(parameter) x: string</span></span><span class='lsp'>toLowerCase(<span class='lsp-result'>(method) String.toLowerCase(): string</span></span>));</span>\n<span style=\"color: #000000\">}</span>\n\n<span style=\"color: #0000FF\">type</span><span style=\"color: #000000\"> <span class='lsp'>StringOrNumberFunc <span class='lsp-result'>type StringOrNumberFunc = (ns: string | number) =&gt; void</span></span>= (<span class='lsp'>ns:<span class='lsp-result'>(parameter) ns: string | number</span></span> string | number) </span><span style=\"color: #0000FF\">=></span><span style=\"color: #000000\"> void;</span>\n\n<span style=\"color: #008000\">// Unsafe assignment is prevented</span>\n<span style=\"color: #0000FF\">let</span><span style=\"color: #000000\"> <span class='err lsp'>func:<span class='lsp-result'>let func: StringOrNumberFunc</span></span> <span class='lsp'>StringOrNumberFunc <span class='lsp-result'>type StringOrNumberFunc = (ns: string | number) =&gt; void</span></span>= <span class='lsp'>fn;<span class='lsp-result'>function fn(x: string): void</span></span></span>\n<span class=\"error\"><span>Type '(x: string) =&gt; void' is not assignable to type 'StringOrNumberFunc'.\n  Types of parameters 'x' and 'ns' are incompatible.\n    Type 'string | number' is not assignable to type 'string'.\n      Type 'number' is not assignable to type 'string'.</span><span class=\"code\">2322</span></span><span class=\"error-behind\">Type '(x: string) =&gt; void' is not assignable to type 'StringOrNumberFunc'.\n  Types of parameters 'x' and 'ns' are incompatible.\n    Type 'string | number' is not assignable to type 'string'.\n      Type 'number' is not assignable to type 'string'.</span></code></div></pre>\n<p>During development of this feature, we discovered a large number of inherently unsafe class hierarchies, including some in the DOM.\nBecause of this, the setting only applies to functions written in <em>function</em> syntax, not to those in <em>method</em> syntax:</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">type</span><span style=\"color: #000000\"> <span class='lsp'>Methodish <span class='lsp-result'>type Methodish = {&#13;    func(x: string | number): void;&#13;}</span></span>= {</span>\n<span style=\"color: #000000\">  <span class='lsp'>func(<span class='lsp-result'>(method) func(x: string | number): void</span></span><span class='lsp'>x:<span class='lsp-result'>(parameter) x: string | number</span></span> string | number): void;</span>\n<span style=\"color: #000000\">};</span>\n\n<span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> <span class='lsp'>fn(<span class='lsp-result'>function fn(x: string): void</span></span><span class='lsp'>x:<span class='lsp-result'>(parameter) x: string</span></span> string) {</span>\n<span style=\"color: #000000\">  <span class='lsp'>console.<span class='lsp-result'>var console: Console</span></span><span class='lsp'>log(<span class='lsp-result'>(method) Console.log(message?: any, ...optionalParams: any[]): void</span></span></span><span style=\"color: #A31515\">\"Hello, \"</span><span style=\"color: #000000\"> + <span class='lsp'>x.<span class='lsp-result'>(parameter) x: string</span></span><span class='lsp'>toLowerCase(<span class='lsp-result'>(method) String.toLowerCase(): string</span></span>));</span>\n<span style=\"color: #000000\">}</span>\n\n<span style=\"color: #008000\">// Ultimately an unsafe assignment, but not detected</span>\n<span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> <span class='lsp'>m:<span class='lsp-result'>const m: Methodish</span></span> <span class='lsp'>Methodish <span class='lsp-result'>type Methodish = {&#13;    func(x: string | number): void;&#13;}</span></span>= {</span>\n<span style=\"color: #000000\">  <span class='lsp'>func:<span class='lsp-result'>(method) func(x: string | number): void</span></span> <span class='lsp'>fn<span class='lsp-result'>function fn(x: string): void</span></span></span>\n<span style=\"color: #000000\">};</span>\n<span style=\"color: #000000\"><span class='lsp'>m.<span class='lsp-result'>const m: Methodish</span></span><span class='lsp'>func(<span class='lsp-result'>(method) func(x: string | number): void</span></span></span><span style=\"color: #09835A\">10</span><span style=\"color: #000000\">);</span></code></div></pre>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>strictFunctionTypes</p>\n<td/></tr>\n<tr><td>Recommended</td><td><p>True</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr>\n<tr><td>Released</td><td><p><a href=\"/docs/handbook/release-notes/typescript-2-6.html\">2.6</a></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='strictBindCallApply'><a aria-label=\"Link to the compiler option:strictBindCallApply\" title=\"Link to the compiler option:strictBindCallApply\" href='#strictBindCallApply' name='strictBindCallApply'>#</a> Strict Bind Call Apply - <code>strictBindCallApply</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>When set, TypeScript will check that the built-in methods of functions <code>call</code>, <code>bind</code>, and <code>apply</code> are invoked with correct argument for the underlying function:</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #008000\">// With strictBindCallApply on</span>\n<span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> <span class='lsp'>fn(<span class='lsp-result'>function fn(x: string): number</span></span><span class='lsp'>x:<span class='lsp-result'>(parameter) x: string</span></span> string) {</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> <span class='lsp'>parseInt(<span class='lsp-result'>function parseInt(s: string, radix?: number | undefined): number</span></span><span class='lsp'>x)<span class='lsp-result'>(parameter) x: string</span></span></span>\n<span style=\"color: #000000\">}</span>\n\n<span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> <span class='lsp'>n1 <span class='lsp-result'>const n1: number</span></span>= <span class='lsp'>fn.<span class='lsp-result'>function fn(x: string): number</span></span><span class='lsp'>call(<span class='lsp-result'>(method) CallableFunction.call&lt;undefined, [string], number&gt;(this: (this: undefined, args_0: string) =&gt; number, thisArg: undefined, args_0: string): number</span></span></span><span style=\"color: #0000FF\"><span class='lsp'>undefined<span class='lsp-result'>var undefined</span></span></span><span style=\"color: #000000\">, </span><span style=\"color: #A31515\">\"10\"</span><span style=\"color: #000000\">);</span>\n\n<span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> <span class='lsp'>n2 <span class='lsp-result'>const n2: number</span></span>= <span class='lsp'>fn.<span class='lsp-result'>function fn(x: string): number</span></span><span class='lsp'>call(<span class='lsp-result'>(method) CallableFunction.call&lt;undefined, [string], number&gt;(this: (this: undefined, x: string) =&gt; number, thisArg: undefined, x: string): number</span></span></span><span style=\"color: #0000FF\"><span class='lsp'>undefined<span class='lsp-result'>var undefined</span></span></span><span style=\"color: #000000\">, </span><span style=\"color: #0000FF\"><span class='err'>false</span></span><span style=\"color: #000000\">);</span>\n<span class=\"error\"><span>Argument of type 'false' is not assignable to parameter of type 'string'.</span><span class=\"code\">2345</span></span><span class=\"error-behind\">Argument of type 'false' is not assignable to parameter of type 'string'.</span></code></div></pre>\n<p>Otherwise, these functions accept any arguments and will return <code>any</code>:</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #008000\">// With strictBindCallApply off</span>\n<span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> <span class='lsp'>fn(<span class='lsp-result'>function fn(x: string): number</span></span><span class='lsp'>x:<span class='lsp-result'>(parameter) x: string</span></span> string) {</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> <span class='lsp'>parseInt(<span class='lsp-result'>function parseInt(s: string, radix?: number | undefined): number</span></span><span class='lsp'>x)<span class='lsp-result'>(parameter) x: string</span></span></span>\n<span style=\"color: #000000\">}</span>\n\n<span style=\"color: #008000\">// Note: No error; return type is 'any'</span>\n<span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> <span class='lsp'>n <span class='lsp-result'>const n: any</span></span>= <span class='lsp'>fn.<span class='lsp-result'>function fn(x: string): number</span></span><span class='lsp'>call(<span class='lsp-result'>(method) Function.call(this: Function, thisArg: any, ...argArray: any[]): any</span></span></span><span style=\"color: #0000FF\"><span class='lsp'>undefined<span class='lsp-result'>var undefined</span></span></span><span style=\"color: #000000\">, </span><span style=\"color: #0000FF\">false</span><span style=\"color: #000000\">);</span></code></div></pre>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>strictBindCallApply</p>\n<td/></tr>\n<tr><td>Recommended</td><td><p>True</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr>\n<tr><td>Released</td><td><p><a href=\"/docs/handbook/release-notes/typescript-3-2.html\">3.2</a></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='strictPropertyInitialization'><a aria-label=\"Link to the compiler option:strictPropertyInitialization\" title=\"Link to the compiler option:strictPropertyInitialization\" href='#strictPropertyInitialization' name='strictPropertyInitialization'>#</a> Strict Property Initialization - <code>strictPropertyInitialization</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>When set to true, TypeScript will raise an error when a class property was declared but not set in the constructor.</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">class</span><span style=\"color: #000000\"> <span class='lsp'>UserAccount <span class='lsp-result'>class UserAccount</span></span></span>\n<span style=\"color: #000000\">  <span class='lsp'>name:<span class='lsp-result'>(property) UserAccount.name: string</span></span> string;</span>\n<span style=\"color: #000000\">  <span class='lsp'>accountType <span class='lsp-result'>(property) UserAccount.accountType: string</span></span>= </span><span style=\"color: #A31515\">\"user\"</span><span style=\"color: #000000\">;</span>\n\n<span style=\"color: #000000\">  <span class='err lsp'>email:<span class='lsp-result'>(property) UserAccount.email: string</span></span> string;</span>\n<span class=\"error\"><span>Property 'email' has no initializer and is not definitely assigned in the constructor.</span><span class=\"code\">2564</span></span><span class=\"error-behind\">Property 'email' has no initializer and is not definitely assigned in the constructor.</span><span style=\"color: #000000\">  <span class='lsp'>address:<span class='lsp-result'>(property) UserAccount.address: string | undefined</span></span> string | undefined;</span>\n\n<span style=\"color: #000000\">  </span><span style=\"color: #0000FF\">constructor</span><span style=\"color: #000000\">(<span class='lsp'>name:<span class='lsp-result'>(parameter) name: string</span></span> string) {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">this</span><span style=\"color: #000000\">.<span class='lsp'>name <span class='lsp-result'>(property) UserAccount.name: string</span></span>= <span class='lsp'>name;<span class='lsp-result'>(parameter) name: string</span></span></span>\n<span style=\"color: #000000\">    </span><span style=\"color: #008000\">// Note that this.email is not set</span>\n<span style=\"color: #000000\">  }</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n<p>In the above case:</p>\n<ul>\n<li><code>this.name</code> is set specifically.</li>\n<li><code>this.accountType</code> is set by default.</li>\n<li><code>this.email</code> is not set and raises an error.</li>\n<li><code>this.address</code> is declared as potentially <code>undefined</code> which means it does not have to be set.</li>\n</ul>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>strictPropertyInitialization</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr>\n<tr><td>Released</td><td><p><a href=\"/docs/handbook/release-notes/typescript-2-7.html\">2.7</a></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='noImplicitThis'><a aria-label=\"Link to the compiler option:noImplicitThis\" title=\"Link to the compiler option:noImplicitThis\" href='#noImplicitThis' name='noImplicitThis'>#</a> No Implicit This - <code>noImplicitThis</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>Raise error on ‘this’ expressions with an implied ‘any’ type.</p>\n<p>For example, the class below returns a function which tries to access <code>this.width</code> and <code>this.height</code> – but the context\nfor <code>this</code> inside the function inside <code>getAreaFunction</code> is not the instance of the Rectangle.</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">class</span><span style=\"color: #000000\"> <span class='lsp'>Rectangle <span class='lsp-result'>class Rectangle</span></span></span>\n<span style=\"color: #000000\">  <span class='lsp'>width:<span class='lsp-result'>(property) Rectangle.width: number</span></span> number;</span>\n<span style=\"color: #000000\">  <span class='lsp'>height:<span class='lsp-result'>(property) Rectangle.height: number</span></span> number;</span>\n\n<span style=\"color: #000000\">  </span><span style=\"color: #0000FF\">constructor</span><span style=\"color: #000000\">(<span class='lsp'>width:<span class='lsp-result'>(parameter) width: number</span></span> number, <span class='lsp'>height:<span class='lsp-result'>(parameter) height: number</span></span> number) {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">this</span><span style=\"color: #000000\">.<span class='lsp'>width <span class='lsp-result'>(property) Rectangle.width: number</span></span>= <span class='lsp'>width;<span class='lsp-result'>(parameter) width: number</span></span></span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">this</span><span style=\"color: #000000\">.<span class='lsp'>height <span class='lsp-result'>(property) Rectangle.height: number</span></span>= <span class='lsp'>height;<span class='lsp-result'>(parameter) height: number</span></span></span>\n<span style=\"color: #000000\">  }</span>\n\n<span style=\"color: #000000\">  <span class='lsp'>getAreaFunction(<span class='lsp-result'>(method) Rectangle.getAreaFunction(): () =&gt; number</span></span>) {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\">() {</span>\n<span style=\"color: #000000\">      </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\"><span class='err'>this</span></span><span style=\"color: #000000\">.<span class='lsp'>width <span class='lsp-result'>any</span></span>* </span><span style=\"color: #0000FF\"><span class='err'>this</span></span><span style=\"color: #000000\">.<span class='lsp'>height;<span class='lsp-result'>any</span></span></span>\n<span class=\"error\"><span>'this' implicitly has type 'any' because it does not have a type annotation.</br>'this' implicitly has type 'any' because it does not have a type annotation.</span><span class=\"code\">2683<br/>2683</span></span><span class=\"error-behind\">'this' implicitly has type 'any' because it does not have a type annotation.</br>'this' implicitly has type 'any' because it does not have a type annotation.</span><span style=\"color: #000000\">    };</span>\n<span style=\"color: #000000\">  }</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>noImplicitThis</p>\n<td/></tr>\n<tr><td>Recommended</td><td><p>True</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code>, unless <code>strict</code> is set</p>\n<td/></tr>\n<tr><td>Released</td><td><p><a href=\"/docs/handbook/release-notes/typescript-2-0.html\">2.0</a></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='alwaysStrict'><a aria-label=\"Link to the compiler option:alwaysStrict\" title=\"Link to the compiler option:alwaysStrict\" href='#alwaysStrict' name='alwaysStrict'>#</a> Always Strict - <code>alwaysStrict</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>Ensures that your files are parsed in the ECMAScript strict mode, and emit “use strict” for each source file.</p>\n<p><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode\">ECMAScript strict</a> mode was introduced in ES5 and provides behavior tweaks to the runtime of the JavaScript engine to improve performance, and makes a set of errors throw instead of silently ignoring them.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>alwaysStrict</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code>, unless <code>strict</code> is set</p>\n<td/></tr>\n<tr><td>Released</td><td><p><a href=\"/docs/handbook/release-notes/typescript-2-1.html\">2.1</a></p>\n<td/></tr></table>\n</div></section>\n<div class='category'>\n<h2 id='Module_Resolution_Options_6174'><a href='#Module_Resolution_Options_6174' name='Module_Resolution_Options_6174'>#</a> Module Resolution</h2>\n</div>\n<section class='compiler-option'>\n<h3 id='moduleResolution'><a aria-label=\"Link to the compiler option:moduleResolution\" title=\"Link to the compiler option:moduleResolution\" href='#moduleResolution' name='moduleResolution'>#</a> Module Resolution - <code>moduleResolution</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>Specify module resolution strategy: ‘node’ (Node.js) or ‘classic’ (TypeScript pre-1.6). You probably won’t need to use this.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>moduleResolution</p>\n<td/></tr>\n<tr><td>Status</td><td><p>Deprecated</p>\n<td/></tr>\n<tr><td>Status</td><td><p>Deprecated</p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='baseUrl'><a aria-label=\"Link to the compiler option:baseUrl\" title=\"Link to the compiler option:baseUrl\" href='#baseUrl' name='baseUrl'>#</a> Base Url - <code>baseUrl</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>Lets you set a base directory to resolve non-absolute module names.</p>\n<p>You can define a root folder where you can do absolute file resolution. E.g.</p>\n<pre><code>baseUrl\n├── ex.ts\n├── hello\n│   └── world.ts\n└── tsconfig.json\n</code></pre>\n<p>With <code>\"baseUrl\": \"./\"</code> inside this project TypeScript will look for files starting at the same folder as the <code>tsconfig.json</code>.</p>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">import</span><span style=\"color: #000000\"> { helloWorld } </span><span style=\"color: #0000FF\">from</span><span style=\"color: #000000\"> </span><span style=\"color: #A31515\">\"hello/world\"</span><span style=\"color: #000000\">;</span>\n\n<span style=\"color: #000000\">console.log(helloWorld);</span></code></div></pre>\n<p>If you get tired of imports always looking like <code>\"../\"</code> or <code>\"./\"</code>. Or needing\nto change as you move files, this is a great way to fix that.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>baseUrl</p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='paths'><a aria-label=\"Link to the compiler option:paths\" title=\"Link to the compiler option:paths\" href='#paths' name='paths'>#</a> Paths - <code>paths</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>A series of entries which re-map imports to lookup locations relative to the <code>baseUrl</code>, there is a larger coverage of <code>paths</code> in <a href=\"/docs/handbook/module-resolution.html#path-mapping\">the handbook</a>.</p>\n<p><code>paths</code> lets you declare how TypeScript should resolve an import in your <code>require</code>/<code>import</code>s.</p>\n<pre class=\"shiki\"><div class=\"language-id\">json</div><div class='code-container'><code><span style=\"color: #000000\">{</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0451A5\">\"compilerOptions\"</span><span style=\"color: #000000\">: {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0451A5\">\"baseUrl\"</span><span style=\"color: #000000\">: </span><span style=\"color: #A31515\">\".\"</span><span style=\"color: #000000\">, </span><span style=\"color: #008000\">// this must be specified if \"paths\" is specified.</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0451A5\">\"paths\"</span><span style=\"color: #000000\">: {</span>\n<span style=\"color: #000000\">      </span><span style=\"color: #0451A5\">\"jquery\"</span><span style=\"color: #000000\">: [</span><span style=\"color: #A31515\">\"node_modules/jquery/dist/jquery\"</span><span style=\"color: #000000\">] </span><span style=\"color: #008000\">// this mapping is relative to \"baseUrl\"</span>\n<span style=\"color: #000000\">    }</span>\n<span style=\"color: #000000\">  }</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n<p>This would allow you to be able to write <code>import \"jquery\"</code>, and get all of the correct typing locally.</p>\n<pre class=\"shiki\"><div class=\"language-id\">json</div><div class='code-container'><code><span style=\"color: #000000\">{</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0451A5\">\"compilerOptions\"</span><span style=\"color: #000000\">: {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0451A5\">\"baseUrl\"</span><span style=\"color: #000000\">: </span><span style=\"color: #A31515\">\"src\"</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0451A5\">\"paths\"</span><span style=\"color: #000000\">: {</span>\n<span style=\"color: #000000\">        </span><span style=\"color: #0451A5\">\"app/*\"</span><span style=\"color: #000000\">: [</span><span style=\"color: #A31515\">\"app/*\"</span><span style=\"color: #000000\">],</span>\n<span style=\"color: #000000\">        </span><span style=\"color: #0451A5\">\"config/*\"</span><span style=\"color: #000000\">: [</span><span style=\"color: #A31515\">\"app/_config/*\"</span><span style=\"color: #000000\">],</span>\n<span style=\"color: #000000\">        </span><span style=\"color: #0451A5\">\"environment/*\"</span><span style=\"color: #000000\">: [</span><span style=\"color: #A31515\">\"environments/*\"</span><span style=\"color: #000000\">],</span>\n<span style=\"color: #000000\">        </span><span style=\"color: #0451A5\">\"shared/*\"</span><span style=\"color: #000000\">: [</span><span style=\"color: #A31515\">\"app/_shared/*\"</span><span style=\"color: #000000\">],</span>\n<span style=\"color: #000000\">        </span><span style=\"color: #0451A5\">\"helpers/*\"</span><span style=\"color: #000000\">: [</span><span style=\"color: #A31515\">\"helpers/*\"</span><span style=\"color: #000000\">],</span>\n<span style=\"color: #000000\">        </span><span style=\"color: #0451A5\">\"tests/*\"</span><span style=\"color: #000000\">: [</span><span style=\"color: #A31515\">\"tests/*\"</span><span style=\"color: #000000\">]</span>\n<span style=\"color: #000000\">    },</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n<p>In this case, you can tell the TypeScript file resolver to support a number of custom prefixes to find code.\nThis pattern can be used to avoid long relative paths within your codebase.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>paths</p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='rootDirs'><a aria-label=\"Link to the compiler option:rootDirs\" title=\"Link to the compiler option:rootDirs\" href='#rootDirs' name='rootDirs'>#</a> Root Dirs - <code>rootDirs</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>Using <code>rootDirs</code>, you can inform the compiler that there are many “virtual” directories acting as a single root.\nThis allows the compiler to resolve relative module imports within these “virtual” directories, as if they were merged in to one directory.</p>\n<p>For example:</p>\n<pre><code> src\n └── views\n     └── view1.ts (can import \"./template1\", \"./view2`)\n     └── view2.ts (can import \"./template1\", \"./view1`)\n\n generated\n └── templates\n         └── views\n             └── template1.ts (can import \"./view1\", \"./view2\")\n</code></pre>\n<pre class=\"shiki\"><div class=\"language-id\">json</div><div class='code-container'><code><span style=\"color: #000000\">{</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0451A5\">\"compilerOptions\"</span><span style=\"color: #000000\">: {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0451A5\">\"rootDirs\"</span><span style=\"color: #000000\">: [</span><span style=\"color: #A31515\">\"src/views\"</span><span style=\"color: #000000\">, </span><span style=\"color: #A31515\">\"generated/templates/views\"</span><span style=\"color: #000000\">]</span>\n<span style=\"color: #000000\">  }</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n<p>This does not affect how TypeScript emits JavaScript, it only emulates the assumption that they will be able to\nwork via those relative paths at runtime.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>rootDirs</p>\n<td/></tr>\n<tr><td>Released</td><td><p><a href=\"/docs/handbook/release-notes/typescript-2-0.html\">2.0</a></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='typeRoots'><a aria-label=\"Link to the compiler option:typeRoots\" title=\"Link to the compiler option:typeRoots\" href='#typeRoots' name='typeRoots'>#</a> Type Roots - <code>typeRoots</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>By default all <em>visible</em> ”<code>@types</code>” packages are included in your compilation.\nPackages in <code>node_modules/@types</code> of any enclosing folder are considered <em>visible</em>.\nFor example, that means packages within <code>./node_modules/@types/</code>, <code>../node_modules/@types/</code>, <code>../../node_modules/@types/</code>, and so on.</p>\n<p>If <code>typeRoots</code> is specified, <em>only</em> packages under <code>typeRoots</code> will be included. For example:</p>\n<pre class=\"shiki\"><div class=\"language-id\">json</div><div class='code-container'><code><span style=\"color: #000000\">{</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0451A5\">\"compilerOptions\"</span><span style=\"color: #000000\">: {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0451A5\">\"typeRoots\"</span><span style=\"color: #000000\">: [</span><span style=\"color: #A31515\">\"./typings\"</span><span style=\"color: #000000\">, </span><span style=\"color: #A31515\">\"./vendor/types\"</span><span style=\"color: #000000\">]</span>\n<span style=\"color: #000000\">  }</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n<p>This config file will include <em>all</em> packages under <code>./typings</code> and <code>./vendor/types</code>, and no packages from <code>./node_modules/@types</code>.\nAll paths are relative to the <code>tsconfig.json</code>.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>typeRoots</p>\n<td/></tr>\n<tr><td>Related</td><td><p><a href=\"#types\"><code>types</code></a></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='types'><a aria-label=\"Link to the compiler option:types\" title=\"Link to the compiler option:types\" href='#types' name='types'>#</a> Types - <code>types</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>By default all <em>visible</em> ”<code>@types</code>” packages are included in your compilation.\nPackages in <code>node_modules/@types</code> of any enclosing folder are considered <em>visible</em>.\nFor example, that means packages within <code>./node_modules/@types/</code>, <code>../node_modules/@types/</code>, <code>../../node_modules/@types/</code>, and so on.</p>\n<p>If <code>types</code> is specified, only packages listed will be included. For instance:</p>\n<pre class=\"shiki\"><div class=\"language-id\">json</div><div class='code-container'><code><span style=\"color: #000000\">{</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0451A5\">\"compilerOptions\"</span><span style=\"color: #000000\">: {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0451A5\">\"types\"</span><span style=\"color: #000000\">: [</span><span style=\"color: #A31515\">\"node\"</span><span style=\"color: #000000\">, </span><span style=\"color: #A31515\">\"lodash\"</span><span style=\"color: #000000\">, </span><span style=\"color: #A31515\">\"express\"</span><span style=\"color: #000000\">]</span>\n<span style=\"color: #000000\">  }</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n<p>This <code>tsconfig.json</code> file will <em>only</em> include <code>./node_modules/@types/node</code>, <code>./node_modules/@types/lodash</code> and <code>./node_modules/@types/express</code>.\nOther packages under <code>node_modules/@types/*</code> will not be included.</p>\n<p>This feature differs from <a href=\"#typeRoots\"><code>typeRoots</code></a> in that it is about specifying only the exact types you want included, whereas <a href=\"#typeRoots\"><code>typeRoots</code></a> supports saying you want particular folders.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>types</p>\n<td/></tr>\n<tr><td>Related</td><td><p><a href=\"#typeRoots\"><code>typeRoots</code></a></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='allowSyntheticDefaultImports'><a aria-label=\"Link to the compiler option:allowSyntheticDefaultImports\" title=\"Link to the compiler option:allowSyntheticDefaultImports\" href='#allowSyntheticDefaultImports' name='allowSyntheticDefaultImports'>#</a> Allow Synthetic Default Imports - <code>allowSyntheticDefaultImports</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>When set to true, <code>allowSyntheticDefaultImports</code> let’s you write an import like:</p>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">import</span><span style=\"color: #000000\"> React </span><span style=\"color: #0000FF\">from</span><span style=\"color: #000000\"> </span><span style=\"color: #A31515\">\"react\"</span><span style=\"color: #000000\">;</span></code></div></pre>\n<p>instead of:</p>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">import</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">*</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">as</span><span style=\"color: #000000\"> React </span><span style=\"color: #0000FF\">from</span><span style=\"color: #000000\"> </span><span style=\"color: #A31515\">\"react\"</span><span style=\"color: #000000\">;</span></code></div></pre>\n<p>When the module <strong>does not</strong> specify a default export.</p>\n<p>This does not affect the JavaScript emitted by TypeScript, it only for the type checking.\nThis option brings the behavior of TypeScript in-line with Babel, where extra code is emitted to make using a default export of a module more ergonomic.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>allowSyntheticDefaultImports</p>\n<td/></tr>\n<tr><td>Default</td><td><p>module === \"system\" or esModuleInterop</p>\n<td/></tr>\n<tr><td>Related</td><td><p><a href=\"#esModuleInterop\"><code>esModuleInterop</code></a></p>\n<td/></tr>\n<tr><td>Released</td><td><p><a href=\"/docs/handbook/release-notes/typescript-1-8.html\">1.8</a></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='esModuleInterop'><a aria-label=\"Link to the compiler option:esModuleInterop\" title=\"Link to the compiler option:esModuleInterop\" href='#esModuleInterop' name='esModuleInterop'>#</a> ES Module Interop - <code>esModuleInterop</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports.</p>\n<p>TypeScript adheres to the EcmaScript standard for modules, which means that a file with exports would have to specifically\ninclude a <code>default</code> export in order to support syntax like <code>import React from \"react\"</code>.\nThis export pattern is rare in modules for CommonJS. For example, without <code>esModuleInterop</code> as true:</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #008000\">// @filename: utilFunctions.js</span>\n<span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> getStringLength = str </span><span style=\"color: #0000FF\">=></span><span style=\"color: #000000\"> str.length;</span>\n\n<span style=\"color: #000000\"><span class='lsp'>ports =<span class='lsp-result'>any</span></span><span class='lsp'>module.<span class='lsp-result'>module export=&#13;(property) export=: {&#13;    getStringLength: (str: any) =&gt; any;&#13;}</span></span>exports = {</span>\n<span style=\"color: #000000\"><span class='lsp'>StringLe<span class='lsp-result'>module export=&#13;(property) export=: {&#13;    getStringLength: (str: any) =&gt; any;&#13;}</span></span>ngth</span>\n<span style=\"color: #000000\">};</span>\n\n<span style=\"color: #008000\">// @filename: index.ts</span>\n<span style=\"color: #0000FF\">import</span><span style=\"color: #000000\"> utils </span><span style=\"color: #0000FF\">from</span><span style=\"color: #000000\"> </span><span style=\"color: #A31515\">\"./utilFunctions\"</span><span style=\"color: #000000\">;</span>\n\n<span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> count = utils.getStringLength(</span><span style=\"color: #A31515\">\"Check JS\"</span><span style=\"color: #000000\">);</span></code></div></pre>\n<p>This won’t work because there isn’t a <code>default</code> object which you can import. Even though it feels like it should.\nFor convenience, transpilers like Babel will automatically create a default if one isn’t created. Making the module look a bit more like:</p>\n<pre class=\"shiki\"><div class=\"language-id\">js</div><div class='code-container'><code><span style=\"color: #008000\">// @filename: utilFunctions.js</span>\n<span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> getStringLength = str </span><span style=\"color: #0000FF\">=&gt;</span><span style=\"color: #000000\"> str.length;</span>\n<span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> allFunctions = {</span>\n<span style=\"color: #000000\">  getStringLength</span>\n<span style=\"color: #000000\">};</span>\n\n<span style=\"color: #000000\">module.exports = allFunctions;</span></code></div></pre>\n<p>Turning on this compiler flag will also enable <a href=\"#allowSyntheticDefaultImports\"><code>allowSyntheticDefaultImports</code></a>.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>esModuleInterop</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr>\n<tr><td>Related</td><td><p><a href=\"#allowSyntheticDefaultImports\"><code>allowSyntheticDefaultImports</code></a></p>\n<td/></tr>\n<tr><td>Released</td><td><p><a href=\"/docs/handbook/release-notes/typescript-2-7.html\">2.7</a></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='preserveSymlinks'><a aria-label=\"Link to the compiler option:preserveSymlinks\" title=\"Link to the compiler option:preserveSymlinks\" href='#preserveSymlinks' name='preserveSymlinks'>#</a> Preserve Symlinks - <code>preserveSymlinks</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>This is to reflect the same flag in Node.js; which does not resolve the real path of symlinks.</p>\n<p>This flag also exhibits the opposite behavior to Webpack’s <code>resolve.symlinks</code> option (i.e. setting TypeScript’s <code>preserveSymlinks</code> to true parallels setting Webpack’s <code>resolve.symlinks</code> to false, and vice-versa).</p>\n<p>With this enabled, references to modules and packages (e.g. <code>import</code>s and <code>/// &#x3C;reference type=\"...\" /></code> directives) are all resolved relative to the location of the symbolic link file, rather than relative to the path that the symbolic link resolves to.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>preserveSymlinks</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='allowUmdGlobalAccess'><a aria-label=\"Link to the compiler option:allowUmdGlobalAccess\" title=\"Link to the compiler option:allowUmdGlobalAccess\" href='#allowUmdGlobalAccess' name='allowUmdGlobalAccess'>#</a> Allow Umd Global Access - <code>allowUmdGlobalAccess</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>When set to true, <code>allowUmdGlobalAccess</code> lets you access UMD exports as globals from inside module files. A module file is a file that has imports and/or exports. Without this flag, using an export from a UMD module requires an import declaration.</p>\n<p>An example use case for this flag would be a web project where you know the particular library (like jQuery or Lodash) will always be available at runtime, but you can’t access it with an import.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>allowUmdGlobalAccess</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr>\n<tr><td>Released</td><td><p><a href=\"/docs/handbook/release-notes/typescript-3-5.html\">3.5</a></p>\n<td/></tr></table>\n</div></section>\n<div class='category'>\n<h2 id='Source_Map_Options_6175'><a href='#Source_Map_Options_6175' name='Source_Map_Options_6175'>#</a> Source Maps</h2>\n<p>In order to provide rich debugging tools and crash reports which make sense to developers, TypeScript supports\nemitting additional files which conform to the JavaScript Source Map standards.</p>\n<p>These are emitted as <code>.map</code> files which live alongside the file they represent.</p>\n</div>\n<section class='compiler-option'>\n<h3 id='sourceRoot'><a aria-label=\"Link to the compiler option:sourceRoot\" title=\"Link to the compiler option:sourceRoot\" href='#sourceRoot' name='sourceRoot'>#</a> Source Root - <code>sourceRoot</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>Specify the location where a debugger should locate TypeScript files instead of relative source locations.\nThis string is treated verbatim inside the source-map where you can use a path or a URL:</p>\n<pre class=\"shiki\"><div class=\"language-id\">json</div><div class='code-container'><code><span style=\"color: #000000\">{</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0451A5\">\"compilerOptions\"</span><span style=\"color: #000000\">: {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0451A5\">\"sourceMap\"</span><span style=\"color: #000000\">: </span><span style=\"color: #0000FF\">true</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0451A5\">\"sourceRoot\"</span><span style=\"color: #000000\">: </span><span style=\"color: #A31515\">\"https://my-website.com/debug/source/\"</span>\n<span style=\"color: #000000\">  }</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n<p>Would declare that <code>index.js</code> will have a source file at <code>https://my-website.com/debug/source/index.ts</code>.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>sourceRoot</p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='mapRoot'><a aria-label=\"Link to the compiler option:mapRoot\" title=\"Link to the compiler option:mapRoot\" href='#mapRoot' name='mapRoot'>#</a> Map Root - <code>mapRoot</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>Specify the location where debugger should locate map files instead of generated locations.\nThis string is treated verbatim inside the source-map, for example:</p>\n<pre class=\"shiki\"><div class=\"language-id\">json</div><div class='code-container'><code><span style=\"color: #000000\">{</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0451A5\">\"compilerOptions\"</span><span style=\"color: #000000\">: {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0451A5\">\"sourceMap\"</span><span style=\"color: #000000\">: </span><span style=\"color: #0000FF\">true</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0451A5\">\"mapRoot\"</span><span style=\"color: #000000\">: </span><span style=\"color: #A31515\">\"https://my-website.com/debug/sourcemaps/\"</span>\n<span style=\"color: #000000\">  }</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n<p>Would declare that <code>index.js</code> will have sourcemaps at <code>https://my-website.com/debug/sourcemaps/index.js.map</code>.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>mapRoot</p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='inlineSourceMap'><a aria-label=\"Link to the compiler option:inlineSourceMap\" title=\"Link to the compiler option:inlineSourceMap\" href='#inlineSourceMap' name='inlineSourceMap'>#</a> Inline Source Map - <code>inlineSourceMap</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>When set, instead of writing out a <code>.js.map</code> file to provide source maps, TypeScript will embed the source map content in the <code>.js</code> files.\nAlthough this results in larger JS files, it can be convenient in some scenarios.\nFor example, you might want to debug JS files on a webserver that doesn’t allow <code>.map</code> files to be served.</p>\n<p>Mutually exclusive with <a href=\"#sourceMap\"><code>sourceMap</code></a>.</p>\n<p>For example, with this TypeScript:</p>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> helloWorld = </span><span style=\"color: #A31515\">\"hi\"</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #000000\">console.log(helloWorld);</span></code></div></pre>\n<p>Converts to this JavaScript:</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">js</div><div class='code-container'><code><span style=\"color: #A31515\">\"use strict\"</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> helloWorld = </span><span style=\"color: #A31515\">\"hi\"</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #000000\">console.log(helloWorld);</span></code></div></pre>\n<p>Then enable building it with <code>inlineSourceMap</code> enabled there is a comment at the bottom of the file which includes\na source-map for the file.</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">js</div><div class='code-container'><code><span style=\"color: #A31515\">\"use strict\"</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> helloWorld = </span><span style=\"color: #A31515\">\"hi\"</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #000000\">console.log(helloWorld);</span>\n<span style=\"color: #008000\">//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsTUFBTSxVQUFVLEdBQUcsSUFBSSxDQUFDO0FBQ3hCLE9BQU8sQ0FBQyxHQUFHLENBQUMsVUFBVSxDQUFDLENBQUMifQ==</span></code></div></pre>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>inlineSourceMap</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr>\n<tr><td>Released</td><td><p><a href=\"/docs/handbook/release-notes/typescript-1-5.html\">1.5</a></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='inlineSources'><a aria-label=\"Link to the compiler option:inlineSources\" title=\"Link to the compiler option:inlineSources\" href='#inlineSources' name='inlineSources'>#</a> Inline Sources - <code>inlineSources</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>When set, TypeScript will include the original content of the <code>.ts</code> file as an embedded string in the source map.\nThis is often useful in the same cases as <code>inlineSourceMap</code>.</p>\n<p>Requires either <code>sourceMap</code> or <code>inlineSourceMap</code> to be set.</p>\n<p>For example, with this TypeScript:</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> <span class='lsp'>helloWorld <span class='lsp-result'>const helloWorld: &quot;hi&quot;</span></span>= </span><span style=\"color: #A31515\">\"hi\"</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #000000\"><span class='lsp'>console.<span class='lsp-result'>var console: Console</span></span><span class='lsp'>log(<span class='lsp-result'>(method) Console.log(message?: any, ...optionalParams: any[]): void</span></span><span class='lsp'>helloWorld)<span class='lsp-result'>const helloWorld: &quot;hi&quot;</span></span></span></code></div></pre>\n<p>By default converts to this JavaScript:</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">js</div><div class='code-container'><code><span style=\"color: #A31515\">\"use strict\"</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> helloWorld = </span><span style=\"color: #A31515\">\"hi\"</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #000000\">console.log(helloWorld);</span></code></div></pre>\n<p>Then enable building it with <code>inlineSources</code> and <code>inlineSourceMap</code> enabled there is a comment at the bottom of the file which includes\na source-map for the file.\nNote that the end is different from the example in <a href=\"#inlineSourceMap\"><code>inlineSourceMap</code></a> because the source-map now contains the original source code also.</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">js</div><div class='code-container'><code><span style=\"color: #A31515\">\"use strict\"</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> helloWorld = </span><span style=\"color: #A31515\">\"hi\"</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #000000\">console.log(helloWorld);</span>\n<span style=\"color: #008000\">//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyJpbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsTUFBTSxVQUFVLEdBQUcsSUFBSSxDQUFDO0FBQ3hCLE9BQU8sQ0FBQyxHQUFHLENBQUMsVUFBVSxDQUFDLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJjb25zdCBoZWxsb1dvcmxkID0gXCJoaVwiO1xuY29uc29sZS5sb2coaGVsbG9Xb3JsZCk7Il19</span></code></div></pre>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>inlineSources</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr>\n<tr><td>Released</td><td><p><a href=\"/docs/handbook/release-notes/typescript-1-5.html\">1.5</a></p>\n<td/></tr></table>\n</div></section>\n<div class='category'>\n<h2 id='Additional_Checks_6176'><a href='#Additional_Checks_6176' name='Additional_Checks_6176'>#</a> Linter Checks</h2>\n<p>A collection of extra checks, which somewhat cross the boundaries of compiler vs linter. You may prefer to use a tool like <a href=\"https://github.com/typescript-eslint/typescript-eslint#typescript-eslint\">eslint</a> over these options if you are looking for more in-depth rules.</p>\n</div>\n<section class='compiler-option'>\n<h3 id='noUnusedLocals'><a aria-label=\"Link to the compiler option:noUnusedLocals\" title=\"Link to the compiler option:noUnusedLocals\" href='#noUnusedLocals' name='noUnusedLocals'>#</a> No Unused Locals - <code>noUnusedLocals</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>Report errors on unused local variables.</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> <span class='lsp'>createKeyboard <span class='lsp-result'>const createKeyboard: (modelID: number) =&gt; {&#13;    type: string;&#13;    modelID: number;&#13;}</span></span>= (<span class='lsp'>modelID:<span class='lsp-result'>(parameter) modelID: number</span></span> number) </span><span style=\"color: #0000FF\">=></span><span style=\"color: #000000\"> {</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> <span class='err lsp'>defaultModelID <span class='lsp-result'>const defaultModelID: 23</span></span>= </span><span style=\"color: #09835A\">23</span><span style=\"color: #000000\">;</span>\n<span class=\"error\"><span>'defaultModelID' is declared but its value is never read.</span><span class=\"code\">6133</span></span><span class=\"error-behind\">'defaultModelID' is declared but its value is never read.</span><span style=\"color: #000000\">  </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> { <span class='lsp'>type:<span class='lsp-result'>(property) type: string</span></span></span><span style=\"color: #A31515\">\"keyboard\"</span><span style=\"color: #000000\">, <span class='lsp'>modelID <span class='lsp-result'>(property) modelID: number</span></span>};</span>\n<span style=\"color: #000000\">};</span></code></div></pre>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>noUnusedLocals</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr>\n<tr><td>Released</td><td><p><a href=\"/docs/handbook/release-notes/typescript-2-0.html\">2.0</a></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='noUnusedParameters'><a aria-label=\"Link to the compiler option:noUnusedParameters\" title=\"Link to the compiler option:noUnusedParameters\" href='#noUnusedParameters' name='noUnusedParameters'>#</a> No Unused Parameters - <code>noUnusedParameters</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>Report errors on unused parameters in functions.</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> <span class='lsp'>createDefaultKeyboard <span class='lsp-result'>const createDefaultKeyboard: (modelID: number) =&gt; {&#13;    type: string;&#13;    modelID: number;&#13;}</span></span>= (<span class='err lsp'>modelID:<span class='lsp-result'>(parameter) modelID: number</span></span> number) </span><span style=\"color: #0000FF\">=></span><span style=\"color: #000000\"> {</span>\n<span class=\"error\"><span>'modelID' is declared but its value is never read.</span><span class=\"code\">6133</span></span><span class=\"error-behind\">'modelID' is declared but its value is never read.</span><span style=\"color: #000000\">  </span><span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> <span class='lsp'>defaultModelID <span class='lsp-result'>const defaultModelID: 23</span></span>= </span><span style=\"color: #09835A\">23</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> { <span class='lsp'>type:<span class='lsp-result'>(property) type: string</span></span></span><span style=\"color: #A31515\">\"keyboard\"</span><span style=\"color: #000000\">, <span class='lsp'>modelID:<span class='lsp-result'>(property) modelID: number</span></span> <span class='lsp'>defaultModelID <span class='lsp-result'>const defaultModelID: 23</span></span>};</span>\n<span style=\"color: #000000\">};</span></code></div></pre>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>noUnusedParameters</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr>\n<tr><td>Released</td><td><p><a href=\"/docs/handbook/release-notes/typescript-2-0.html\">2.0</a></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='noImplicitReturns'><a aria-label=\"Link to the compiler option:noImplicitReturns\" title=\"Link to the compiler option:noImplicitReturns\" href='#noImplicitReturns' name='noImplicitReturns'>#</a> No Implicit Returns - <code>noImplicitReturns</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>When enabled, TypeScript will check all code paths in a function to ensure they return a value.</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> <span class='lsp'>lookupHeadphonesManufacturer(<span class='lsp-result'>function lookupHeadphonesManufacturer(color: &quot;blue&quot; | &quot;black&quot;): string</span></span><span class='lsp'>color:<span class='lsp-result'>(parameter) color: &quot;blue&quot; | &quot;black&quot;</span></span></span><span style=\"color: #A31515\">\"blue\"</span><span style=\"color: #000000\"> | </span><span style=\"color: #A31515\">\"black\"</span><span style=\"color: #000000\">): <span class='err'>string </span></span>\n<span class=\"error\"><span>Function lacks ending return statement and return type does not include 'undefined'.</span><span class=\"code\">2366</span></span><span class=\"error-behind\">Function lacks ending return statement and return type does not include 'undefined'.</span><span style=\"color: #000000\">  </span><span style=\"color: #0000FF\">if</span><span style=\"color: #000000\"> (<span class='lsp'>color <span class='lsp-result'>(parameter) color: &quot;blue&quot; | &quot;black&quot;</span></span>=== </span><span style=\"color: #A31515\">\"blue\"</span><span style=\"color: #000000\">) {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> </span><span style=\"color: #A31515\">\"beats\"</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #000000\">  } </span><span style=\"color: #0000FF\">else</span><span style=\"color: #000000\"> {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #A31515\">\"bose\"</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #000000\">  }</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>noImplicitReturns</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code>, unless <code>strict</code> is set</p>\n<td/></tr>\n<tr><td>Released</td><td><p><a href=\"/docs/handbook/release-notes/typescript-1-8.html\">1.8</a></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='noFallthroughCasesInSwitch'><a aria-label=\"Link to the compiler option:noFallthroughCasesInSwitch\" title=\"Link to the compiler option:noFallthroughCasesInSwitch\" href='#noFallthroughCasesInSwitch' name='noFallthroughCasesInSwitch'>#</a> No Fallthrough Cases In Switch - <code>noFallthroughCasesInSwitch</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>Report errors for fallthrough cases in switch statements.\nEnsures that any non-empty case inside a switch statement includes either <code>break</code> or <code>return</code>.\nThis means you won’t accidentally ship a case fallthrough bug.</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> <span class='lsp'>a:<span class='lsp-result'>const a: number</span></span> number = </span><span style=\"color: #09835A\">6</span><span style=\"color: #000000\">;</span>\n\n<span style=\"color: #0000FF\">switch</span><span style=\"color: #000000\"> (<span class='lsp'>a)<span class='lsp-result'>const a: number</span></span> {</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0000FF\">case</span><span style=\"color: #000000\"> </span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\">:</span>\n<span class=\"error\"><span>Fallthrough case in switch.</span><span class=\"code\">7029</span></span><span class=\"error-behind\">Fallthrough case in switch.</span><span style=\"color: #000000\">    <span class='lsp'>console.<span class='lsp-result'>var console: Console</span></span><span class='lsp'>log(<span class='lsp-result'>(method) Console.log(message?: any, ...optionalParams: any[]): void</span></span></span><span style=\"color: #A31515\">\"even\"</span><span style=\"color: #000000\">);</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0000FF\">case</span><span style=\"color: #000000\"> </span><span style=\"color: #09835A\">1</span><span style=\"color: #000000\">:</span>\n<span style=\"color: #000000\">    <span class='lsp'>console.<span class='lsp-result'>var console: Console</span></span><span class='lsp'>log(<span class='lsp-result'>(method) Console.log(message?: any, ...optionalParams: any[]): void</span></span></span><span style=\"color: #A31515\">\"odd\"</span><span style=\"color: #000000\">);</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">break</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>noFallthroughCasesInSwitch</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr>\n<tr><td>Released</td><td><p><a href=\"/docs/handbook/release-notes/typescript-1-8.html\">1.8</a></p>\n<td/></tr></table>\n</div></section>\n<div class='category'>\n<h2 id='Experimental_Options_6177'><a href='#Experimental_Options_6177' name='Experimental_Options_6177'>#</a> Experimental</h2>\n<p>TypeScript strives to only include features which are confirmed to be added into the JavaScript language.</p>\n<p>There have been cases where a feature is compelling enough to be an exception to that rule, and these live as experimental compiler flags.\nIt is possible that a version of these features may be different when/if they are added to the JavaScript language, and thus are considered risky.</p>\n</div>\n<section class='compiler-option'>\n<h3 id='experimentalDecorators'><a aria-label=\"Link to the compiler option:experimentalDecorators\" title=\"Link to the compiler option:experimentalDecorators\" href='#experimentalDecorators' name='experimentalDecorators'>#</a> Experimental Decorators - <code>experimentalDecorators</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>Enables <a href=\"https://github.com/tc39/proposal-decorators\">experimental support for decorators</a>, which is in stage 2\nof the TC39 standardization process.</p>\n<p>Decorators are a language feature which hasn’t yet been fully ratified into the JavaScript specification.\nThis means that the implementation version in TypeScript may differ from the implementation in JavaScript when it it decided by TC39.</p>\n<p>You can find out more about decorator support in TypeScript in <a href=\"/docs/handbook/decorators.html\">the handbook</a>.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>experimentalDecorators</p>\n<td/></tr>\n<tr><td>Related</td><td><p><a href=\"#emitDecoratorMetadata\"><code>emitDecoratorMetadata</code></a></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='emitDecoratorMetadata'><a aria-label=\"Link to the compiler option:emitDecoratorMetadata\" title=\"Link to the compiler option:emitDecoratorMetadata\" href='#emitDecoratorMetadata' name='emitDecoratorMetadata'>#</a> Emit Decorator Metadata - <code>emitDecoratorMetadata</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>Enables experimental support for emitting type metadata for decorators which works with the module <a href=\"https://www.npmjs.com/package/reflect-metadata\"><code>reflect-metadata</code></a>.</p>\n<p>For example, here is the JavaScript</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> <span class='lsp'>LogMethod(<span class='lsp-result'>function LogMethod(target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor): void</span></span></span>\n<span style=\"color: #000000\">  <span class='lsp'>target:<span class='lsp-result'>(parameter) target: any</span></span> any,</span>\n<span style=\"color: #000000\">  <span class='lsp'>propertyKey:<span class='lsp-result'>(parameter) propertyKey: string | symbol</span></span> string | symbol,</span>\n<span style=\"color: #000000\">  <span class='lsp'>descriptor:<span class='lsp-result'>(parameter) descriptor: PropertyDescriptor</span></span> <span class='lsp'>PropertyDescriptor<span class='lsp-result'>interface PropertyDescriptor</span></span></span>\n<span style=\"color: #000000\">) {</span>\n<span style=\"color: #000000\">  <span class='lsp'>console.<span class='lsp-result'>var console: Console</span></span><span class='lsp'>log(<span class='lsp-result'>(method) Console.log(message?: any, ...optionalParams: any[]): void</span></span><span class='lsp'>target)<span class='lsp-result'>(parameter) target: any</span></span></span>\n<span style=\"color: #000000\">  <span class='lsp'>console.<span class='lsp-result'>var console: Console</span></span><span class='lsp'>log(<span class='lsp-result'>(method) Console.log(message?: any, ...optionalParams: any[]): void</span></span><span class='lsp'>propertyKey)<span class='lsp-result'>(parameter) propertyKey: string | symbol</span></span></span>\n<span style=\"color: #000000\">  <span class='lsp'>console.<span class='lsp-result'>var console: Console</span></span><span class='lsp'>log(<span class='lsp-result'>(method) Console.log(message?: any, ...optionalParams: any[]): void</span></span><span class='lsp'>descriptor)<span class='lsp-result'>(parameter) descriptor: PropertyDescriptor</span></span></span>\n<span style=\"color: #000000\">}</span>\n\n<span style=\"color: #0000FF\">class</span><span style=\"color: #000000\"> <span class='lsp'>Demo <span class='lsp-result'>class Demo</span></span></span>\n<span style=\"color: #000000\">  @<span class='lsp'>LogMethod<span class='lsp-result'>function LogMethod(target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor): void</span></span></span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0000FF\">public</span><span style=\"color: #000000\"> <span class='lsp'>foo(<span class='lsp-result'>(method) Demo.foo(bar: number): void</span></span><span class='lsp'>bar:<span class='lsp-result'>(parameter) bar: number</span></span> number) {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #008000\">// do nothing</span>\n<span style=\"color: #000000\">  }</span>\n<span style=\"color: #000000\">}</span>\n\n<span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> <span class='lsp'>demo <span class='lsp-result'>const demo: Demo</span></span>= </span><span style=\"color: #0000FF\">new</span><span style=\"color: #000000\"> <span class='lsp'>Demo(<span class='lsp-result'>constructor Demo(): Demo</span></span>);</span></code></div></pre>\n<p>With <code>emitDecoratorMetadata</code> not set to true (default):</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">js</div><div class='code-container'><code><span style=\"color: #A31515\">\"use strict\"</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> __decorate = (</span><span style=\"color: #0000FF\">this</span><span style=\"color: #000000\"> && </span><span style=\"color: #0000FF\">this</span><span style=\"color: #000000\">.__decorate) || </span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> (decorators, target, key, desc) {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> c = </span><span style=\"color: #0000FF\">arguments</span><span style=\"color: #000000\">.length, r = c < </span><span style=\"color: #09835A\">3</span><span style=\"color: #000000\"> ? target : desc === </span><span style=\"color: #0000FF\">null</span><span style=\"color: #000000\"> ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">if</span><span style=\"color: #000000\"> (</span><span style=\"color: #0000FF\">typeof</span><span style=\"color: #000000\"> Reflect === </span><span style=\"color: #A31515\">\"object\"</span><span style=\"color: #000000\"> && </span><span style=\"color: #0000FF\">typeof</span><span style=\"color: #000000\"> Reflect.decorate === </span><span style=\"color: #A31515\">\"function\"</span><span style=\"color: #000000\">) r = Reflect.decorate(decorators, target, key, desc);</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">else</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">for</span><span style=\"color: #000000\"> (</span><span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> i = decorators.length - </span><span style=\"color: #09835A\">1</span><span style=\"color: #000000\">; i >= </span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\">; i--) </span><span style=\"color: #0000FF\">if</span><span style=\"color: #000000\"> (d = decorators[i]) r = (c < </span><span style=\"color: #09835A\">3</span><span style=\"color: #000000\"> ? d(r) : c > </span><span style=\"color: #09835A\">3</span><span style=\"color: #000000\"> ? d(target, key, r) : d(target, key)) || r;</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> c > </span><span style=\"color: #09835A\">3</span><span style=\"color: #000000\"> && r && Object.defineProperty(target, key, r), r;</span>\n<span style=\"color: #000000\">};</span>\n<span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> LogMethod(target, propertyKey, descriptor) {</span>\n<span style=\"color: #000000\">    console.log(target);</span>\n<span style=\"color: #000000\">    console.log(propertyKey);</span>\n<span style=\"color: #000000\">    console.log(descriptor);</span>\n<span style=\"color: #000000\">}</span>\n<span style=\"color: #0000FF\">class</span><span style=\"color: #000000\"> Demo {</span>\n<span style=\"color: #000000\">    foo(bar) {</span>\n<span style=\"color: #000000\">        </span><span style=\"color: #008000\">// do nothing</span>\n<span style=\"color: #000000\">    }</span>\n<span style=\"color: #000000\">}</span>\n<span style=\"color: #000000\">__decorate([</span>\n<span style=\"color: #000000\">    LogMethod</span>\n<span style=\"color: #000000\">], Demo.prototype, </span><span style=\"color: #A31515\">\"foo\"</span><span style=\"color: #000000\">, </span><span style=\"color: #0000FF\">null</span><span style=\"color: #000000\">);</span>\n<span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> demo = </span><span style=\"color: #0000FF\">new</span><span style=\"color: #000000\"> Demo();</span></code></div></pre>\n<p>With <code>emitDecoratorMetadata</code> set to true:</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">js</div><div class='code-container'><code><span style=\"color: #A31515\">\"use strict\"</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> __decorate = (</span><span style=\"color: #0000FF\">this</span><span style=\"color: #000000\"> && </span><span style=\"color: #0000FF\">this</span><span style=\"color: #000000\">.__decorate) || </span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> (decorators, target, key, desc) {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> c = </span><span style=\"color: #0000FF\">arguments</span><span style=\"color: #000000\">.length, r = c < </span><span style=\"color: #09835A\">3</span><span style=\"color: #000000\"> ? target : desc === </span><span style=\"color: #0000FF\">null</span><span style=\"color: #000000\"> ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">if</span><span style=\"color: #000000\"> (</span><span style=\"color: #0000FF\">typeof</span><span style=\"color: #000000\"> Reflect === </span><span style=\"color: #A31515\">\"object\"</span><span style=\"color: #000000\"> && </span><span style=\"color: #0000FF\">typeof</span><span style=\"color: #000000\"> Reflect.decorate === </span><span style=\"color: #A31515\">\"function\"</span><span style=\"color: #000000\">) r = Reflect.decorate(decorators, target, key, desc);</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">else</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">for</span><span style=\"color: #000000\"> (</span><span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> i = decorators.length - </span><span style=\"color: #09835A\">1</span><span style=\"color: #000000\">; i >= </span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\">; i--) </span><span style=\"color: #0000FF\">if</span><span style=\"color: #000000\"> (d = decorators[i]) r = (c < </span><span style=\"color: #09835A\">3</span><span style=\"color: #000000\"> ? d(r) : c > </span><span style=\"color: #09835A\">3</span><span style=\"color: #000000\"> ? d(target, key, r) : d(target, key)) || r;</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> c > </span><span style=\"color: #09835A\">3</span><span style=\"color: #000000\"> && r && Object.defineProperty(target, key, r), r;</span>\n<span style=\"color: #000000\">};</span>\n<span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> __metadata = (</span><span style=\"color: #0000FF\">this</span><span style=\"color: #000000\"> && </span><span style=\"color: #0000FF\">this</span><span style=\"color: #000000\">.__metadata) || </span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> (k, v) {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">if</span><span style=\"color: #000000\"> (</span><span style=\"color: #0000FF\">typeof</span><span style=\"color: #000000\"> Reflect === </span><span style=\"color: #A31515\">\"object\"</span><span style=\"color: #000000\"> && </span><span style=\"color: #0000FF\">typeof</span><span style=\"color: #000000\"> Reflect.metadata === </span><span style=\"color: #A31515\">\"function\"</span><span style=\"color: #000000\">) </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> Reflect.metadata(k, v);</span>\n<span style=\"color: #000000\">};</span>\n<span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> LogMethod(target, propertyKey, descriptor) {</span>\n<span style=\"color: #000000\">    console.log(target);</span>\n<span style=\"color: #000000\">    console.log(propertyKey);</span>\n<span style=\"color: #000000\">    console.log(descriptor);</span>\n<span style=\"color: #000000\">}</span>\n<span style=\"color: #0000FF\">class</span><span style=\"color: #000000\"> Demo {</span>\n<span style=\"color: #000000\">    foo(bar) {</span>\n<span style=\"color: #000000\">        </span><span style=\"color: #008000\">// do nothing</span>\n<span style=\"color: #000000\">    }</span>\n<span style=\"color: #000000\">}</span>\n<span style=\"color: #000000\">__decorate([</span>\n<span style=\"color: #000000\">    LogMethod,</span>\n<span style=\"color: #000000\">    __metadata(</span><span style=\"color: #A31515\">\"design:type\"</span><span style=\"color: #000000\">, Function),</span>\n<span style=\"color: #000000\">    __metadata(</span><span style=\"color: #A31515\">\"design:paramtypes\"</span><span style=\"color: #000000\">, [Number]),</span>\n<span style=\"color: #000000\">    __metadata(</span><span style=\"color: #A31515\">\"design:returntype\"</span><span style=\"color: #000000\">, </span><span style=\"color: #0000FF\">void</span><span style=\"color: #000000\"> </span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\">)</span>\n<span style=\"color: #000000\">], Demo.prototype, </span><span style=\"color: #A31515\">\"foo\"</span><span style=\"color: #000000\">, </span><span style=\"color: #0000FF\">null</span><span style=\"color: #000000\">);</span>\n<span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> demo = </span><span style=\"color: #0000FF\">new</span><span style=\"color: #000000\"> Demo();</span></code></div></pre>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>emitDecoratorMetadata</p>\n<td/></tr>\n<tr><td>Related</td><td><p><a href=\"#experimentalDecorators\"><code>experimentalDecorators</code></a></p>\n<td/></tr></table>\n</div></section>\n<div class='category'>\n<h2 id='Advanced_Options_6178'><a href='#Advanced_Options_6178' name='Advanced_Options_6178'>#</a> Advanced</h2>\n<p>Flags which help with debugging</p>\n</div>\n<section class='compiler-option'>\n<h3 id='importHelpers'><a aria-label=\"Link to the compiler option:importHelpers\" title=\"Link to the compiler option:importHelpers\" href='#importHelpers' name='importHelpers'>#</a> Import Helpers - <code>importHelpers</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>For certain downleveling operations, TypeScript uses some helper code for operations like extending class, spreading arrays or objects, and async operations.\nBy default, these helpers are inserted into files which use them.\nThis can result in code duplication if the same helper is used in many different modules.</p>\n<p>If the <code>importHelpers</code> flag is on, these helper functions are instead imported from the <a href=\"https://www.npmjs.com/package/tslib\">tslib</a> module.\nYou will need to ensure that the <code>tslib</code> module is able to be imported at runtime.\nThis only affects modules; global script files will not attempt to import modules.</p>\n<p>For example, with this TypeScript:</p>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">export</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> fn(arr: number[]) {</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> arr2 = [</span><span style=\"color: #09835A\">1</span><span style=\"color: #000000\">, ...arr];</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n<p>Turning on <a href=\"#downlevelIteration\"><code>downlevelIteration</code></a> and <code>importHelpers</code> is still false:</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">js</div><div class='code-container'><code><span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> __read = (</span><span style=\"color: #0000FF\">this</span><span style=\"color: #000000\"> && </span><span style=\"color: #0000FF\">this</span><span style=\"color: #000000\">.__read) || </span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> (o, n) {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> m = </span><span style=\"color: #0000FF\">typeof</span><span style=\"color: #000000\"> Symbol === </span><span style=\"color: #A31515\">\"function\"</span><span style=\"color: #000000\"> && o[Symbol.iterator];</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">if</span><span style=\"color: #000000\"> (!m) </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> o;</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> i = m.call(o), r, ar = [], e;</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">try</span><span style=\"color: #000000\"> {</span>\n<span style=\"color: #000000\">        </span><span style=\"color: #0000FF\">while</span><span style=\"color: #000000\"> ((n === </span><span style=\"color: #0000FF\">void</span><span style=\"color: #000000\"> </span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\"> || n-- > </span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\">) && !(r = i.next()).done) ar.push(r.value);</span>\n<span style=\"color: #000000\">    }</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">catch</span><span style=\"color: #000000\"> (error) { e = { error: error }; }</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">finally</span><span style=\"color: #000000\"> {</span>\n<span style=\"color: #000000\">        </span><span style=\"color: #0000FF\">try</span><span style=\"color: #000000\"> {</span>\n<span style=\"color: #000000\">            </span><span style=\"color: #0000FF\">if</span><span style=\"color: #000000\"> (r && !r.done && (m = i[</span><span style=\"color: #A31515\">\"return\"</span><span style=\"color: #000000\">])) m.call(i);</span>\n<span style=\"color: #000000\">        }</span>\n<span style=\"color: #000000\">        </span><span style=\"color: #0000FF\">finally</span><span style=\"color: #000000\"> { </span><span style=\"color: #0000FF\">if</span><span style=\"color: #000000\"> (e) </span><span style=\"color: #0000FF\">throw</span><span style=\"color: #000000\"> e.error; }</span>\n<span style=\"color: #000000\">    }</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> ar;</span>\n<span style=\"color: #000000\">};</span>\n<span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> __spread = (</span><span style=\"color: #0000FF\">this</span><span style=\"color: #000000\"> && </span><span style=\"color: #0000FF\">this</span><span style=\"color: #000000\">.__spread) || </span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> () {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">for</span><span style=\"color: #000000\"> (</span><span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> ar = [], i = </span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\">; i < </span><span style=\"color: #0000FF\">arguments</span><span style=\"color: #000000\">.length; i++) ar = ar.concat(__read(</span><span style=\"color: #0000FF\">arguments</span><span style=\"color: #000000\">[i]));</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> ar;</span>\n<span style=\"color: #000000\">};</span>\n<span style=\"color: #0000FF\">export</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> fn(arr) {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> arr2 = __spread([</span><span style=\"color: #09835A\">1</span><span style=\"color: #000000\">], arr);</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n<p>Then turning on both <a href=\"#downlevelIteration\"><code>downlevelIteration</code></a> and <code>importHelpers</code>:</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">js</div><div class='code-container'><code><span style=\"color: #0000FF\">import</span><span style=\"color: #000000\"> { __read, __spread } </span><span style=\"color: #0000FF\">from</span><span style=\"color: #000000\"> </span><span style=\"color: #A31515\">\"tslib\"</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #0000FF\">export</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> fn(arr) {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> arr2 = __spread([</span><span style=\"color: #09835A\">1</span><span style=\"color: #000000\">], arr);</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n<p>You can use <a href=\"#noEmitHelpers\"><code>noEmitHelpers</code></a> when you provide your own implementations of these functions.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>importHelpers</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='listFiles'><a aria-label=\"Link to the compiler option:listFiles\" title=\"Link to the compiler option:listFiles\" href='#listFiles' name='listFiles'>#</a> List Files - <code>listFiles</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>Print names of files part of the compilation. This is useful when you are not sure that TypeScript has\nincluded a file you expected.</p>\n<p>For example:</p>\n<pre><code>example\n├── index.ts\n├── package.json\n└── tsconfig.json\n</code></pre>\n<p>With:</p>\n<pre class=\"shiki\"><div class=\"language-id\">json</div><div class='code-container'><code><span style=\"color: #000000\">{</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0451A5\">\"compilerOptions\"</span><span style=\"color: #000000\">: {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0451A5\">\"listFiles\"</span><span style=\"color: #000000\">: </span><span style=\"color: #0000FF\">true</span>\n<span style=\"color: #000000\">  }</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n<p>Would echo paths like:</p>\n<pre><code>$ npm run tsc\npath/to/example/node_modules/typescript/lib/lib.d.ts\npath/to/example/node_modules/typescript/lib/lib.es5.d.ts\npath/to/example/node_modules/typescript/lib/lib.dom.d.ts\npath/to/example/node_modules/typescript/lib/lib.webworker.importscripts.d.ts\npath/to/example/node_modules/typescript/lib/lib.scripthost.d.ts\npath/to/example/index.ts\n</code></pre>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>listFiles</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='listEmittedFiles'><a aria-label=\"Link to the compiler option:listEmittedFiles\" title=\"Link to the compiler option:listEmittedFiles\" href='#listEmittedFiles' name='listEmittedFiles'>#</a> List Emitted Files - <code>listEmittedFiles</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>Print names of generated files part of the compilation to the terminal.</p>\n<p>This flag is useful in two cases:</p>\n<ul>\n<li>You want to transpile TypeScript as a part of a build chain in the terminal where the filenames are processed in the next command.</li>\n<li>You are not sure that TypeScript has included a file you expected, as a part of debugging the <a href=\"#Project_Files_0\">file inclusion settings</a>.</li>\n</ul>\n<p>For example:</p>\n<pre><code>example\n├── index.ts\n├── package.json\n└── tsconfig.json\n</code></pre>\n<p>With:</p>\n<pre class=\"shiki\"><div class=\"language-id\">json</div><div class='code-container'><code><span style=\"color: #000000\">{</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0451A5\">\"compilerOptions\"</span><span style=\"color: #000000\">: {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0451A5\">\"declaration\"</span><span style=\"color: #000000\">: </span><span style=\"color: #0000FF\">true</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0451A5\">\"listFiles\"</span><span style=\"color: #000000\">: </span><span style=\"color: #0000FF\">true</span>\n<span style=\"color: #000000\">  }</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n<p>Would echo paths like:</p>\n<pre><code>$ npm run tsc\n\npath/to/example/index.js\npath/to/example/index.d.ts\n</code></pre>\n<p>Normally, TypeScript would return silently on success.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>listEmittedFiles</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='traceResolution'><a aria-label=\"Link to the compiler option:traceResolution\" title=\"Link to the compiler option:traceResolution\" href='#traceResolution' name='traceResolution'>#</a> Trace Resolution - <code>traceResolution</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>When you are trying to debug why a module isn’t being included.\nYou can set <code>traceResolutions</code> to <code>true</code> to have TypeScript print information about its resolution process for each processed file.</p>\n<p>You can read more about this in <a href=\"/docs/handbook/module-resolution.html#tracing-module-resolution\">the handbook</a>.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>traceResolution</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr>\n<tr><td>Released</td><td><p><a href=\"/docs/handbook/release-notes/typescript-2-0.html\">2.0</a></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='diagnostics'><a aria-label=\"Link to the compiler option:diagnostics\" title=\"Link to the compiler option:diagnostics\" href='#diagnostics' name='diagnostics'>#</a> Diagnostics - <code>diagnostics</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>Used to output diagnostic information for debugging. This command is a subset of <a href=\"#extendedDiagnostics\"><code>extendedDiagnostics</code></a> which are more user-facing results, and easier to interpret.</p>\n<p>If you have been asked by a TypeScript compiler engineer to give the results using this flag in a compile, in which there is no harm in using <a href=\"#extendedDiagnostics\"><code>--extendedDiagnostics</code></a> instead.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>diagnostics</p>\n<td/></tr>\n<tr><td>Status</td><td><p>Deprecated</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr>\n<tr><td>Related</td><td><p><a href=\"#extendedDiagnostics\"><code>extendedDiagnostics</code></a></p>\n<td/></tr>\n<tr><td>Status</td><td><p>Deprecated</p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='extendedDiagnostics'><a aria-label=\"Link to the compiler option:extendedDiagnostics\" title=\"Link to the compiler option:extendedDiagnostics\" href='#extendedDiagnostics' name='extendedDiagnostics'>#</a> Extended Diagnostics - <code>extendedDiagnostics</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>You can use this flag to discover where TypeScript is spending it’s time when compiling.\nThis is a tool used for understanding the performance characteristics of your codebase overall.</p>\n<p>You can learn more about how to measure and understand the output in the performance <a href=\"https://github.com/microsoft/TypeScript/wiki/Performance\">section of the wiki</a>.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>extendedDiagnostics</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr>\n<tr><td>Related</td><td><p><a href=\"#diagnostics\"><code>diagnostics</code></a></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='generateCpuProfile'><a aria-label=\"Link to the compiler option:generateCpuProfile\" title=\"Link to the compiler option:generateCpuProfile\" href='#generateCpuProfile' name='generateCpuProfile'>#</a> Generate CPU Profile - <code>generateCpuProfile</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>This option gives you the chance to have TypeScript emit a v8 CPU profile during the compiler run. The CPU profile can provide insight into why your builds may be slow.</p>\n<p>This option can only be used from the CLI via: <code>--generateCpuProfile tsc-output.cpuprofile</code>.</p>\n<pre class=\"shiki\"><div class=\"language-id\">sh</div><div class='code-container'><code><span style=\"color: #000000\">npm run tsc --generateCpuProfile tsc-output.cpuprofile</span></code></div></pre>\n<p>This file can be opened in a chromium based browser like Chrome or Edge Developer in <a href=\"https://developers.google.com/web/tools/chrome-devtools/rendering-tools/js-execution\">the CPU profiler</a> section.\nYou can learn more about understanding the compilers performance in the <a href=\"https://github.com/microsoft/TypeScript/wiki/Performance\">TypeScript wiki section on performance</a>.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>generateCpuProfile</p>\n<td/></tr>\n<tr><td>Default</td><td><p> profile.cpuprofile</p>\n<td/></tr>\n<tr><td>Released</td><td><p><a href=\"/docs/handbook/release-notes/typescript-3-7.html\">3.7</a></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='assumeChangesOnlyAffectDirectDependencies'><a aria-label=\"Link to the compiler option:assumeChangesOnlyAffectDirectDependencies\" title=\"Link to the compiler option:assumeChangesOnlyAffectDirectDependencies\" href='#assumeChangesOnlyAffectDirectDependencies' name='assumeChangesOnlyAffectDirectDependencies'>#</a> Assume Changes Only Affect Direct Dependencies - <code>assumeChangesOnlyAffectDirectDependencies</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>When this option is enabled, TypeScript will avoid rechecking/rebuilding all truly possibly-affected files, and only recheck/rebuild files that have changed as well as files that directly import them.</p>\n<p>This can be considered a ‘fast &#x26; loose’ implementation of the watching algorithm, which can drastically reduce incremental rebuild times at the expense of having to run the full build occasionally to get all compiler error messages.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>assumeChangesOnlyAffectDirectDependencies</p>\n<td/></tr>\n<tr><td>Released</td><td><p><a href=\"/docs/handbook/release-notes/typescript-3-8.html\">3.8</a></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='emitDeclarationOnly'><a aria-label=\"Link to the compiler option:emitDeclarationOnly\" title=\"Link to the compiler option:emitDeclarationOnly\" href='#emitDeclarationOnly' name='emitDeclarationOnly'>#</a> Emit Declaration Only - <code>emitDeclarationOnly</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p><em>Only</em> emit <code>.d.ts</code> files; do not emit <code>.js</code> files.</p>\n<p>This setting is useful in two cases:</p>\n<ul>\n<li>You are using a transpiler other than TypeScript to generate your JavaScript.</li>\n<li>You are using TypeScript to only generate <code>d.ts</code> files for your consumers.</li>\n</ul>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>emitDeclarationOnly</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr>\n<tr><td>Released</td><td><p><a href=\"/docs/handbook/release-notes/typescript-2-8.html\">2.8</a></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='importsNotUsedAsValues'><a aria-label=\"Link to the compiler option:importsNotUsedAsValues\" title=\"Link to the compiler option:importsNotUsedAsValues\" href='#importsNotUsedAsValues' name='importsNotUsedAsValues'>#</a> Imports Not Used As Values - <code>importsNotUsedAsValues</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>This flag controls how <code>import</code> works, there are 3 different options:</p>\n<ul>\n<li><code>remove</code>: The default behavior of dropping <code>import</code> statements which only reference types.</li>\n<li><code>preserve</code>: Preserves all <code>import</code> statements whose values or types are never used. This can cause imports/side-effects to be preserved.</li>\n<li><code>error</code>: This preserves all imports (the same as the preserve option), but will error when a value import is only used as a type. This might be useful if you want to ensure no values are being accidentally imported, but still make side-effect imports explicit.</li>\n</ul>\n<p>This flag works because you can use <code>import type</code> to explicitly create an <code>import</code> statement which should never be emitted into JavaScript.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>importsNotUsedAsValues</p>\n<td/></tr>\n<tr><td>Allowed</td><td><p>remove, preserve, error</p>\n<td/></tr>\n<tr><td>Released</td><td><p><a href=\"/docs/handbook/release-notes/typescript-3-8.html\">3.8</a></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='jsxFactory'><a aria-label=\"Link to the compiler option:jsxFactory\" title=\"Link to the compiler option:jsxFactory\" href='#jsxFactory' name='jsxFactory'>#</a> JSX Factory - <code>jsxFactory</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>Changes the function called in <code>.js</code> files when compiling JSX Elements.\nThe most common change is to use <code>\"h\"</code> or <code>\"preact.h\"</code> instead of the default <code>\"React.createElement\"</code> if using <code>preact</code>.</p>\n<p>This is the same as <a href=\"https://babeljs.io/docs/en/babel-plugin-transform-react-jsx#custom\">Babel’s <code>/** @jsx h */</code> directive</a>.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>jsxFactory</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>React\"</code></p>\n<td/></tr>\n<tr><td>Allowed</td><td><p><strong>Allowed Values</strong>: Any identifier or dotted identifier; default <code>\"React.createElement\"</code></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='resolveJsonModule'><a aria-label=\"Link to the compiler option:resolveJsonModule\" title=\"Link to the compiler option:resolveJsonModule\" href='#resolveJsonModule' name='resolveJsonModule'>#</a> Resolve JSON Module - <code>resolveJsonModule</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>Allows importing modules with a ‘.json’ extension, which is a common practice in node projects. This includes\ngenerating a type for the <code>import</code> based on the static JSON shape.</p>\n<p>TypeScript does not support resolving JSON files by default:</p>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #008000\">// @filename: settings.json</span>\n<span style=\"color: #000000\">{</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #A31515\">\"repo\"</span><span style=\"color: #000000\">: </span><span style=\"color: #A31515\">\"TypeScript\"</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #A31515\">\"dry\"</span><span style=\"color: #000000\">: </span><span style=\"color: #0000FF\">false</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #A31515\">\"debug\"</span><span style=\"color: #000000\">: </span><span style=\"color: #0000FF\">false</span>\n<span style=\"color: #000000\">}</span>\n<span style=\"color: #008000\">// @filename: index.ts</span>\n<span style=\"color: #0000FF\">import</span><span style=\"color: #000000\"> settings </span><span style=\"color: #0000FF\">from</span><span style=\"color: #000000\"> </span><span style=\"color: #A31515\">\"./settings.json\"</span><span style=\"color: #000000\">;</span>\n\n<span style=\"color: #000000\">settings.debug === </span><span style=\"color: #0000FF\">true</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #000000\">settings.dry === </span><span style=\"color: #09835A\">2</span><span style=\"color: #000000\">;</span></code></div></pre>\n<p>Enabling the option allows importing JSON, and validating the types in that JSON file.</p>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #008000\">// @filename: settings.json</span>\n<span style=\"color: #000000\">{</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #A31515\">\"repo\"</span><span style=\"color: #000000\">: </span><span style=\"color: #A31515\">\"TypeScript\"</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #A31515\">\"dry\"</span><span style=\"color: #000000\">: </span><span style=\"color: #0000FF\">false</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #A31515\">\"debug\"</span><span style=\"color: #000000\">: </span><span style=\"color: #0000FF\">false</span>\n<span style=\"color: #000000\">}</span>\n<span style=\"color: #008000\">// @filename: index.ts</span>\n<span style=\"color: #0000FF\">import</span><span style=\"color: #000000\"> settings </span><span style=\"color: #0000FF\">from</span><span style=\"color: #000000\"> </span><span style=\"color: #A31515\">\"./settings.json\"</span><span style=\"color: #000000\">;</span>\n\n<span style=\"color: #000000\">settings.debug === </span><span style=\"color: #0000FF\">true</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #000000\">settings.dry === </span><span style=\"color: #09835A\">2</span><span style=\"color: #000000\">;</span></code></div></pre>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>resolveJsonModule</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='out'><a aria-label=\"Link to the compiler option:out\" title=\"Link to the compiler option:out\" href='#out' name='out'>#</a> Out - <code>out</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>Use <a href=\"#outfile\">outFile</a> instead.</p>\n<p>The <code>out</code> option computes the final file location in a way that is not predictable or consistent.\nThis option is retained for backward compatibility only and is deprecated.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>out</p>\n<td/></tr>\n<tr><td>Status</td><td><p>Deprecated</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>n/a</code></p>\n<td/></tr>\n<tr><td>Related</td><td><p><a href=\"#outDir\"><code>outDir</code></a>, <a href=\"#outFile\"><code>outFile</code></a></p>\n<td/></tr>\n<tr><td>Status</td><td><p>Deprecated</p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='reactNamespace'><a aria-label=\"Link to the compiler option:reactNamespace\" title=\"Link to the compiler option:reactNamespace\" href='#reactNamespace' name='reactNamespace'>#</a> React Namespace - <code>reactNamespace</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>Use <a href=\"#jsxFactory\"><code>--jsxFactory</code></a> instead. Specify the object invoked for <code>createElement</code> when targeting <code>react</code> for TSX files.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>reactNamespace</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>\"React\"</code></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='skipDefaultLibCheck'><a aria-label=\"Link to the compiler option:skipDefaultLibCheck\" title=\"Link to the compiler option:skipDefaultLibCheck\" href='#skipDefaultLibCheck' name='skipDefaultLibCheck'>#</a> Skip Default Lib Check - <code>skipDefaultLibCheck</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>Use <a href=\"#skipLibCheck\"><code>--skipLibCheck</code></a> instead. Skip type checking of default library declaration files.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>skipDefaultLibCheck</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='charset'><a aria-label=\"Link to the compiler option:charset\" title=\"Link to the compiler option:charset\" href='#charset' name='charset'>#</a> Charset - <code>charset</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>In prior versions of TypeScript, this controlled what encoding was used when reading text files from disk.\nToday, TypeScript assumes UTF-8 encoding, but will correctly detect UTF-16 (BE and LE) or UTF-8 BOMs.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>charset</p>\n<td/></tr>\n<tr><td>Status</td><td><p>Deprecated</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>utf8</code></p>\n<td/></tr>\n<tr><td>Status</td><td><p>Deprecated</p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='emitBOM'><a aria-label=\"Link to the compiler option:emitBOM\" title=\"Link to the compiler option:emitBOM\" href='#emitBOM' name='emitBOM'>#</a> Emit BOM - <code>emitBOM</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>Controls whether TypeScript will emit a <a href=\"https://en.wikipedia.org/wiki/Byte_order_mark\">byte order mark (BOM)</a> when writing output files.\nSome runtime environments require a BOM to correctly interpret a JavaScript files; others require that it is not present.\nThe default value of <code>false</code> is generally best unless you have a reason to change it.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>emitBOM</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='newLine'><a aria-label=\"Link to the compiler option:newLine\" title=\"Link to the compiler option:newLine\" href='#newLine' name='newLine'>#</a> New Line - <code>newLine</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>Specify the end of line sequence to be used when emitting files: ‘CRLF’ (dos) or ‘LF’ (unix).</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>newLine</p>\n<td/></tr>\n<tr><td>Default</td><td><p>Platform specific</p>\n<td/></tr>\n<tr><td>Released</td><td><p><a href=\"/docs/handbook/release-notes/typescript-1-5.html\">1.5</a></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='noErrorTruncation'><a aria-label=\"Link to the compiler option:noErrorTruncation\" title=\"Link to the compiler option:noErrorTruncation\" href='#noErrorTruncation' name='noErrorTruncation'>#</a> No Error Truncation - <code>noErrorTruncation</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>Do not truncate error messages.</p>\n<p>With <code>false</code>, the default.</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> <span class='lsp'>x:<span class='lsp-result'>var x: {&#13;    propertyWithAnExceedinglyLongName1: string;&#13;    propertyWithAnExceedinglyLongName2: string;&#13;    propertyWithAnExceedinglyLongName3: string;&#13;    propertyWithAnExceedinglyLongName4: string;&#13;    propertyWithAnExceedinglyLongName5: string;&#13;}</span></span> {</span>\n<span style=\"color: #000000\">  <span class='lsp'>propertyWithAnExceedinglyLongName1:<span class='lsp-result'>(property) propertyWithAnExceedinglyLongName1: string</span></span> string;</span>\n<span style=\"color: #000000\">  <span class='lsp'>propertyWithAnExceedinglyLongName2:<span class='lsp-result'>(property) propertyWithAnExceedinglyLongName2: string</span></span> string;</span>\n<span style=\"color: #000000\">  <span class='lsp'>propertyWithAnExceedinglyLongName3:<span class='lsp-result'>(property) propertyWithAnExceedinglyLongName3: string</span></span> string;</span>\n<span style=\"color: #000000\">  <span class='lsp'>propertyWithAnExceedinglyLongName4:<span class='lsp-result'>(property) propertyWithAnExceedinglyLongName4: string</span></span> string;</span>\n<span style=\"color: #000000\">  <span class='lsp'>propertyWithAnExceedinglyLongName5:<span class='lsp-result'>(property) propertyWithAnExceedinglyLongName5: string</span></span> string;</span>\n<span style=\"color: #000000\">};</span>\n\n<span style=\"color: #008000\">// String representation of type of 'x' should be truncated in error message</span>\n<span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> <span class='err lsp'>s:<span class='lsp-result'>var s: string</span></span> string = <span class='err lsp'>x;<span class='lsp-result'>var x: {&#13;    propertyWithAnExceedinglyLongName1: string;&#13;    propertyWithAnExceedinglyLongName2: string;&#13;    propertyWithAnExceedinglyLongName3: string;&#13;    propertyWithAnExceedinglyLongName4: string;&#13;    propertyWithAnExceedinglyLongName5: string;&#13;}</span></span></span>\n<span class=\"error\"><span>Type '{ propertyWithAnExceedinglyLongName1: string; propertyWithAnExceedinglyLongName2: string; propertyWithAnExceedinglyLongName3: string; propertyWithAnExceedinglyLongName4: string; propertyWithAnExceedinglyLongName5: string; }' is not assignable to type 'string'.</br>Variable 'x' is used before being assigned.</span><span class=\"code\">2322<br/>2454</span></span><span class=\"error-behind\">Type '{ propertyWithAnExceedinglyLongName1: string; propertyWithAnExceedinglyLongName2: string; propertyWithAnExceedinglyLongName3: string; propertyWithAnExceedinglyLongName4: string; propertyWithAnExceedinglyLongName5: string; }' is not assignable to type 'string'.</br>Variable 'x' is used before being assigned.</span></code></div></pre>\n<p>With <code>true</code></p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> <span class='lsp'>x:<span class='lsp-result'>var x: {&#13;    propertyWithAnExceedinglyLongName1: string;&#13;    propertyWithAnExceedinglyLongName2: string;&#13;    propertyWithAnExceedinglyLongName3: string;&#13;    propertyWithAnExceedinglyLongName4: string;&#13;    propertyWithAnExceedinglyLongName5: string;&#13;}</span></span> {</span>\n<span style=\"color: #000000\">  <span class='lsp'>propertyWithAnExceedinglyLongName1:<span class='lsp-result'>(property) propertyWithAnExceedinglyLongName1: string</span></span> string;</span>\n<span style=\"color: #000000\">  <span class='lsp'>propertyWithAnExceedinglyLongName2:<span class='lsp-result'>(property) propertyWithAnExceedinglyLongName2: string</span></span> string;</span>\n<span style=\"color: #000000\">  <span class='lsp'>propertyWithAnExceedinglyLongName3:<span class='lsp-result'>(property) propertyWithAnExceedinglyLongName3: string</span></span> string;</span>\n<span style=\"color: #000000\">  <span class='lsp'>propertyWithAnExceedinglyLongName4:<span class='lsp-result'>(property) propertyWithAnExceedinglyLongName4: string</span></span> string;</span>\n<span style=\"color: #000000\">  <span class='lsp'>propertyWithAnExceedinglyLongName5:<span class='lsp-result'>(property) propertyWithAnExceedinglyLongName5: string</span></span> string;</span>\n<span style=\"color: #000000\">};</span>\n\n<span style=\"color: #008000\">// String representation of type of 'x' should be truncated in error message</span>\n<span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> <span class='err lsp'>s:<span class='lsp-result'>var s: string</span></span> string = <span class='err lsp'>x;<span class='lsp-result'>var x: {&#13;    propertyWithAnExceedinglyLongName1: string;&#13;    propertyWithAnExceedinglyLongName2: string;&#13;    propertyWithAnExceedinglyLongName3: string;&#13;    propertyWithAnExceedinglyLongName4: string;&#13;    propertyWithAnExceedinglyLongName5: string;&#13;}</span></span></span>\n<span class=\"error\"><span>Type '{ propertyWithAnExceedinglyLongName1: string; propertyWithAnExceedinglyLongName2: string; propertyWithAnExceedinglyLongName3: string; propertyWithAnExceedinglyLongName4: string; propertyWithAnExceedinglyLongName5: string; }' is not assignable to type 'string'.</br>Variable 'x' is used before being assigned.</span><span class=\"code\">2322<br/>2454</span></span><span class=\"error-behind\">Type '{ propertyWithAnExceedinglyLongName1: string; propertyWithAnExceedinglyLongName2: string; propertyWithAnExceedinglyLongName3: string; propertyWithAnExceedinglyLongName4: string; propertyWithAnExceedinglyLongName5: string; }' is not assignable to type 'string'.</br>Variable 'x' is used before being assigned.</span></code></div></pre>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>noErrorTruncation</p>\n<td/></tr>\n<tr><td>Status</td><td><p>Deprecated</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr>\n<tr><td>Status</td><td><p>Deprecated</p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='noLib'><a aria-label=\"Link to the compiler option:noLib\" title=\"Link to the compiler option:noLib\" href='#noLib' name='noLib'>#</a> No Lib - <code>noLib</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>Disables the automatic inclusion of any library files.\nIf this option is set, <code>lib</code> is ignored.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>noLib</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr>\n<tr><td>Related</td><td><p><a href=\"#lib\"><code>lib</code></a></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='noResolve'><a aria-label=\"Link to the compiler option:noResolve\" title=\"Link to the compiler option:noResolve\" href='#noResolve' name='noResolve'>#</a> No Resolve - <code>noResolve</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>By default, TypeScript will examine the initial set of files for <code>import</code> and <code>&#x3C;reference</code> directives and add these resolved files to your program.</p>\n<p>If <code>noResolve</code> isn’t set, this process doesn’t happen.\nHowever, <code>import</code> statements are still checked to see if they resolve to a valid module, so you’ll need to make sure this is satisfied by some other means.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>noResolve</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='stripInternal'><a aria-label=\"Link to the compiler option:stripInternal\" title=\"Link to the compiler option:stripInternal\" href='#stripInternal' name='stripInternal'>#</a> Strip Internal - <code>stripInternal</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>Do not emit declarations for code that has an <code>@internal</code> annotation in it’s JSDoc comment.\nThis is an internal compiler option; use at your own risk, because the compiler does not check that the result is valid.\nIf you are searching for a tool to handle additional levels of visibility within your <code>d.ts</code> files, look at <a href=\"https://api-extractor.com\">api-extractor</a>.</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #008000\">/**</span>\n<span style=\"color: #008000\"> * Days available in a week</span>\n<span style=\"color: #008000\"> * @internal</span>\n<span style=\"color: #008000\"> */</span>\n<span style=\"color: #0000FF\">export</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> <span class='lsp'>daysInAWeek <span class='lsp-result'>const daysInAWeek: 7</span></span>= </span><span style=\"color: #09835A\">7</span><span style=\"color: #000000\">;</span>\n\n<span style=\"color: #008000\">/** Calculate how much someone earns in a week */</span>\n<span style=\"color: #0000FF\">export</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> <span class='lsp'>weeklySalary(<span class='lsp-result'>function weeklySalary(dayRate: number): number</span></span><span class='lsp'>dayRate:<span class='lsp-result'>(parameter) dayRate: number</span></span> number) {</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> <span class='lsp'>daysInAWeek <span class='lsp-result'>const daysInAWeek: 7</span></span>* <span class='lsp'>dayRate;<span class='lsp-result'>(parameter) dayRate: number</span></span></span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n<p>With the flag set to <code>false</code> (default):</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #008000\">/**</span>\n<span style=\"color: #008000\"> * Days available in a week</span>\n<span style=\"color: #008000\"> * @internal</span>\n<span style=\"color: #008000\"> */</span>\n<span style=\"color: #0000FF\">export</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">declare</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> daysInAWeek = </span><span style=\"color: #09835A\">7</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #008000\">/** Calculate how much someone earns in a week */</span>\n<span style=\"color: #0000FF\">export</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">declare</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> weeklySalary(dayRate: number): number;</span></code></div></pre>\n<p>With <code>stripInternal</code> set to <code>true</code> the <code>d.ts</code> emitted will be redacted.</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #008000\">/** Calculate how much someone earns in a week */</span>\n<span style=\"color: #0000FF\">export</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">declare</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> weeklySalary(dayRate: number): number;</span></code></div></pre>\n<p>The JavaScript output is still the same.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>stripInternal</p>\n<td/></tr>\n<tr><td>Status</td><td><p>internal</p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='disableSizeLimit'><a aria-label=\"Link to the compiler option:disableSizeLimit\" title=\"Link to the compiler option:disableSizeLimit\" href='#disableSizeLimit' name='disableSizeLimit'>#</a> Disable Size Limit - <code>disableSizeLimit</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>To avoid a possible memory bloat issue when working with very large JavaScript projects, there is an upper limit to the amount of memory TypeScript will allocate. Turning this flag on will remove the limit.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>disableSizeLimit</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='disableSourceOfProjectReferenceRedirect'><a aria-label=\"Link to the compiler option:disableSourceOfProjectReferenceRedirect\" title=\"Link to the compiler option:disableSourceOfProjectReferenceRedirect\" href='#disableSourceOfProjectReferenceRedirect' name='disableSourceOfProjectReferenceRedirect'>#</a> Disable Source Project Reference Redirect - <code>disableSourceOfProjectReferenceRedirect</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>When working with <a href=\"/docs/handbook/project-references.html\">composite TypeScript projects</a>, this option provides a way to go <a href=\"/docs/handbook/release-notes/typescript-3-7.html#build-free-editing-with-project-references\">back to the pre-3.7</a> behavior where d.ts files were used to as the boundaries between modules.\nIn 3.7 the source of truth is now your TypeScript files.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>disableSourceOfProjectReferenceRedirect</p>\n<td/></tr>\n<tr><td>Released</td><td><p><a href=\"/docs/handbook/release-notes/typescript-3-7.html\">3.7</a></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='disableSolutionSearching'><a aria-label=\"Link to the compiler option:disableSolutionSearching\" title=\"Link to the compiler option:disableSolutionSearching\" href='#disableSolutionSearching' name='disableSolutionSearching'>#</a> Disable Solution Searching - <code>disableSolutionSearching</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>When working with <a href=\"/docs/handbook/project-references.html\">composite TypeScript projects</a>, this option provides a way to declare that you do not want a project to be included when using features like <em>find all references</em> or <em>jump to definition</em> in an editor.</p>\n<p>This flag is something you can use to increase responsiveness in large composite projects.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>disableSolutionSearching</p>\n<td/></tr>\n<tr><td>Released</td><td><p><a href=\"/docs/handbook/release-notes/typescript-3-8.html\">3.8</a></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='noImplicitUseStrict'><a aria-label=\"Link to the compiler option:noImplicitUseStrict\" title=\"Link to the compiler option:noImplicitUseStrict\" href='#noImplicitUseStrict' name='noImplicitUseStrict'>#</a> No Implicit Use Strict - <code>noImplicitUseStrict</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>You shouldn’t need this. By default, when emitting a module file to a non-ES6 target, TypeScript emits a <code>\"use strict\";</code> prologue at the top of the file.\nThis setting disables the prologue.</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">js</div><div class='code-container'><code><span style=\"color: #000000\">define([</span><span style=\"color: #A31515\">\"require\"</span><span style=\"color: #000000\">, </span><span style=\"color: #A31515\">\"exports\"</span><span style=\"color: #000000\">], </span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> (require, exports) {</span>\n<span style=\"color: #000000\">    exports.__esModule = </span><span style=\"color: #0000FF\">true</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> fn() { }</span>\n<span style=\"color: #000000\">    exports.fn = fn;</span>\n<span style=\"color: #000000\">});</span></code></div></pre>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">js</div><div class='code-container'><code><span style=\"color: #000000\">define([</span><span style=\"color: #A31515\">\"require\"</span><span style=\"color: #000000\">, </span><span style=\"color: #A31515\">\"exports\"</span><span style=\"color: #000000\">], </span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> (require, exports) {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #A31515\">\"use strict\"</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #000000\">    exports.__esModule = </span><span style=\"color: #0000FF\">true</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> fn() { }</span>\n<span style=\"color: #000000\">    exports.fn = fn;</span>\n<span style=\"color: #000000\">});</span></code></div></pre>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>noImplicitUseStrict</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='noEmitHelpers'><a aria-label=\"Link to the compiler option:noEmitHelpers\" title=\"Link to the compiler option:noEmitHelpers\" href='#noEmitHelpers' name='noEmitHelpers'>#</a> No Emit Helpers - <code>noEmitHelpers</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>Instead of importing helpers with <a href=\"#importHelpers\"><code>importHelpers</code></a>, you can provide implementations in the global scope for the helpers you use and completely turn off emitting of helper functions.</p>\n<p>For example, using this <code>async</code> function in ES5 requires a <code>await</code>-like function and <code>generator</code>-like function to run:</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> <span class='lsp'>getAPI <span class='lsp-result'>const getAPI: (url: string) =&gt; Promise&lt;{}&gt;</span></span>= </span><span style=\"color: #0000FF\">async</span><span style=\"color: #000000\"> (<span class='lsp'>url:<span class='lsp-result'>(parameter) url: string</span></span> string) </span><span style=\"color: #0000FF\">=></span><span style=\"color: #000000\"> {</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #008000\">// Get API</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> {};</span>\n<span style=\"color: #000000\">};</span></code></div></pre>\n<p>Which creates quite a lot of JavaScript:</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">js</div><div class='code-container'><code><span style=\"color: #A31515\">\"use strict\"</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> __awaiter = (</span><span style=\"color: #0000FF\">this</span><span style=\"color: #000000\"> && </span><span style=\"color: #0000FF\">this</span><span style=\"color: #000000\">.__awaiter) || </span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> (thisArg, _arguments, P, generator) {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> adopt(value) { </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> value </span><span style=\"color: #0000FF\">instanceof</span><span style=\"color: #000000\"> P ? value : </span><span style=\"color: #0000FF\">new</span><span style=\"color: #000000\"> P(</span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> (resolve) { resolve(value); }); }</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">new</span><span style=\"color: #000000\"> (P || (P = Promise))(</span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> (resolve, reject) {</span>\n<span style=\"color: #000000\">        </span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> fulfilled(value) { </span><span style=\"color: #0000FF\">try</span><span style=\"color: #000000\"> { step(generator.next(value)); } </span><span style=\"color: #0000FF\">catch</span><span style=\"color: #000000\"> (e) { reject(e); } }</span>\n<span style=\"color: #000000\">        </span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> rejected(value) { </span><span style=\"color: #0000FF\">try</span><span style=\"color: #000000\"> { step(generator[</span><span style=\"color: #A31515\">\"throw\"</span><span style=\"color: #000000\">](value)); } </span><span style=\"color: #0000FF\">catch</span><span style=\"color: #000000\"> (e) { reject(e); } }</span>\n<span style=\"color: #000000\">        </span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }</span>\n<span style=\"color: #000000\">        step((generator = generator.apply(thisArg, _arguments || [])).next());</span>\n<span style=\"color: #000000\">    });</span>\n<span style=\"color: #000000\">};</span>\n<span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> __generator = (</span><span style=\"color: #0000FF\">this</span><span style=\"color: #000000\"> && </span><span style=\"color: #0000FF\">this</span><span style=\"color: #000000\">.__generator) || </span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> (thisArg, body) {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> _ = { label: </span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\">, sent: </span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\">() { </span><span style=\"color: #0000FF\">if</span><span style=\"color: #000000\"> (t[</span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\">] & </span><span style=\"color: #09835A\">1</span><span style=\"color: #000000\">) </span><span style=\"color: #0000FF\">throw</span><span style=\"color: #000000\"> t[</span><span style=\"color: #09835A\">1</span><span style=\"color: #000000\">]; </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> t[</span><span style=\"color: #09835A\">1</span><span style=\"color: #000000\">]; }, trys: [], ops: [] }, f, y, t, g;</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> g = { next: verb(</span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\">), </span><span style=\"color: #A31515\">\"throw\"</span><span style=\"color: #000000\">: verb(</span><span style=\"color: #09835A\">1</span><span style=\"color: #000000\">), </span><span style=\"color: #A31515\">\"return\"</span><span style=\"color: #000000\">: verb(</span><span style=\"color: #09835A\">2</span><span style=\"color: #000000\">) }, </span><span style=\"color: #0000FF\">typeof</span><span style=\"color: #000000\"> Symbol === </span><span style=\"color: #A31515\">\"function\"</span><span style=\"color: #000000\"> && (g[Symbol.iterator] = </span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\">() { </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">this</span><span style=\"color: #000000\">; }), g;</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> verb(n) { </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> (v) { </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> step([n, v]); }; }</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> step(op) {</span>\n<span style=\"color: #000000\">        </span><span style=\"color: #0000FF\">if</span><span style=\"color: #000000\"> (f) </span><span style=\"color: #0000FF\">throw</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">new</span><span style=\"color: #000000\"> TypeError(</span><span style=\"color: #A31515\">\"Generator is already executing.\"</span><span style=\"color: #000000\">);</span>\n<span style=\"color: #000000\">        </span><span style=\"color: #0000FF\">while</span><span style=\"color: #000000\"> (_) </span><span style=\"color: #0000FF\">try</span><span style=\"color: #000000\"> {</span>\n<span style=\"color: #000000\">            </span><span style=\"color: #0000FF\">if</span><span style=\"color: #000000\"> (f = </span><span style=\"color: #09835A\">1</span><span style=\"color: #000000\">, y && (t = op[</span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\">] & </span><span style=\"color: #09835A\">2</span><span style=\"color: #000000\"> ? y[</span><span style=\"color: #A31515\">\"return\"</span><span style=\"color: #000000\">] : op[</span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\">] ? y[</span><span style=\"color: #A31515\">\"throw\"</span><span style=\"color: #000000\">] || ((t = y[</span><span style=\"color: #A31515\">\"return\"</span><span style=\"color: #000000\">]) && t.call(y), </span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\">) : y.next) && !(t = t.call(y, op[</span><span style=\"color: #09835A\">1</span><span style=\"color: #000000\">])).done) </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> t;</span>\n<span style=\"color: #000000\">            </span><span style=\"color: #0000FF\">if</span><span style=\"color: #000000\"> (y = </span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\">, t) op = [op[</span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\">] & </span><span style=\"color: #09835A\">2</span><span style=\"color: #000000\">, t.value];</span>\n<span style=\"color: #000000\">            </span><span style=\"color: #0000FF\">switch</span><span style=\"color: #000000\"> (op[</span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\">]) {</span>\n<span style=\"color: #000000\">                </span><span style=\"color: #0000FF\">case</span><span style=\"color: #000000\"> </span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\">: </span><span style=\"color: #0000FF\">case</span><span style=\"color: #000000\"> </span><span style=\"color: #09835A\">1</span><span style=\"color: #000000\">: t = op; </span><span style=\"color: #0000FF\">break</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #000000\">                </span><span style=\"color: #0000FF\">case</span><span style=\"color: #000000\"> </span><span style=\"color: #09835A\">4</span><span style=\"color: #000000\">: _.label++; </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> { value: op[</span><span style=\"color: #09835A\">1</span><span style=\"color: #000000\">], done: </span><span style=\"color: #0000FF\">false</span><span style=\"color: #000000\"> };</span>\n<span style=\"color: #000000\">                </span><span style=\"color: #0000FF\">case</span><span style=\"color: #000000\"> </span><span style=\"color: #09835A\">5</span><span style=\"color: #000000\">: _.label++; y = op[</span><span style=\"color: #09835A\">1</span><span style=\"color: #000000\">]; op = [</span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\">]; </span><span style=\"color: #0000FF\">continue</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #000000\">                </span><span style=\"color: #0000FF\">case</span><span style=\"color: #000000\"> </span><span style=\"color: #09835A\">7</span><span style=\"color: #000000\">: op = _.ops.pop(); _.trys.pop(); </span><span style=\"color: #0000FF\">continue</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #000000\">                </span><span style=\"color: #0000FF\">default</span><span style=\"color: #000000\">:</span>\n<span style=\"color: #000000\">                    </span><span style=\"color: #0000FF\">if</span><span style=\"color: #000000\"> (!(t = _.trys, t = t.length > </span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\"> && t[t.length - </span><span style=\"color: #09835A\">1</span><span style=\"color: #000000\">]) && (op[</span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\">] === </span><span style=\"color: #09835A\">6</span><span style=\"color: #000000\"> || op[</span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\">] === </span><span style=\"color: #09835A\">2</span><span style=\"color: #000000\">)) { _ = </span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\">; </span><span style=\"color: #0000FF\">continue</span><span style=\"color: #000000\">; }</span>\n<span style=\"color: #000000\">                    </span><span style=\"color: #0000FF\">if</span><span style=\"color: #000000\"> (op[</span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\">] === </span><span style=\"color: #09835A\">3</span><span style=\"color: #000000\"> && (!t || (op[</span><span style=\"color: #09835A\">1</span><span style=\"color: #000000\">] > t[</span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\">] && op[</span><span style=\"color: #09835A\">1</span><span style=\"color: #000000\">] < t[</span><span style=\"color: #09835A\">3</span><span style=\"color: #000000\">]))) { _.label = op[</span><span style=\"color: #09835A\">1</span><span style=\"color: #000000\">]; </span><span style=\"color: #0000FF\">break</span><span style=\"color: #000000\">; }</span>\n<span style=\"color: #000000\">                    </span><span style=\"color: #0000FF\">if</span><span style=\"color: #000000\"> (op[</span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\">] === </span><span style=\"color: #09835A\">6</span><span style=\"color: #000000\"> && _.label < t[</span><span style=\"color: #09835A\">1</span><span style=\"color: #000000\">]) { _.label = t[</span><span style=\"color: #09835A\">1</span><span style=\"color: #000000\">]; t = op; </span><span style=\"color: #0000FF\">break</span><span style=\"color: #000000\">; }</span>\n<span style=\"color: #000000\">                    </span><span style=\"color: #0000FF\">if</span><span style=\"color: #000000\"> (t && _.label < t[</span><span style=\"color: #09835A\">2</span><span style=\"color: #000000\">]) { _.label = t[</span><span style=\"color: #09835A\">2</span><span style=\"color: #000000\">]; _.ops.push(op); </span><span style=\"color: #0000FF\">break</span><span style=\"color: #000000\">; }</span>\n<span style=\"color: #000000\">                    </span><span style=\"color: #0000FF\">if</span><span style=\"color: #000000\"> (t[</span><span style=\"color: #09835A\">2</span><span style=\"color: #000000\">]) _.ops.pop();</span>\n<span style=\"color: #000000\">                    _.trys.pop(); </span><span style=\"color: #0000FF\">continue</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #000000\">            }</span>\n<span style=\"color: #000000\">            op = body.call(thisArg, _);</span>\n<span style=\"color: #000000\">        } </span><span style=\"color: #0000FF\">catch</span><span style=\"color: #000000\"> (e) { op = [</span><span style=\"color: #09835A\">6</span><span style=\"color: #000000\">, e]; y = </span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\">; } </span><span style=\"color: #0000FF\">finally</span><span style=\"color: #000000\"> { f = t = </span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\">; }</span>\n<span style=\"color: #000000\">        </span><span style=\"color: #0000FF\">if</span><span style=\"color: #000000\"> (op[</span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\">] & </span><span style=\"color: #09835A\">5</span><span style=\"color: #000000\">) </span><span style=\"color: #0000FF\">throw</span><span style=\"color: #000000\"> op[</span><span style=\"color: #09835A\">1</span><span style=\"color: #000000\">]; </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> { value: op[</span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\">] ? op[</span><span style=\"color: #09835A\">1</span><span style=\"color: #000000\">] : </span><span style=\"color: #0000FF\">void</span><span style=\"color: #000000\"> </span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\">, done: </span><span style=\"color: #0000FF\">true</span><span style=\"color: #000000\"> };</span>\n<span style=\"color: #000000\">    }</span>\n<span style=\"color: #000000\">};</span>\n<span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> getAPI = </span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> (url) { </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> __awaiter(</span><span style=\"color: #0000FF\">void</span><span style=\"color: #000000\"> </span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\">, </span><span style=\"color: #0000FF\">void</span><span style=\"color: #000000\"> </span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\">, </span><span style=\"color: #0000FF\">void</span><span style=\"color: #000000\"> </span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\">, </span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> () {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> __generator(</span><span style=\"color: #0000FF\">this</span><span style=\"color: #000000\">, </span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> (_a) {</span>\n<span style=\"color: #000000\">        </span><span style=\"color: #008000\">// Get API</span>\n<span style=\"color: #000000\">        </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> [</span><span style=\"color: #09835A\">2</span><span style=\"color: #000000\"> </span><span style=\"color: #008000\">/*return*/</span><span style=\"color: #000000\">, {}];</span>\n<span style=\"color: #000000\">    });</span>\n<span style=\"color: #000000\">}); };</span></code></div></pre>\n<p>Which can be switched out with your own globals via this flag:</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">js</div><div class='code-container'><code><span style=\"color: #A31515\">\"use strict\"</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> getAPI = </span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> (url) { </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> __awaiter(</span><span style=\"color: #0000FF\">void</span><span style=\"color: #000000\"> </span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\">, </span><span style=\"color: #0000FF\">void</span><span style=\"color: #000000\"> </span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\">, </span><span style=\"color: #0000FF\">void</span><span style=\"color: #000000\"> </span><span style=\"color: #09835A\">0</span><span style=\"color: #000000\">, </span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> () {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> __generator(</span><span style=\"color: #0000FF\">this</span><span style=\"color: #000000\">, </span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> (_a) {</span>\n<span style=\"color: #000000\">        </span><span style=\"color: #008000\">// Get API</span>\n<span style=\"color: #000000\">        </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> [</span><span style=\"color: #09835A\">2</span><span style=\"color: #000000\"> </span><span style=\"color: #008000\">/*return*/</span><span style=\"color: #000000\">, {}];</span>\n<span style=\"color: #000000\">    });</span>\n<span style=\"color: #000000\">}); };</span></code></div></pre>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>noEmitHelpers</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr>\n<tr><td>Related</td><td><p><a href=\"#importHelpers\"><code>importHelpers</code></a></p>\n<td/></tr>\n<tr><td>Released</td><td><p><a href=\"/docs/handbook/release-notes/typescript-1-5.html\">1.5</a></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='noEmitOnError'><a aria-label=\"Link to the compiler option:noEmitOnError\" title=\"Link to the compiler option:noEmitOnError\" href='#noEmitOnError' name='noEmitOnError'>#</a> No Emit On Error - <code>noEmitOnError</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>Do not emit compiler output files like JavaScript source code, source-maps or declarations if any errors were reported.</p>\n<p>This defaults to <code>false</code>, making it easier to work with TypeScript in a watch-like environment where you may want to see results of changes to your code in another environment before making sure all errors are resolved.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>noEmitOnError</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr>\n<tr><td>Released</td><td><p><a href=\"/docs/handbook/release-notes/typescript-1-4.html\">1.4</a></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='preserveConstEnums'><a aria-label=\"Link to the compiler option:preserveConstEnums\" title=\"Link to the compiler option:preserveConstEnums\" href='#preserveConstEnums' name='preserveConstEnums'>#</a> Preserve Const Enums - <code>preserveConstEnums</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>Do not erase <code>const enum</code> declarations in generated code. <code>const enum</code>s provide a way to reduce the overall memory footprint\nof your application at runtime by emitting the enum value instead of a reference.</p>\n<p>For example with this TypeScript:</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">enum</span><span style=\"color: #000000\"> <span class='lsp'>Album <span class='lsp-result'>const enum Album</span></span></span>\n<span style=\"color: #000000\">  <span class='lsp'>JimmyEatWorldFutures <span class='lsp-result'>(enum member) Album.JimmyEatWorldFutures = 1</span></span>= </span><span style=\"color: #09835A\">1</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">  <span class='lsp'>TubRingZooHypothesis <span class='lsp-result'>(enum member) Album.TubRingZooHypothesis = 2</span></span>= </span><span style=\"color: #09835A\">2</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">  <span class='lsp'>DogFashionDiscoAdultery <span class='lsp-result'>(enum member) Album.DogFashionDiscoAdultery = 3</span></span>= </span><span style=\"color: #09835A\">3</span>\n<span style=\"color: #000000\">}</span>\n\n<span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> <span class='lsp'>selectedAlbum <span class='lsp-result'>const selectedAlbum: Album.JimmyEatWorldFutures</span></span>= <span class='lsp'>Album.<span class='lsp-result'>const enum Album</span></span><span class='lsp'>JimmyEatWorldFutures;<span class='lsp-result'>(enum member) Album.JimmyEatWorldFutures = 1</span></span></span>\n<span style=\"color: #0000FF\">if</span><span style=\"color: #000000\"> (<span class='lsp'>selectedAlbum <span class='lsp-result'>const selectedAlbum: Album.JimmyEatWorldFutures</span></span>=== <span class='lsp'>Album.<span class='lsp-result'>const enum Album</span></span><span class='lsp'>JimmyEatWorldFutures)<span class='lsp-result'>(enum member) Album.JimmyEatWorldFutures = 1</span></span> {</span>\n<span style=\"color: #000000\">  <span class='lsp'>console.<span class='lsp-result'>var console: Console</span></span><span class='lsp'>log(<span class='lsp-result'>(method) Console.log(message?: any, ...optionalParams: any[]): void</span></span></span><span style=\"color: #A31515\">\"That is a great choice.\"</span><span style=\"color: #000000\">);</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n<p>The default <code>const enum</code> behavior is to convert any <code>Album.Something</code> to the corresponding number literal, and to remove a reference\nto the enum from the JavaScript completely.</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">js</div><div class='code-container'><code><span style=\"color: #A31515\">\"use strict\"</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> selectedAlbum = </span><span style=\"color: #09835A\">1</span><span style=\"color: #000000\"> </span><span style=\"color: #008000\">/* JimmyEatWorldFutures */</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #0000FF\">if</span><span style=\"color: #000000\"> (selectedAlbum === </span><span style=\"color: #09835A\">1</span><span style=\"color: #000000\"> </span><span style=\"color: #008000\">/* JimmyEatWorldFutures */</span><span style=\"color: #000000\">) {</span>\n<span style=\"color: #000000\">    console.log(</span><span style=\"color: #A31515\">\"That is a great choice.\"</span><span style=\"color: #000000\">);</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n<p>With <code>preserveConstEnums</code> set to <code>true</code>, the <code>enum</code> exists at runtime and the numbers are still emitted.</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">js</div><div class='code-container'><code><span style=\"color: #A31515\">\"use strict\"</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #0000FF\">var</span><span style=\"color: #000000\"> Album;</span>\n<span style=\"color: #000000\">(</span><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> (Album) {</span>\n<span style=\"color: #000000\">    Album[Album[</span><span style=\"color: #A31515\">\"JimmyEatWorldFutures\"</span><span style=\"color: #000000\">] = </span><span style=\"color: #09835A\">1</span><span style=\"color: #000000\">] = </span><span style=\"color: #A31515\">\"JimmyEatWorldFutures\"</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #000000\">    Album[Album[</span><span style=\"color: #A31515\">\"TubRingZooHypothesis\"</span><span style=\"color: #000000\">] = </span><span style=\"color: #09835A\">2</span><span style=\"color: #000000\">] = </span><span style=\"color: #A31515\">\"TubRingZooHypothesis\"</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #000000\">    Album[Album[</span><span style=\"color: #A31515\">\"DogFashionDiscoAdultery\"</span><span style=\"color: #000000\">] = </span><span style=\"color: #09835A\">3</span><span style=\"color: #000000\">] = </span><span style=\"color: #A31515\">\"DogFashionDiscoAdultery\"</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #000000\">})(Album || (Album = {}));</span>\n<span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> selectedAlbum = </span><span style=\"color: #09835A\">1</span><span style=\"color: #000000\"> </span><span style=\"color: #008000\">/* JimmyEatWorldFutures */</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #0000FF\">if</span><span style=\"color: #000000\"> (selectedAlbum === </span><span style=\"color: #09835A\">1</span><span style=\"color: #000000\"> </span><span style=\"color: #008000\">/* JimmyEatWorldFutures */</span><span style=\"color: #000000\">) {</span>\n<span style=\"color: #000000\">    console.log(</span><span style=\"color: #A31515\">\"That is a great choice.\"</span><span style=\"color: #000000\">);</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n<p>This essentially makes such <code>const enums</code> a source-code feature only, with no runtime traces.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>preserveConstEnums</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='declarationDir'><a aria-label=\"Link to the compiler option:declarationDir\" title=\"Link to the compiler option:declarationDir\" href='#declarationDir' name='declarationDir'>#</a> Declaration Dir - <code>declarationDir</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>Offers a way to configure the root directory for where declaration files are emitted.</p>\n<pre><code>example\n├── index.ts\n├── package.json\n└── tsconfig.json\n</code></pre>\n<p>with this <code>tsconfig.json</code>:</p>\n<pre class=\"shiki\"><div class=\"language-id\">json</div><div class='code-container'><code><span style=\"color: #000000\">{</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0451A5\">\"compilerOptions\"</span><span style=\"color: #000000\">: {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0451A5\">\"declaration\"</span><span style=\"color: #000000\">: </span><span style=\"color: #0000FF\">true</span><span style=\"color: #000000\">,</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0451A5\">\"declarationDir\"</span><span style=\"color: #000000\">: </span><span style=\"color: #A31515\">\"./types\"</span>\n<span style=\"color: #000000\">  }</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n<p>Would place the d.ts for the <code>index.ts</code> in a <code>types</code> folder:</p>\n<pre><code>example\n├── index.js\n├── index.ts\n├── package.json\n├── tsconfig.json\n└── types\n    └── index.d.ts\n</code></pre>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>declarationDir</p>\n<td/></tr>\n<tr><td>Default</td><td><p> n/a</p>\n<td/></tr>\n<tr><td>Released</td><td><p><a href=\"/docs/handbook/release-notes/typescript-2-0.html\">2.0</a></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='skipLibCheck'><a aria-label=\"Link to the compiler option:skipLibCheck\" title=\"Link to the compiler option:skipLibCheck\" href='#skipLibCheck' name='skipLibCheck'>#</a> Skip Lib Check - <code>skipLibCheck</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>Skip type checking of declaration files.</p>\n<p>This can save time during compilation at the expense of type-system accuracy. For example, two libraries could\ndefine two copies of the same <code>type</code> in an inconsistent way. Rather than doing a full check of all <code>d.ts</code> files, TypeScript\nwill type check the code you specifically refer to in your app’s source code.</p>\n<p>A common case where you might think to use <code>skipLibCheck</code> is when there are two copies of a library’s types in\nyour <code>node_modules</code>. In these cases, you should consider using a feature like <a href=\"https://yarnpkg.com/lang/en/docs/selective-version-resolutions/\">yarn’s resolutions</a>\nto ensure there is only one copy of that dependency in your tree or investigate how to ensure there is\nonly one copy by understanding the dependency resolution to fix the issue without additional tooling.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>skipLibCheck</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr>\n<tr><td>Released</td><td><p><a href=\"/docs/handbook/release-notes/typescript-2-0.html\">2.0</a></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='allowUnusedLabels'><a aria-label=\"Link to the compiler option:allowUnusedLabels\" title=\"Link to the compiler option:allowUnusedLabels\" href='#allowUnusedLabels' name='allowUnusedLabels'>#</a> Allow Unused Labels - <code>allowUnusedLabels</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>Set to false to disable warnings about unused labels.</p>\n<p>Labels are very rare in JavaScript and typically indicate an attempt to write an object literal:</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> <span class='lsp'>verifyAge(<span class='lsp-result'>function verifyAge(age: number): void</span></span><span class='lsp'>age:<span class='lsp-result'>(parameter) age: number</span></span> number) {</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #008000\">// Forgot 'return' statement</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0000FF\">if</span><span style=\"color: #000000\"> (<span class='lsp'>age <span class='lsp-result'>(parameter) age: number</span></span>&gt; </span><span style=\"color: #09835A\">18</span><span style=\"color: #000000\">) {</span>\n<span style=\"color: #000000\">    <span class='err'>verified:</span></span><span style=\"color: #0000FF\">true</span><span style=\"color: #000000\">;</span>\n<span class=\"error\"><span>Unused label.</span><span class=\"code\">7028</span></span><span class=\"error-behind\">Unused label.</span><span style=\"color: #000000\">  }</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>allowUnusedLabels</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr>\n<tr><td>Released</td><td><p><a href=\"/docs/handbook/release-notes/typescript-1-8.html\">1.8</a></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='allowUnreachableCode'><a aria-label=\"Link to the compiler option:allowUnreachableCode\" title=\"Link to the compiler option:allowUnreachableCode\" href='#allowUnreachableCode' name='allowUnreachableCode'>#</a> Allow Unreachable Code - <code>allowUnreachableCode</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>Set to false to disable warnings about unreachable code.\nThese warnings are only about code which is provably unreachable due to the use of JavaScript syntax, for example:</p>\n<pre class=\"shiki\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> fn(n: number) {</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0000FF\">if</span><span style=\"color: #000000\"> (n &gt; </span><span style=\"color: #09835A\">5</span><span style=\"color: #000000\">) {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">true</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #000000\">  } </span><span style=\"color: #0000FF\">else</span><span style=\"color: #000000\"> {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">false</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #000000\">  }</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">true</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #000000\">}</span></code></div></pre>\n<p>With <code>\"allowUnreachableCode\": false</code>:</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> <span class='lsp'>fn(<span class='lsp-result'>function fn(n: number): boolean</span></span><span class='lsp'>n:<span class='lsp-result'>(parameter) n: number</span></span> number) {</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0000FF\">if</span><span style=\"color: #000000\"> (<span class='lsp'>n <span class='lsp-result'>(parameter) n: number</span></span>&gt; </span><span style=\"color: #09835A\">5</span><span style=\"color: #000000\">) {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">true</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #000000\">  } </span><span style=\"color: #0000FF\">else</span><span style=\"color: #000000\"> {</span>\n<span style=\"color: #000000\">    </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">false</span><span style=\"color: #000000\">;</span>\n<span style=\"color: #000000\">  }</span>\n<span style=\"color: #000000\">  </span><span style=\"color: #0000FF\">return</span><span style=\"color: #000000\"> </span><span style=\"color: #0000FF\">true</span><span style=\"color: #000000\">;</span>\n<span class=\"error\"><span>Unreachable code detected.</span><span class=\"code\">7027</span></span><span class=\"error-behind\">Unreachable code detected.</span><span style=\"color: #000000\">}</span></code></div></pre>\n<p>This does not affect errors on the basis of code which <em>appears</em> to be unreachable due to type analysis.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>allowUnreachableCode</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr>\n<tr><td>Released</td><td><p><a href=\"/docs/handbook/release-notes/typescript-1-8.html\">1.8</a></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='suppressExcessPropertyErrors'><a aria-label=\"Link to the compiler option:suppressExcessPropertyErrors\" title=\"Link to the compiler option:suppressExcessPropertyErrors\" href='#suppressExcessPropertyErrors' name='suppressExcessPropertyErrors'>#</a> Suppress Excess Property Errors - <code>suppressExcessPropertyErrors</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>This disables reporting of excess property errors, such as the one shown in the following example:</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">type</span><span style=\"color: #000000\"> <span class='lsp'>Point <span class='lsp-result'>type Point = {&#13;    x: number;&#13;    y: number;&#13;}</span></span>= { <span class='lsp'>x:<span class='lsp-result'>(property) x: number</span></span> number; <span class='lsp'>y:<span class='lsp-result'>(property) y: number</span></span> number };</span>\n<span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> <span class='lsp'>p:<span class='lsp-result'>const p: Point</span></span> <span class='lsp'>Point <span class='lsp-result'>type Point = {&#13;    x: number;&#13;    y: number;&#13;}</span></span>= { <span class='lsp'>x:<span class='lsp-result'>(property) x: number</span></span></span><span style=\"color: #09835A\">1</span><span style=\"color: #000000\">, <span class='lsp'>y:<span class='lsp-result'>(property) y: number</span></span></span><span style=\"color: #09835A\">3</span><span style=\"color: #000000\">, <span class='lsp'>m:<span class='lsp-result'>(property) m: number</span></span></span><span style=\"color: #09835A\">10</span><span style=\"color: #000000\"> };</span>\n<span class=\"error\"><span>Type '{ x: number; y: number; m: number; }' is not assignable to type 'Point'.\n  Object literal may only specify known properties, and 'm' does not exist in type 'Point'.</span><span class=\"code\">2322</span></span><span class=\"error-behind\">Type '{ x: number; y: number; m: number; }' is not assignable to type 'Point'.\n  Object literal may only specify known properties, and 'm' does not exist in type 'Point'.</span></code></div></pre>\n<p>This flag was added to help people migrate to the stricter checking of new object literals in <a href=\"/docs/handbook/release-notes/typescript-1-6.html#stricter-object-literal-assignment-checks\">TypeScript 1.6</a>.</p>\n<p>We don’t recommend using this flag in a modern codebase, you can suppress one-off cases where you need it using <code>// @ts-ignore</code>.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>suppressExcessPropertyErrors</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='suppressImplicitAnyIndexErrors'><a aria-label=\"Link to the compiler option:suppressImplicitAnyIndexErrors\" title=\"Link to the compiler option:suppressImplicitAnyIndexErrors\" href='#suppressImplicitAnyIndexErrors' name='suppressImplicitAnyIndexErrors'>#</a> Suppress Implicit Any Index Errors - <code>suppressImplicitAnyIndexErrors</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>Turning <code>noImplicitAny</code> on suppresses reporting the error about implicit anys when indexing into objects, as shown in the following example:</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> <span class='lsp'>obj <span class='lsp-result'>const obj: {&#13;    x: number;&#13;}</span></span>= { <span class='lsp'>x:<span class='lsp-result'>(property) x: number</span></span></span><span style=\"color: #09835A\">10</span><span style=\"color: #000000\"> };</span>\n<span style=\"color: #000000\"><span class='lsp'>console.<span class='lsp-result'>var console: Console</span></span><span class='lsp'>log(<span class='lsp-result'>(method) Console.log(message?: any, ...optionalParams: any[]): void</span></span><span class='lsp'>obj[<span class='lsp-result'>const obj: {&#13;    x: number;&#13;}</span></span></span><span style=\"color: #A31515\">\"foo\"</span><span style=\"color: #000000\">]);</span>\n<span class=\"error\"><span>Element implicitly has an 'any' type because expression of type '\"foo\"' can't be used to index type '{ x: number; }'.\n  Property 'foo' does not exist on type '{ x: number; }'.</span><span class=\"code\">7053</span></span><span class=\"error-behind\">Element implicitly has an 'any' type because expression of type '\"foo\"' can't be used to index type '{ x: number; }'.\n  Property 'foo' does not exist on type '{ x: number; }'.</span></code></div></pre>\n<p>Using <code>suppressImplicitAnyIndexErrors</code> is quite a drastic approach. It is recommended to use a <code>@ts-ignore</code> comment instead:</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">const</span><span style=\"color: #000000\"> <span class='lsp'>obj <span class='lsp-result'>const obj: {&#13;    x: number;&#13;}</span></span>= { <span class='lsp'>x:<span class='lsp-result'>(property) x: number</span></span></span><span style=\"color: #09835A\">10</span><span style=\"color: #000000\"> };</span>\n<span style=\"color: #008000\">// @ts-ignore</span>\n<span style=\"color: #000000\"><span class='lsp'>console.<span class='lsp-result'>var console: Console</span></span><span class='lsp'>log(<span class='lsp-result'>(method) Console.log(message?: any, ...optionalParams: any[]): void</span></span><span class='lsp'>obj[<span class='lsp-result'>const obj: {&#13;    x: number;&#13;}</span></span></span><span style=\"color: #A31515\">\"foo\"</span><span style=\"color: #000000\">]);</span></code></div></pre>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>suppressImplicitAnyIndexErrors</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='forceConsistentCasingInFileNames'><a aria-label=\"Link to the compiler option:forceConsistentCasingInFileNames\" title=\"Link to the compiler option:forceConsistentCasingInFileNames\" href='#forceConsistentCasingInFileNames' name='forceConsistentCasingInFileNames'>#</a> Force Consistent Casing In File Names - <code>forceConsistentCasingInFileNames</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>TypeScript follows the case sensitivity rules of the file system it’s running on.\nThis can be problematic if some developers are working in a case-sensitive file system and others aren’t.\nIf a file attempts to import <code>fileManager.ts</code> by specifying <code>./FileManager.ts</code> the file will be found in a case-insensitive file system, but not on a case-sensitive file system.</p>\n<p>When this option is set, TypeScript will issue an error if a program tries to include a file by a casing different from the casing on disk.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>forceConsistentCasingInFileNames</p>\n<td/></tr>\n<tr><td>Recommended</td><td><p>True</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='maxNodeModuleJsDepth'><a aria-label=\"Link to the compiler option:maxNodeModuleJsDepth\" title=\"Link to the compiler option:maxNodeModuleJsDepth\" href='#maxNodeModuleJsDepth' name='maxNodeModuleJsDepth'>#</a> Max Node Module JS Depth - <code>maxNodeModuleJsDepth</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>The maximum dependency depth to search under <code>node_modules</code> and load JavaScript files.</p>\n<p>This flag is can only be used when <a href=\"#allowJs\"><code>allowJs</code></a> is enabled, and is used if you want to have TypeScript infer types for all of the JavaScript inside your <code>node_modules</code>.</p>\n<p>Ideally this should stay at 0 (the default), and <code>d.ts</code> files should be used to explicitly define the shape of modules.\nHowever, there are cases where you may want to turn this on at the expense of speed and potential accuracy.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>maxNodeModuleJsDepth</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>0</code></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='noStrictGenericChecks'><a aria-label=\"Link to the compiler option:noStrictGenericChecks\" title=\"Link to the compiler option:noStrictGenericChecks\" href='#noStrictGenericChecks' name='noStrictGenericChecks'>#</a> No Strict Generic Checks - <code>noStrictGenericChecks</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>TypeScript will unify type parameters when comparing two generic functions functions</p>\n<pre class=\"shiki twoslash\"><div class=\"language-id\">ts</div><div class='code-container'><code><span style=\"color: #0000FF\">type</span><span style=\"color: #000000\"> <span class='lsp'>A <span class='lsp-result'>type A = &lt;T, U&gt;(x: T, y: U) =&gt; [T, U]</span></span>= &lt;<span class='lsp'>T,<span class='lsp-result'>(type parameter) T in &lt;T, U&gt;(x: T, y: U): [T, U]</span></span> <span class='lsp'>U&gt;<span class='lsp-result'>(type parameter) U in &lt;T, U&gt;(x: T, y: U): [T, U]</span></span>(<span class='lsp'>x:<span class='lsp-result'>(parameter) x: T</span></span> <span class='lsp'>T,<span class='lsp-result'>(type parameter) T in &lt;T, U&gt;(x: T, y: U): [T, U]</span></span> <span class='lsp'>y:<span class='lsp-result'>(parameter) y: U</span></span> <span class='lsp'>U)<span class='lsp-result'>(type parameter) U in &lt;T, U&gt;(x: T, y: U): [T, U]</span></span></span><span style=\"color: #0000FF\">=></span><span style=\"color: #000000\"> [<span class='lsp'>T,<span class='lsp-result'>(type parameter) T in &lt;T, U&gt;(x: T, y: U): [T, U]</span></span> <span class='lsp'>U]<span class='lsp-result'>(type parameter) U in &lt;T, U&gt;(x: T, y: U): [T, U]</span></span></span>\n<span style=\"color: #0000FF\">type</span><span style=\"color: #000000\"> <span class='lsp'>B <span class='lsp-result'>type B = &lt;S&gt;(x: S, y: S) =&gt; [S, S]</span></span>= &lt;<span class='lsp'>S&gt;<span class='lsp-result'>(type parameter) S in &lt;S&gt;(x: S, y: S): [S, S]</span></span>(<span class='lsp'>x:<span class='lsp-result'>(parameter) x: S</span></span> <span class='lsp'>S,<span class='lsp-result'>(type parameter) S in &lt;S&gt;(x: S, y: S): [S, S]</span></span> <span class='lsp'>y:<span class='lsp-result'>(parameter) y: S</span></span> <span class='lsp'>S)<span class='lsp-result'>(type parameter) S in &lt;S&gt;(x: S, y: S): [S, S]</span></span></span><span style=\"color: #0000FF\">=></span><span style=\"color: #000000\"> [<span class='lsp'>S,<span class='lsp-result'>(type parameter) S in &lt;S&gt;(x: S, y: S): [S, S]</span></span> <span class='lsp'>S]<span class='lsp-result'>(type parameter) S in &lt;S&gt;(x: S, y: S): [S, S]</span></span></span>\n\n<span style=\"color: #0000FF\">function</span><span style=\"color: #000000\"> <span class='lsp'>f(<span class='lsp-result'>function f(a: A, b: B): void</span></span><span class='lsp'>a:<span class='lsp-result'>(parameter) a: A</span></span> <span class='lsp'>A,<span class='lsp-result'>type A = &lt;T, U&gt;(x: T, y: U) =&gt; [T, U]</span></span> <span class='lsp'>b:<span class='lsp-result'>(parameter) b: B</span></span> <span class='lsp'>B)<span class='lsp-result'>type B = &lt;S&gt;(x: S, y: S) =&gt; [S, S]</span></span> {</span>\n<span style=\"color: #000000\">  <span class='lsp'>b <span class='lsp-result'>(parameter) b: B</span></span>= <span class='lsp'>a;<span class='lsp-result'>(parameter) a: A</span></span></span><span style=\"color: #008000\">// Ok</span>\n<span style=\"color: #000000\">  <span class='err lsp'>a <span class='lsp-result'>(parameter) a: A</span></span>= <span class='lsp'>b;<span class='lsp-result'>(parameter) b: B</span></span></span><span style=\"color: #008000\">// Error</span>\n<span class=\"error\"><span>Type 'B' is not assignable to type 'A'.\n  Types of parameters 'y' and 'y' are incompatible.\n    Type 'U' is not assignable to type 'T'.\n      'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.</span><span class=\"code\">2322</span></span><span class=\"error-behind\">Type 'B' is not assignable to type 'A'.\n  Types of parameters 'y' and 'y' are incompatible.\n    Type 'U' is not assignable to type 'T'.\n      'U' is assignable to the constraint of type 'T', but 'T' could be instantiated with a different subtype of constraint '{}'.</span><span style=\"color: #000000\">}</span></code></div></pre>\n<p>This flag can be used to remove that check.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>noStrictGenericChecks</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr>\n<tr><td>Released</td><td><p><a href=\"/docs/handbook/release-notes/typescript-2-4.html\">2.4</a></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='useDefineForClassFields'><a aria-label=\"Link to the compiler option:useDefineForClassFields\" title=\"Link to the compiler option:useDefineForClassFields\" href='#useDefineForClassFields' name='useDefineForClassFields'>#</a> Use Define For Class Fields - <code>useDefineForClassFields</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>This flag is used as part of migrating to the upcoming standard version of class fields. TypeScript introduced class fields many years before it was ratified in TC39. The latest version of the upcoming specification has a different runtime behavior to TypeScript’s implementation but the same syntax.</p>\n<p>This flag switches to the upcoming ECMA runtime behavior.</p>\n<p>You can read more about the transition in <a href=\"/docs/handbook/release-notes/typescript-3-7.html#the-usedefineforclassfields-flag-and-the-declare-property-modifier\">the 3.7 release notes</a>.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>useDefineForClassFields</p>\n<td/></tr>\n<tr><td>Released</td><td><p><a href=\"/docs/handbook/release-notes/typescript-3-7.html\">3.7</a></p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='keyofStringsOnly'><a aria-label=\"Link to the compiler option:keyofStringsOnly\" title=\"Link to the compiler option:keyofStringsOnly\" href='#keyofStringsOnly' name='keyofStringsOnly'>#</a> Keyof Strings Only - <code>keyofStringsOnly</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>This flag changes the <code>keyof</code> type operator to return <code>string</code> instead of <code>string | number</code> when applied to a type with a string index signature.</p>\n<p>This flag is used to help people keep this behavior from <a href=\"/docs/handbook/release-notes/typescript-2-9.html#support-number-and-symbol-named-properties-with-keyof-and-mapped-types\">before TypeScript 2.9’s release</a>.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>keyofStringsOnly</p>\n<td/></tr>\n<tr><td>Status</td><td><p>Deprecated</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr>\n<tr><td>Status</td><td><p>Deprecated</p>\n<td/></tr>\n<tr><td>Released</td><td><p><a href=\"/docs/handbook/release-notes/typescript-2-9.html\">2.9</a></p>\n<td/></tr></table>\n</div></section>\n<div class='category'>\n<h2 id='Command_line_Options_6171'><a href='#Command_line_Options_6171' name='Command_line_Options_6171'>#</a> Command Line</h2>\n</div>\n<section class='compiler-option'>\n<h3 id='preserveWatchOutput'><a aria-label=\"Link to the compiler option:preserveWatchOutput\" title=\"Link to the compiler option:preserveWatchOutput\" href='#preserveWatchOutput' name='preserveWatchOutput'>#</a> Preserve Watch Output - <code>preserveWatchOutput</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>Whether to keep outdated console output in watch mode instead of clearing the screen every time a change happened.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>preserveWatchOutput</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>false</code></p>\n<td/></tr>\n<tr><td>Status</td><td><p>internal</p>\n<td/></tr></table>\n</div></section>\n<section class='compiler-option'>\n<h3 id='pretty'><a aria-label=\"Link to the compiler option:pretty\" title=\"Link to the compiler option:pretty\" href='#pretty' name='pretty'>#</a> Pretty - <code>pretty</code></h3>\n<div class='compiler-content'>\n<div class='markdown'>\n<p>Stylize errors and messages using color and context, this is on by default — offers you a chance to have less terse,\nsingle colored messages from the compiler.</p>\n</div>\n<table class='compiler-option-md'><tr><th /><th /></tr><tr><td>Flag</td><td><p>pretty</p>\n<td/></tr>\n<tr><td>Default</td><td><p><code>true</code></p>\n<td/></tr></table>\n</div></section>","frontmatter":{"permalink":null}}},"pageContext":{"locale":"en","tsconfigMDPath":"/home/runner/work/TypeScript-Website/TypeScript-Website/packages/tsconfig-reference/output/en.md","categoriesPath":"/home/runner/work/TypeScript-Website/TypeScript-Website/packages/tsconfig-reference/output/en.json"}}}