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

thorough config validation #87

Open
boneskull opened this issue Feb 20, 2020 · 0 comments
Open

thorough config validation #87

boneskull opened this issue Feb 20, 2020 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed package-common Involving common package

Comments

@boneskull
Copy link
Contributor

There's some rudimentary validation of the config format. There's static validation via types, and validation of root properties, but there's no validation of the contents of those root properties. This means you could put a config for a non-existent Rule in the rules property, for instance (the configs of existing Rules have their own validation, which it may make sense to hook into--OTOH, it'd be nice to not just throw up our hands if a Rule config is invalid, but the user is running diff, which doesn't use them).

The inspector already consumes ajv to allow rules to define their own option schemas, so maybe that'll work.

It'd be nice to see some runtime validation system that is generated from TS types, so we wouldn't need to duplicate effort here. That said, there's a lot of things you can express in ajv or joi (or whatever) which typescript can't express, so maybe we're all doomed

@boneskull boneskull added enhancement New feature or request help wanted Extra attention is needed package-common Involving common package labels Feb 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed package-common Involving common package
Projects
None yet
Development

No branches or pull requests

1 participant