Skip to Content
ProjectCompiler Options

Compiler Options

Compiler options for type testing are loaded from the nearest tsconfig.json. If none is found, TSTyche falls back to a set of defaults.

TSConfig File

TSTyche searches for the nearest tsconfig.json that includes the test file. The path of the discovered TSConfig file is included in the report:

uses TypeScript 5.9.3 with ./typetests/tsconfig.json

If a particular test file is not included in any of the TSConfig files found in enclosing directories, TSTyche falls back to default compiler options. The report looks like this:

uses TypeScript 5.9.3 with baseline TSConfig

To specify the path to tsconfig.json explicitly, pass the path with the --tsconfig command line option or use the tsconfig configuration option.

To inspect the resolved compiler configuration, pass the path of the TSConfig file to tsc together with the --showConfig option:

tsc --project ./typetests/tsconfig.json --showConfig

Default Compiler Options

TSTyche sets the following default compiler options:

{ "allowJs": true, "checkJs": true, "allowImportingTsExtensions": true, "exactOptionalPropertyTypes": true, "jsx": "preserve", "module": "nodenext", "moduleResolution": "nodenext", "noUncheckedIndexedAccess": true, "noUncheckedSideEffectImports": true, // only for TypeScript >=5.6 "resolveJsonModule": true, "strict": true, "target": "esnext" }

Your code editor may use different default compiler options. This is why TSTyche and your editor may see types differently. If that is an issue, add a tsconfig.json to your project — both TSTyche and your editor will use it.

Language Service Plugins

To work with files like .svelte or .vue, TypeScript relies on language service plugins . Code editors load them via extensions.

TSTyche makes sure the plugins are loaded, but they must be installed and explicitly listed in a TSConfig file. For example, if your type tests import from .svelte files, install the typescript-svelte-plugin package:

npm add -D typescript-svelte-plugin

Add it to the language service plugins list in tsconfig.json:

{ "compilerOptions": { "plugins": [{ "name": "typescript-svelte-plugin" }] } }
Last updated on