Skip to content

chore(deps): update typescript to 5.9.3 and run the type tests with tstyche - #1524

Merged
Anber merged 2 commits into
callstack:masterfrom
Anber:chore/typescript-5-9-tstyche-type-tests
Oct 23, 2026
Merged

Anber merged 2 commits into
callstack:masterfrom
Anber:chore/typescript-5-9-tstyche-type-tests

Conversation

@Anber

@Anber Anber commented Oct 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

The type tests run on @definitelytyped/dtslint 0.0.176, whose dependencies keep request, tar 6, form-data 2, qs 6.5.5, tough-cookie 2 and uuid 3 in the lockfile. Two commits: TypeScript ^5.2.2 to ^5.9.3, then TSTyche 7.2.5 in place of dtslint. The test:dts script names, the turbo task and the CI step stay.

 // packages/react/package.json
-"test:dts": "dtslint --localTs ... __dtslint__ && dtslint --localTs ... __dtslint-react17__",
+"test:dts": "tstyche",

 // packages/core/__dtslint__/core.ts
-// $ExpectType string
-const combined1 = cx(class1, 'active');
+expect(cx(class1, 'active')).type.toBe<string>();
  • The 11 $ExpectType comments become expect(...).type.toBe<...>() with the same types; a tstyche.json per package selects the existing folders.
  • The 12 @ts-expect-error lines stay; checkSuppressedErrors: false in packages/react/tstyche.json stops TSTyche reading the text after the directive as an expected message (dtslint did not either).
  • The React 17 test asserts expect(Button).type.toBeCallableWith({}) instead of calling Button({}); the stub is unchanged.
  • tslint.json and three placeholder index.d.ts files go. dtslint 0.2.x was not an option: 0.2.47 only works inside a DefinitelyTyped checkout layout.
  • TypeScript stops at 5.x: 6.0 deprecates the baseUrl and moduleResolution: node options of the root tsconfig. Built declarations differ in @linaria/atomic and @linaria/postcss-linaria, which get a patch changeset; the others are identical.

Evidence

  • A lockfile audit against the npm advisory database goes from "27 vulnerable packages in 34 instances" on master to "23 vulnerable packages in 28 instances"; those six entries are gone and none is new.
  • pnpm turbo run test:dts exits 0: 3 assertions in @linaria/core, 9 in @linaria/react.
  • Five deliberate breaks each make it exit 1 and name the file, and reverting restores exit 0: a wrong expected type in the core test and in styled.ts, an unused @ts-expect-error in styled.ts and in styled-jsx.tsx, and Button('ok') in the React 17 test. That test also fails when a scratch copy of packages/react/src/styled.ts requires children.
  • TypeScript 5.9.3 (2025-09-30) and TSTyche 7.2.5 (2026-09-10) are the only new versions.

With pnpm 9.15.9 and Node 24.4.1 these exit 0 (the install, typecheck and sp:check also on the first commit; pnpm lint needs a built checkout):

pnpm install --frozen-lockfile --ignore-scripts --strict-peer-dependencies
TURBO_FORCE=true pnpm turbo run typecheck
pnpm turbo run test:dts
pnpm lint
pnpm sp:check

Left out

  • TypeScript 6 and 7.
  • The other dev tools.
  • Renaming the __dtslint__ folders and the CI step name.

Not verified

  • A CI run of this pull request.
  • Node 22 (the repository floor is 22.12.0; the local runs used 24.4.1).
  • test:dts on the first commit alone.
  • A merge with other changes to pnpm-lock.yaml, which would need the lockfile regenerated.

Anber added 2 commits October 23, 2026 14:00
Raise typescript from ^5.2.2 to ^5.9.3 in the root and @linaria/testkit
manifests. The lockfile locks typescript 5.9.3 in place of 5.2.2; the
other entries only change their typescript peer suffix. 5.9.3 is the
newest 5.x release: TypeScript 6 deprecates the baseUrl and
moduleResolution node options that the root tsconfig still uses.

The declaration files that build:declarations writes were compared
before and after the raise. They differ in two packages, so a patch
changeset covers them: the atomize helper of @linaria/atomic now
declares `className?: string` instead of `className?: string |
undefined`, and @linaria/postcss-linaria names the postcss Document and
Root types through the postcss entry point instead of postcss/lib/*.
The other published packages emit the same declarations.
Replace @definitelytyped/dtslint 0.0.176 with TSTyche 7.2.5 as the
runner of the type tests. dtslint 0.2 was not taken: 0.2.47 only runs
inside a DefinitelyTyped checkout, with each test folder under
types/<name> next to a DefinitelyTyped package.json, and its tsconfig
checks reject the baseUrl, noPropertyAccessFromIndexSignature and
React 17 stub paths options that these tests rely on.

The test:dts scripts of @linaria/core and @linaria/react now call
tstyche, and a tstyche.json in each package selects the existing test
folders, so the turbo task and the CI step stay as they are. Each test
folder keeps its own tsconfig.json.

The $ExpectType comments become expect(...).type.toBe<...>()
assertions with the same expected types. The @ts-expect-error lines
stay as they are: checkSuppressedErrors is off, since TSTyche would
otherwise read their explanations as fragments of the expected error
message, and TypeScript still fails the run on an unused directive.
The React 17 test now asserts that a styled button is callable without
children, next to the JSX it already compiled.

tslint.json, the TSLint directive in styled.ts and the index.d.ts files
that only dtslint needed are removed. The lockfile drops the dtslint
closure, request 2.88.2, form-data 2.3.3 and tar 6.2.0 among it, and
adds tstyche 7.2.5, which has no dependencies.
@changeset-bot

changeset-bot Bot commented Oct 23, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 94b3c7d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 9 packages
Name Type
@linaria/atomic Patch
@linaria/postcss-linaria Patch
@linaria/core Patch
@linaria/babel-plugin-interop Patch
linaria Patch
@linaria/react Patch
@linaria/server Patch
@linaria/stylelint-config-standard-linaria Patch
@linaria/stylelint Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@Anber
Anber merged commit 9fc8b2d into callstack:master Oct 23, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant