feat: convert untyped json from any
to unknown
#112
Labels
enhancement
New feature or request
good first issue
Good for newcomers
help wanted
Extra attention is needed
Discussed in #110
Add a
strictJson
property to whenJson
fields are found without any/// [Type]
comment, they should be changed to unknown. Also need to discuss whether it should be enabled by default, breaking change but increases type safety (which kind is what this package is aiming to help with), or not.Implementation details:
Probably start with:
prisma-json-types-generator/src/handler/type-alias.ts
Line 23 in c7d2b4d
prisma-json-types-generator/src/handler/module.ts
Line 41 in c7d2b4d
These two IFs ignores the field type in case the model comment could not be found (a.k.a json field without type comment), probably there you'll also need to call the function to change the types, but this time, using
'unknown'
if thestrictJson
property is enabled.The text was updated successfully, but these errors were encountered: