I developed a ClI npm package with TS that consumes a configuration file from a given path.
> tool --config="./path/to/config"
The configuration file exports a single object which my tool imports.
Is there a way I can validate the imported object against a specific type definition?
The tool has exported type definitions so I could force users to create their configuration file using TS and just reference the successfully compiled JS file.
But, are there any other options? Would it be possible to have a JS file use a type from my CLI tool such that users would not have to install TSC wherever they wish to leverage my tool.
I came across Schemas, while writing this. Are they the best solution to my issue?