Skip to content

0.22.0

Choose a tag to compare

@github-actions github-actions released this 05 Nov 03:27
Immutable release. Only release title and notes can be modified.
625f918

0.22.0

tsrs 0.22.0 targets TypeScript 7.1 beta. The TypeScript source pin remains microsoft/TypeScript@3e9236361fa9, with
the same TypeScript-compatible defaults and opt-in --fast preset as 0.21.0.

pnpm add -D tsrs@0.22.0-ts7.1.0-beta
# WebAssembly for Node and browsers:
pnpm add @tsrs/wasm@0.22.0-ts7.1.0-beta

One run for type-aware lint and type checking

Under the fast preset, oxlint --type-aware --type-check reports the same type errors as tsrs --noEmit for each
tsconfig program, so a project can drop its separate typecheck step and type-check in the lint run (#897, #902):

TSRS_FAST=1 OXLINT_TSGOLINT_PATH=node_modules/.bin/tsrs-lint oxlint --type-aware --type-check
  • Same errors as tsrs --noEmit. Every file tsrs --noEmit checks is checked, including files Oxlint does not
    lint (ignored or generated files, declaration files), and each program's global diagnostics are reported on its
    tsconfig. Files outside every tsconfig are linted but not type-checked. The type errors match
    tsrs -p <config> --noEmit on webpack (840), vscode (371), t3code-server (6) and a large private monorepo.
  • One program, one checking pass. Lint already resolves the types of nearly every expression, so checking in the
    same pass costs little more than a typecheck alone. Against running tsrs --noEmit and then lint, the single run
    took 21-37% less wall time and 27-49% fewer instructions on vscode, t3code-server, webpack and the private monorepo
    (measurements).
  • When it pays. Each tsconfig that Oxlint's files map to is checked whole, so the run replaces a typecheck of those
    same tsconfigs. A monorepo that typechecks one root config while lint maps its files to many overlapping package
    configs does more work this way: mikro-orm was 75% slower.
  • Default mode is unchanged. Without --fast, --type-check reports type errors for the files Oxlint sends, as
    tsgolint does.

See type checking in the lint run.

Other changes

  • Content mappers in the language server and the Node API. tsrs --lsp and tsrs --api --runExternalCode run
    contentMappers, so mapped files such as .vue check in editors and through rolldown-plugin-dts's
    generator: "tsrs", with diagnostics at their original positions (#885, fixing #877).
  • Content mappers in the linter. tsrs --lint --runExternalCode, or TSRS_LINT_RUN_EXTERNAL_CODE=1 under
    Oxlint, lints programs whose tsconfig has contentMappers instead of reporting a tsconfig error. Type errors in
    mapped files are reported at their original ranges, and rules skip mapped files (#883, fixing #876).
  • Incremental runs under --fast. Fast-mode build info records which files declare an interface, so an edit to
    a file without one no longer rechecks every interface-declaring file when a run starts from a tsbuildinfo (#900).
  • Fast-mode checker performance. Conditional-type simplification resolves the false branch first, and literal
    indexes into fixed tuples are answered from the tuple's type arguments, ported from
    teamchong/TypeScript#1 (#854).
  • Maintenance. Determinism CI runs in shards and the lint baselines run in parallel (#875).

Supported platforms and known limitations remain listed in the compatibility table.

Full changelog