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

Validate rules #100

Open
fvictorio opened this issue Jan 4, 2019 · 0 comments
Open

Validate rules #100

fvictorio opened this issue Jan 4, 2019 · 0 comments
Labels
help wanted Team would love to have contributors working on these

Comments

@fvictorio
Copy link
Contributor

fvictorio commented Jan 4, 2019

As part of #99, we removed the validation that all configured rules exist, but this is very useful, specially when using plugins. The removal was needed because the rules validation was executed before the plugins were loaded, and there wasn't an easy way to move it after that.

This will need some thought and possibly some restructuring. There are two things that are needed here:

  1. Validate that every configured rule exists.
  2. Validate that the options for each rule are correct. This would only be done if the rule specifies a schema for its options.

2 is not needed right now, but it would be a nice-to-have.

With respect to 1, there are some alternatives on how to do it. The way ESLint does it is like this: when a rule doesn't exist, a stub rule is created that reports an error at the "Program" level (in Solhint's case it would be at the "SourceUnit" level, I think). This error indicates that that rule doesn't exist. This may be useful because the other rules are executed anyway. Also, consistency with ESLint is always a plus.

An alternative is to iterate over every rule and check that it's available, and fail early if it's not.

@pablofullana pablofullana added the help wanted Team would love to have contributors working on these label Jan 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Team would love to have contributors working on these
Projects
None yet
Development

No branches or pull requests

2 participants