- enable it in the TS config.
"compilerOptions": {
"resolveJsonModule": true,
}
- Pull the json prop into type def:
type sampleProp = typeof jsonDataProp;
type UcpConfig = Partial<GeneratedUcpConfig>;
Tells TS that GeneratedUcpConfig might have props on it, or might be {}
.
https://dev.to/nickytonline/strongly-typed-json-in-typescript-5gb2