Skip to content

chore: update type test setup#1588

Merged
willfarrell merged 2 commits intomiddyjs:mainfrom
mrazauskas:update-type-test-setup
Mar 11, 2026
Merged

chore: update type test setup#1588
willfarrell merged 2 commits intomiddyjs:mainfrom
mrazauskas:update-type-test-setup

Conversation

@mrazauskas
Copy link
Contributor

What does this implement/fix? Explain your changes.

This PR updates type testing setup by removing redundant config files. Seems like only TSTyche is using tsconfig.json, but it does not need it. Strict compiler options are set by default (reference).

Todo List:

  • All commits are cryptographically signed

Signed-off-by: mrazauskas <tom@mrazauskas.de>
@mrazauskas mrazauskas requested a review from a team as a code owner March 11, 2026 07:55
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tiny clean up based on .github/workflows/test-unit.yml

test("httpErrorCodes", () => {
expect(util.httpErrorCodes).type.toBe<Record<number, string>>();
expect(util.httpErrorCodes[404]).type.toBe<string>();
expect(util.httpErrorCodes[404]).type.toBe<string | undefined>();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Differently from @tsconfig/node22, TSTyche sets "noUncheckedIndexedAccess": true by default. This is the only change detected.

Signed-off-by: mrazauskas <tom@mrazauskas.de>
@@ -1,3 +1,5 @@
/// <reference types="node" />
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This reference will be necessary for TypeScript 6, because of the following declaration:

import type {
BrotliCompress,
BrotliOptions,
Deflate,
Gzip,
ZlibOptions,
ZstdCompress,
ZstdOptions,
} from "node:zlib";

TypeScript 6 sets "types": []. This means @types/node will not be included in the program and TypeScript will complain that node:zlib is not found. The reference solves this. Can be verified by running npx tstyche --target next.

@willfarrell
Copy link
Member

Removing code, and everything still works. Beautiful.

@willfarrell willfarrell merged commit 5397e2a into middyjs:main Mar 11, 2026
15 checks passed
@mrazauskas mrazauskas deleted the update-type-test-setup branch March 11, 2026 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants