chore: update type test setup#1588
Conversation
Signed-off-by: mrazauskas <tom@mrazauskas.de>
There was a problem hiding this comment.
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>(); |
There was a problem hiding this comment.
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" /> | |||
There was a problem hiding this comment.
This reference will be necessary for TypeScript 6, because of the following declaration:
middy/packages/http-content-encoding/index.d.ts
Lines 4 to 12 in bd37c89
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.
|
Removing code, and everything still works. Beautiful. |
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: