Skip to content

Commit 7bbd311

Browse files
committed
Don't add redundant | undefined to generated types
1 parent b9b2d41 commit 7bbd311

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

tasks/generate_types.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ const parsed = ts.parseJsonConfigFileContent(tsconfigJson.config, ts.sys, repoRo
6767

6868
const program = ts.createProgram(attributeFiles, {
6969
...parsed.options,
70+
// Prevent the checker from adding redundant `| undefined` to optional
71+
// properties when printing type nodes. The `?` modifier already implies
72+
// `undefined`, so the extra union member is just noise in the output.
73+
strictNullChecks: false,
7074
noEmit: true
7175
});
7276

0 commit comments

Comments
 (0)