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

Throw error for invalid rule config #37

Merged
merged 10 commits into from
May 17, 2019

Conversation

KamiKillertO
Copy link
Collaborator

@KamiKillertO KamiKillertO commented May 17, 2019

The current behaviour when a rule's config is not valid is to report an Issue (code E048), this issue will them be listed among lint errors. That behaviour is not good as invalid config are different from lint errors and be lost in the middle.
Wrong configurations should be blocking an invalid configuration should stop the lint process and trigger an error for the user. This is exactly what this PR intent to do.
The PR change the way rules config are handled internally, now an error thrown when an invalid config is found. Same behaviour for inline_config

Those validators throw errors for invalid rules config
The `validateConfig` is used to trigger errors when rule's config is not valid. Previously issues were reported for invalid config, which is bad for UX as those issues were lost in the middle of real lint issues. By throwing an error we can stop the linter and tell the user that something is not good.
Call linthtml on an empty string to trigger a check for rules config. If rule config check fail the cli is stopped and the config error is printed.
This is a hack until I find a better solution
@KamiKillertO KamiKillertO merged commit a23cf25 into develop May 17, 2019
@delete-merged-branch delete-merged-branch bot deleted the feat/throw_error_for_invalid_rule_config branch May 17, 2019 13:57
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

Successfully merging this pull request may close these issues.

1 participant