Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ts2gd.json json schema #63

Open
ksjogo opened this issue Dec 19, 2021 · 1 comment
Open

ts2gd.json json schema #63

ksjogo opened this issue Dec 19, 2021 · 1 comment

Comments

@ksjogo
Copy link
Contributor

ksjogo commented Dec 19, 2021

The config file is/might be growing.
Having a JSON could help to reduce user errors.
We could define it in TS and use it and then generate the schema with https://github.com/YousefED/typescript-json-schema

@johnfn
Copy link
Owner

johnfn commented Dec 20, 2021

Yeah, I like this idea. But might that be overkill? E.g. we could just codegen ts2gd.json instead as ts2gd.ts and do something like this:

import Ts2GdConfig from "@ts2gd/config"

export const config: Ts2GdConfig = {
    destination: "path",
   source: "other path",
}

And then we could just define a simple Ts2GdConfig type in TS, and then the errors would be obvious in the user's IDE, without even checking ts2gd output.

I'm not sure why TS doesn't do something like this, come to think of it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants