Skip to Content
What’s NewTSTyche 7

Release Notes

This page lists breaking changes and notable new features. Please be sure to read the release notes before upgrading from previous version.

The detailed changelog can be found in TSTyche repository on GitHub .

TSTyche 7.0

TSTyche 7.0 ships with the new .toBeInstantiableWith() matcher and redesigned tsconfig option.

Keep in mind that TSTyche 7.0 is still in beta. More breaking changes may be introduced before the stable version is released. To install the latest beta version, use the next distribution tag:

npm add -D tstyche@next

Matchers

.toBeInstantiableWith()

The .toBeInstantiableWith() matcher checks if a generic is instantiable with the given type arguments.

import { type , } from "tstyche"; interface <, = unknown> { [: string]: (: ) => ; } <<>>()..<[void]>(); <<>>()..<[void, string]>(); <<>>()...<[]>();

The _ type can be used to fill in the required type arguments.

This matcher works with generic interfaces, type aliases, classes and functions:

import { } from "tstyche"; function <, >(: <>, : (: ) => ): <> { return .(); } ()..<[string, number]>(); ()...<[string]>();

Configuration

Breaking! Default configuration file location has changed. Now ./tstyche.json is loaded instead of ./tstyche.config.json.

checkSuppressedErrors

Checking for errors suppressed by @ts-expect-error directives in multi-line comments is now enabled.

This is useful in contexts where single line comments are not supported. For example, in TSX files:

function ProfileCard(props: { userName: string }) { return <>{props.userName}</>; } <> {/* @ts-expect-error Type 'boolean' is not assignable to type 'string'. */} <ProfileCard userName={true} /> </>;

rootPath

Breaking! The rootPath configuration option is removed.

Now the root directory is always set to the current directory. Or, when the --root command line option is set, to the provided path.

tsconfig

baseline is the new name of ignore.

{ - "tsconfig": "ignore" + "tsconfig": "baseline" }
Inline JSON

TSConfig can be provided as an inline JSON string. The implementation creates a synthetic TSConfig file in the root directory.

Configuration file:

{ "tsconfig": "{\"extends\":\"./tsconfig.json\",\"compilerOptions\":{\"lib\":[\"es2020\"]},\"include\":[\"**/*\"]}" }

Command line:

tstyche --tsconfig '{"extends":"./tsconfig.json","compilerOptions":{"lib":["es2020"]},"include":["**/*"]}'

Programmatic Usage

Breaking! The tstyche/tstyche entry point is renamed to tstyche/api.

Last updated on