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
    • Method Detail

      • getAllowImportingTsExtensions

        @Stability(Experimental)
        @Nullable
        default Boolean getAllowImportingTsExtensions()
        (experimental) Allows TypeScript files to import each other with TypeScript-specific extensions (.ts, .mts, .tsx). Requires noEmit or emitDeclarationOnly.

        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 editors
        • true unreachable code is ignored
        • false raises compiler errors about unreachable code

        These warnings are only about code which is provably unreachable due to the use of JavaScript syntax.

        See Also:
        https://www.typescriptlang.org/tsconfig#allowUnreachableCode
      • getAllowUnusedLabels

        @Stability(Experimental)
        @Nullable
        default Boolean getAllowUnusedLabels()
        (experimental) Allow Unused Labels.

        When:

        • undefined (default) provide suggestions as warnings to editors
        • true unused labels are ignored
        • false raises 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.
           }
         }
         

        See Also:
        https://www.typescriptlang.org/tsconfig#allowUnusedLabels
      • 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.

      • 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.

        See Also:
        {@link https://www.typescriptlang.org/tsconfig#declarationMap}
      • 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

        See Also:
        https://www.typescriptlang.org/docs/handbook/decorators.html
      • 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 | undefined is 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

      • 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) Using noImplicitOverride, 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 the override keyword.

        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 the exports field of package.json files if it ever reads from a package in node_modules.

        Default: true

      • getResolvePackageJsonImports

        @Stability(Experimental)
        @Nullable
        default Boolean getResolvePackageJsonImports()
        (experimental) Forces TypeScript to consult the imports field of package.json when performing a lookup that begins with # from a file that has a package.json as 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 @internal annotation 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.

      • 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