In TypeScript 4.8, for projects with strictNullChecks enabled, TypeScript will now correctly issue an error when an unconstrained type parameter is used in a position where null or undefined are not legal values. That will include any type that expects {}, object, or an object type with all-optional properties.
Clipanion now errors because the first parameter of WithArity is restricted with Type extends { length?: number; }
But in a lot of places it gets non restricted generics
Which results in these errors:
It's possible to bypass this for now with skipLibCheck but unfortunately this turns off type checking for all libraries.
e:
Looks like adding extends {} like so gets rid of the errors:
However I cannot setup the dev environment to create a PR
The latest version of
clipanion
(3.2.0-rc.11) doesn't work with the latest version ofTypeScript
(4.8).Reproduce
strictNullChecks
in your codeExpected Result
Compiles fine
Result
Clipanion type check errors.
It's due to stricter generic check introduced in 4.8: https://devblogs.microsoft.com/typescript/announcing-typescript-4-8/#unconstrained-generics-no-longer-assignable-to
Clipanion now errors because the first parameter of
But in a lot of places it gets non restricted generics

WithArity
is restricted withType extends { length?: number; }
Which results in these errors:
It's possible to bypass this for now with
skipLibCheck
but unfortunately this turns off type checking for all libraries.e: Looks like adding
However I cannot setup the dev environment to create a PR
extends {}
like so gets rid of the errors: