The defaultValue field on PropItem is typed as any, but at runtime it is always either null or { value: ... }. This means TypeScript gives no warning when consumers access prop.defaultValue.value without a null check.
Suggested fix
// Before
export interface PropItem {
...
defaultValue: any;
...
}
// After
export interface PropItem {
...
defaultValue: { value: any } | null;
...
}
The
defaultValuefield onPropItemis typed asany, but at runtime it is always eithernullor{ value: ... }. This means TypeScript gives no warning when consumers accessprop.defaultValue.valuewithout a null check.Suggested fix