Interface TypeScriptCompilerOptions
-
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
TypeScriptCompilerOptions.Jsii$Proxy
@Generated(value="jsii-pacmak/1.96.0 (build 921e240)", date="2024-03-28T21:16:43.203Z") @Stability(Experimental) public interface TypeScriptCompilerOptions extends software.amazon.jsii.JsiiSerializable
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classTypeScriptCompilerOptions.BuilderA builder forTypeScriptCompilerOptionsstatic classTypeScriptCompilerOptions.Jsii$ProxyAn implementation forTypeScriptCompilerOptions
-
Method Summary
All Methods Static Methods Instance Methods Default Methods Modifier and Type Method Description static TypeScriptCompilerOptions.Builderbuilder()default BooleangetAllowArbitraryExtensions()(experimental) Suppress arbitrary extension import errors with the assumption that a bundler will be handling it.default BooleangetAllowImportingTsExtensions()(experimental) Allows TypeScript files to import each other with TypeScript-specific extensions (.ts,.mts,.tsx).default BooleangetAllowJs()(experimental) Allow JavaScript files to be compiled.default BooleangetAllowSyntheticDefaultImports()(experimental) Allow default imports from modules with no default export.default BooleangetAllowUnreachableCode()(experimental) Allow Unreachable Code.default BooleangetAllowUnusedLabels()(experimental) Allow Unused Labels.default BooleangetAlwaysStrict()(experimental) Ensures that your files are parsed in the ECMAScript strict mode, and emit “use strict” for each source file.default StringgetBaseUrl()(experimental) Lets you set a base directory to resolve non-absolute module names.default BooleangetCheckJs()(experimental) Check JS.default List<String>getCustomConditions()(experimental) List of additional conditions that should succeed when TypeScript resolves from anexportsorimportsfield of apackage.json.default BooleangetDeclaration()(experimental) To be specified along with the above.default StringgetDeclarationDir()(experimental) Offers a way to configure the root directory for where declaration files are emitted.default BooleangetDeclarationMap()(experimental) Generates a source map for .d.ts files which map back to the original .ts source file.default BooleangetDownlevelIteration()(experimental) Downleveling is TypeScript’s term for transpiling to an older version of JavaScript.default BooleangetEmitDeclarationOnly()(experimental) Only emit .d.ts files; do not emit .js files.default BooleangetEmitDecoratorMetadata()(experimental) Enables experimental support for decorators, which is in stage 2 of the TC39 standardization process.default BooleangetEsModuleInterop()(experimental) Emit __importStar and __importDefault helpers for runtime babel ecosystem compatibility and enable --allowSyntheticDefaultImports for typesystem compatibility.default BooleangetExactOptionalPropertyTypes()(experimental) Specifies that optional property types should be interpreted exactly as written, meaning that| undefinedis not added to the type Available with TypeScript 4.4 and newer.default BooleangetExperimentalDecorators()(experimental) Enables experimental support for decorators, which is in stage 2 of the TC39 standardization process.default BooleangetForceConsistentCasingInFileNames()(experimental) Disallow inconsistently-cased references to the same file.default TypeScriptImportsNotUsedAsValuesgetImportsNotUsedAsValues()(experimental) This flag works because you can useimport typeto explicitly create animportstatement which should never be emitted into JavaScript.default BooleangetIncremental()(experimental) Tells TypeScript to save information about the project graph from the last compilation to files stored on disk.default BooleangetInlineSourceMap()(experimental) When set, instead of writing out a .js.map file to provide source maps, TypeScript will embed the source map content in the .js files.default BooleangetInlineSources()(experimental) When set, TypeScript will include the original content of the .ts file as an embedded string in the source map.default BooleangetIsolatedModules()(experimental) Perform additional checks to ensure that separate compilation (such as with transpileModule or.default TypeScriptJsxModegetJsx()(experimental) Support JSX in .tsx files: "react", "preserve", "react-native" etc.default StringgetJsxImportSource()(experimental) Declares the module specifier to be used for importing the jsx and jsxs factory functions when using jsx.default List<String>getLib()(experimental) Reference for type definitions / libraries to use (eg.default StringgetModule()(experimental) Sets the module system for the program.default TypeScriptModuleResolutiongetModuleResolution()(experimental) Determine how modules get resolved.default BooleangetNoEmit()(experimental) Do not emit outputs.default BooleangetNoEmitOnError()(experimental) Do not emit compiler output files like JavaScript source code, source-maps or declarations if any errors were reported.default BooleangetNoFallthroughCasesInSwitch()(experimental) Report errors for fallthrough cases in switch statements.default BooleangetNoImplicitAny()(experimental) In some cases where no type annotations are present, TypeScript will fall back to a type of any for a variable when it cannot infer the type.default BooleangetNoImplicitOverride()(experimental) UsingnoImplicitOverride, you can ensure that sub-classes never go out of sync as they are required to explicitly declare that they are overriding a member using theoverridekeyword.default BooleangetNoImplicitReturns()(experimental) When enabled, TypeScript will check all code paths in a function to ensure they return a value.default BooleangetNoImplicitThis()(experimental) Raise error on ‘this’ expressions with an implied ‘any’ type.default BooleangetNoPropertyAccessFromIndexSignature()(experimental) Raise error on use of the dot syntax to access fields which are not defined.default BooleangetNoUncheckedIndexedAccess()(experimental) Raise error when accessing indexes on objects with unknown keys defined in index signatures.default BooleangetNoUnusedLocals()(experimental) Report errors on unused local variables.default BooleangetNoUnusedParameters()(experimental) Report errors on unused parameters in functions.default StringgetOutDir()(experimental) Output directory for the compiled files.default Map<String,List<String>>getPaths()(experimental) A series of entries which re-map imports to lookup locations relative to the baseUrl, there is a larger coverage of paths in the handbook.default BooleangetResolveJsonModule()(experimental) Allows importing modules with a ‘.json’ extension, which is a common practice in node projects.default BooleangetResolvePackageJsonExports()(experimental) Forces TypeScript to consult theexportsfield ofpackage.jsonfiles if it ever reads from a package innode_modules.default BooleangetResolvePackageJsonImports()(experimental) Forces TypeScript to consult theimportsfield ofpackage.jsonwhen performing a lookup that begins with#from a file that has apackage.jsonas an ancestor.default StringgetRootDir()(experimental) Specifies the root directory of input files.default BooleangetSkipLibCheck()(experimental) Skip type checking of all declaration files (*.d.ts).default BooleangetSourceMap()(experimental) Enables the generation of sourcemap files.default StringgetSourceRoot()(experimental) Specify the location where a debugger should locate TypeScript files instead of relative source locations.default BooleangetStrict()(experimental) The strict flag enables a wide range of type checking behavior that results in stronger guarantees of program correctness.default BooleangetStrictNullChecks()(experimental) When strictNullChecks is false, null and undefined are effectively ignored by the language.default BooleangetStrictPropertyInitialization()(experimental) When set to true, TypeScript will raise an error when a class property was declared but not set in the constructor.default BooleangetStripInternal()(experimental) Do not emit declarations for code that has an@internalannotation in it’s JSDoc comment.default StringgetTarget()(experimental) Modern browsers support all ES6 features, so ES6 is a good choice.default StringgetTsBuildInfoFile()(experimental) This setting lets you specify a file for storing incremental compilation information as a part of composite projects which enables faster building of larger TypeScript codebases.default List<String>getTypes()(experimental) If types is specified, only packages listed will be included in the global scope.default BooleangetUseUnknownInCatchVariables()(experimental) Change the type of the variable in a catch clause from any to unknown Available with TypeScript 4.4 and newer.default BooleangetVerbatimModuleSyntax()(experimental) Simplifies TypeScript's handling of import/exporttypemodifiers.
-
-
-
Method Detail
-
getAllowArbitraryExtensions
@Stability(Experimental) @Nullable default Boolean getAllowArbitraryExtensions()
(experimental) Suppress arbitrary extension import errors with the assumption that a bundler will be handling it.Default: undefined
-
getAllowImportingTsExtensions
@Stability(Experimental) @Nullable default Boolean getAllowImportingTsExtensions()
(experimental) Allows TypeScript files to import each other with TypeScript-specific extensions (.ts,.mts,.tsx). RequiresnoEmitoremitDeclarationOnly.Default: undefined
-
getAllowJs
@Stability(Experimental) @Nullable default Boolean getAllowJs()
(experimental) Allow JavaScript files to be compiled.Default: false
-
getAllowSyntheticDefaultImports
@Stability(Experimental) @Nullable default Boolean getAllowSyntheticDefaultImports()
(experimental) Allow default imports from modules with no default export.This does not affect code emit, just typechecking.
-
getAllowUnreachableCode
@Stability(Experimental) @Nullable default Boolean getAllowUnreachableCode()
(experimental) Allow Unreachable Code.When:
undefined(default) provide suggestions as warnings to editorstrueunreachable code is ignoredfalseraises compiler errors about unreachable code
These warnings are only about code which is provably unreachable due to the use of JavaScript syntax.
-
getAllowUnusedLabels
@Stability(Experimental) @Nullable default Boolean getAllowUnusedLabels()
(experimental) Allow Unused Labels.When:
undefined(default) provide suggestions as warnings to editorstrueunused labels are ignoredfalseraises compiler errors about unused labels
Labels are very rare in JavaScript and typically indicate an attempt to write an object literal:
function verifyAge(age: number) { // Forgot 'return' statement if (age > 18) { verified: true; // ^^^^^^^^ Unused label. } }
-
getAlwaysStrict
@Stability(Experimental) @Nullable default Boolean getAlwaysStrict()
(experimental) Ensures that your files are parsed in the ECMAScript strict mode, and emit “use strict” for each source file.Default: true
-
getBaseUrl
@Stability(Experimental) @Nullable default String getBaseUrl()
(experimental) Lets you set a base directory to resolve non-absolute module names.You can define a root folder where you can do absolute file resolution.
-
getCheckJs
@Stability(Experimental) @Nullable default Boolean getCheckJs()
(experimental) Check JS.Works in tandem with allowJs. When checkJs is enabled then errors are reported in JavaScript files. This is the equivalent of including //
-
getCustomConditions
@Stability(Experimental) @Nullable default List<String> getCustomConditions()
(experimental) List of additional conditions that should succeed when TypeScript resolves from anexportsorimportsfield of apackage.json.Default: undefined
-
getDeclaration
@Stability(Experimental) @Nullable default Boolean getDeclaration()
(experimental) To be specified along with the above.
-
getDeclarationDir
@Stability(Experimental) @Nullable default String getDeclarationDir()
(experimental) Offers a way to configure the root directory for where declaration files are emitted.
-
getDeclarationMap
@Stability(Experimental) @Nullable default Boolean getDeclarationMap()
(experimental) Generates a source map for .d.ts files which map back to the original .ts source file. This will allow editors such as VS Code to go to the original .ts file when using features like Go to Definition.
-
getDownlevelIteration
@Stability(Experimental) @Nullable default Boolean getDownlevelIteration()
(experimental) Downleveling is TypeScript’s term for transpiling to an older version of JavaScript.This flag is to enable support for a more accurate implementation of how modern JavaScript iterates through new concepts in older JavaScript runtimes.
ECMAScript 6 added several new iteration primitives: the for / of loop (for (el of arr)), Array spread ([a, ...b]), argument spread (fn(...args)), and Symbol.iterator. downlevelIteration allows for these iteration primitives to be used more accurately in ES5 environments if a Symbol.iterator implementation is present.
-
getEmitDeclarationOnly
@Stability(Experimental) @Nullable default Boolean getEmitDeclarationOnly()
(experimental) Only emit .d.ts files; do not emit .js files.Default: false
-
getEmitDecoratorMetadata
@Stability(Experimental) @Nullable default Boolean getEmitDecoratorMetadata()
(experimental) Enables experimental support for decorators, which is in stage 2 of the TC39 standardization process.Decorators are a language feature which hasn’t yet been fully ratified into the JavaScript specification. This means that the implementation version in TypeScript may differ from the implementation in JavaScript when it it decided by TC39. You can find out more about decorator support in TypeScript in the handbook.
Default: undefined
-
getEsModuleInterop
@Stability(Experimental) @Nullable default Boolean getEsModuleInterop()
(experimental) Emit __importStar and __importDefault helpers for runtime babel ecosystem compatibility and enable --allowSyntheticDefaultImports for typesystem compatibility.Default: false
-
getExactOptionalPropertyTypes
@Stability(Experimental) @Nullable default Boolean getExactOptionalPropertyTypes()
(experimental) Specifies that optional property types should be interpreted exactly as written, meaning that| undefinedis not added to the type Available with TypeScript 4.4 and newer.Default: false
-
getExperimentalDecorators
@Stability(Experimental) @Nullable default Boolean getExperimentalDecorators()
(experimental) Enables experimental support for decorators, which is in stage 2 of the TC39 standardization process.Default: true
-
getForceConsistentCasingInFileNames
@Stability(Experimental) @Nullable default Boolean getForceConsistentCasingInFileNames()
(experimental) Disallow inconsistently-cased references to the same file.Default: false
-
getImportsNotUsedAsValues
@Stability(Experimental) @Nullable default TypeScriptImportsNotUsedAsValues getImportsNotUsedAsValues()
(experimental) This flag works because you can useimport typeto explicitly create animportstatement which should never be emitted into JavaScript.Default: "remove"
-
getIncremental
@Stability(Experimental) @Nullable default Boolean getIncremental()
(experimental) Tells TypeScript to save information about the project graph from the last compilation to files stored on disk.This creates a series of .tsbuildinfo files in the same folder as your compilation output. They are not used by your JavaScript at runtime and can be safely deleted. You can read more about the flag in the 3.4 release notes.
-
getInlineSourceMap
@Stability(Experimental) @Nullable default Boolean getInlineSourceMap()
(experimental) When set, instead of writing out a .js.map file to provide source maps, TypeScript will embed the source map content in the .js files.Default: true
-
getInlineSources
@Stability(Experimental) @Nullable default Boolean getInlineSources()
(experimental) When set, TypeScript will include the original content of the .ts file as an embedded string in the source map. This is often useful in the same cases as inlineSourceMap.Default: true
-
getIsolatedModules
@Stability(Experimental) @Nullable default Boolean getIsolatedModules()
(experimental) Perform additional checks to ensure that separate compilation (such as with transpileModule or.Default: false
-
getJsx
@Stability(Experimental) @Nullable default TypeScriptJsxMode getJsx()
(experimental) Support JSX in .tsx files: "react", "preserve", "react-native" etc.Default: undefined
-
getJsxImportSource
@Stability(Experimental) @Nullable default String getJsxImportSource()
(experimental) Declares the module specifier to be used for importing the jsx and jsxs factory functions when using jsx.Default: undefined
-
getLib
@Stability(Experimental) @Nullable default List<String> getLib()
(experimental) Reference for type definitions / libraries to use (eg.ES2016, ES5, ES2018).
Default: [ "es2018" ]
-
getModule
@Stability(Experimental) @Nullable default String getModule()
(experimental) Sets the module system for the program.See https://www.typescriptlang.org/docs/handbook/modules.html#ambient-modules.
Default: "CommonJS"
-
getModuleResolution
@Stability(Experimental) @Nullable default TypeScriptModuleResolution getModuleResolution()
(experimental) Determine how modules get resolved.Either "Node" for Node.js/io.js style resolution, or "Classic".
Default: "node"
-
getNoEmit
@Stability(Experimental) @Nullable default Boolean getNoEmit()
(experimental) Do not emit outputs.Default: false
-
getNoEmitOnError
@Stability(Experimental) @Nullable default Boolean getNoEmitOnError()
(experimental) Do not emit compiler output files like JavaScript source code, source-maps or declarations if any errors were reported.Default: true
-
getNoFallthroughCasesInSwitch
@Stability(Experimental) @Nullable default Boolean getNoFallthroughCasesInSwitch()
(experimental) Report errors for fallthrough cases in switch statements.Ensures that any non-empty case inside a switch statement includes either break or return. This means you won’t accidentally ship a case fallthrough bug.
Default: true
-
getNoImplicitAny
@Stability(Experimental) @Nullable default Boolean getNoImplicitAny()
(experimental) In some cases where no type annotations are present, TypeScript will fall back to a type of any for a variable when it cannot infer the type.Default: true
-
getNoImplicitOverride
@Stability(Experimental) @Nullable default Boolean getNoImplicitOverride()
(experimental) UsingnoImplicitOverride, you can ensure that sub-classes never go out of sync as they are required to explicitly declare that they are overriding a member using theoverridekeyword.This also improves readability of the programmer's intent.
Available with TypeScript 4.3 and newer.
Default: false
-
getNoImplicitReturns
@Stability(Experimental) @Nullable default Boolean getNoImplicitReturns()
(experimental) When enabled, TypeScript will check all code paths in a function to ensure they return a value.Default: true
-
getNoImplicitThis
@Stability(Experimental) @Nullable default Boolean getNoImplicitThis()
(experimental) Raise error on ‘this’ expressions with an implied ‘any’ type.Default: true
-
getNoPropertyAccessFromIndexSignature
@Stability(Experimental) @Nullable default Boolean getNoPropertyAccessFromIndexSignature()
(experimental) Raise error on use of the dot syntax to access fields which are not defined.Default: true
-
getNoUncheckedIndexedAccess
@Stability(Experimental) @Nullable default Boolean getNoUncheckedIndexedAccess()
(experimental) Raise error when accessing indexes on objects with unknown keys defined in index signatures.Default: true
-
getNoUnusedLocals
@Stability(Experimental) @Nullable default Boolean getNoUnusedLocals()
(experimental) Report errors on unused local variables.Default: true
-
getNoUnusedParameters
@Stability(Experimental) @Nullable default Boolean getNoUnusedParameters()
(experimental) Report errors on unused parameters in functions.Default: true
-
getOutDir
@Stability(Experimental) @Nullable default String getOutDir()
(experimental) Output directory for the compiled files.
-
getPaths
@Stability(Experimental) @Nullable default Map<String,List<String>> getPaths()
(experimental) A series of entries which re-map imports to lookup locations relative to the baseUrl, there is a larger coverage of paths in the handbook.paths lets you declare how TypeScript should resolve an import in your require/imports.
-
getResolveJsonModule
@Stability(Experimental) @Nullable default Boolean getResolveJsonModule()
(experimental) Allows importing modules with a ‘.json’ extension, which is a common practice in node projects. This includes generating a type for the import based on the static JSON shape.Default: true
-
getResolvePackageJsonExports
@Stability(Experimental) @Nullable default Boolean getResolvePackageJsonExports()
(experimental) Forces TypeScript to consult theexportsfield ofpackage.jsonfiles if it ever reads from a package innode_modules.Default: true
-
getResolvePackageJsonImports
@Stability(Experimental) @Nullable default Boolean getResolvePackageJsonImports()
(experimental) Forces TypeScript to consult theimportsfield ofpackage.jsonwhen performing a lookup that begins with#from a file that has apackage.jsonas an ancestor.Default: undefined
-
getRootDir
@Stability(Experimental) @Nullable default String getRootDir()
(experimental) Specifies the root directory of input files.Only use to control the output directory structure with
outDir.
-
getSkipLibCheck
@Stability(Experimental) @Nullable default Boolean getSkipLibCheck()
(experimental) Skip type checking of all declaration files (*.d.ts).Default: false
-
getSourceMap
@Stability(Experimental) @Nullable default Boolean getSourceMap()
(experimental) Enables the generation of sourcemap files.Default: undefined
-
getSourceRoot
@Stability(Experimental) @Nullable default String getSourceRoot()
(experimental) Specify the location where a debugger should locate TypeScript files instead of relative source locations.Default: undefined
-
getStrict
@Stability(Experimental) @Nullable default Boolean getStrict()
(experimental) The strict flag enables a wide range of type checking behavior that results in stronger guarantees of program correctness.Turning this on is equivalent to enabling all of the strict mode family options, which are outlined below. You can then turn off individual strict mode family checks as needed.
Default: true
-
getStrictNullChecks
@Stability(Experimental) @Nullable default Boolean getStrictNullChecks()
(experimental) When strictNullChecks is false, null and undefined are effectively ignored by the language.This can lead to unexpected errors at runtime. When strictNullChecks is true, null and undefined have their own distinct types and you’ll get a type error if you try to use them where a concrete value is expected.
Default: true
-
getStrictPropertyInitialization
@Stability(Experimental) @Nullable default Boolean getStrictPropertyInitialization()
(experimental) When set to true, TypeScript will raise an error when a class property was declared but not set in the constructor.Default: true
-
getStripInternal
@Stability(Experimental) @Nullable default Boolean getStripInternal()
(experimental) Do not emit declarations for code that has an@internalannotation in it’s JSDoc comment.Default: true
-
getTarget
@Stability(Experimental) @Nullable default String getTarget()
(experimental) Modern browsers support all ES6 features, so ES6 is a good choice.You 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.
Default: "ES2018"
-
getTsBuildInfoFile
@Stability(Experimental) @Nullable default String getTsBuildInfoFile()
(experimental) This setting lets you specify a file for storing incremental compilation information as a part of composite projects which enables faster building of larger TypeScript codebases.You can read more about composite projects in the handbook.
-
getTypes
@Stability(Experimental) @Nullable default List<String> getTypes()
(experimental) If types is specified, only packages listed will be included in the global scope.
-
getUseUnknownInCatchVariables
@Stability(Experimental) @Nullable default Boolean getUseUnknownInCatchVariables()
(experimental) Change the type of the variable in a catch clause from any to unknown Available with TypeScript 4.4 and newer.Default: true
-
getVerbatimModuleSyntax
@Stability(Experimental) @Nullable default Boolean getVerbatimModuleSyntax()
(experimental) Simplifies TypeScript's handling of import/exporttypemodifiers.Default: undefined
-
builder
@Stability(Experimental) static TypeScriptCompilerOptions.Builder builder()
- Returns:
- a
TypeScriptCompilerOptions.BuilderofTypeScriptCompilerOptions
-
-