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

Add rulesets #86

Merged
merged 9 commits into from Jan 4, 2019
Merged

Add rulesets #86

merged 9 commits into from Jan 4, 2019

Conversation

mariano-aguero
Copy link
Contributor

Closes #73

  • Allow to extend rules to solhint through the config file (recommend, default, all)
  • See custom config to use (you can create yours) https://www.npmjs.com/package/solhint-config-align-base
  • Add ajv schema validator, schema and metadata to rules, and some tests
  • Now you can disable a rule with the 'off' flag (eslint style)
  • Enjoy it!

Example of .solhintrc.json or .solhint.json:
First install package: npm i solhint-config-align-base
{ "extends": [ "align-base" ], "rules": { "avoid-throw": "off", "indent": ["error", 2] } }
Or you can extend a core rule like all, recommended or default

@coveralls
Copy link

coveralls commented Dec 14, 2018

Coverage Status

Coverage decreased (-66.1%) to 33.076% when pulling 081a910 on feature/add-rulesets into 22b5ca5 on 2.0.

@german-bortoli
Copy link

Thanks

So excited to view this PR into the project.

Regards.

@fvictorio
Copy link
Contributor

We'll need to add some documentation on how to create a ruleset.

configExtends = [config.extends]
}

return configExtends.reduceRight((previousValue, parentPath) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason to reduce from the right? This means that the rules that appear first in the array will override the ones that appear next. I think it makes more sense to do it the other way around, and that's the way eslint does it if I'm not wrong.

@fvictorio
Copy link
Contributor

The rules should have higher priority than the rulesets. Right now, it seems that if a rule is set by a ruleset, then you cannot override it.

@fvictorio fvictorio merged commit e935ba4 into 2.0 Jan 4, 2019
@fvictorio fvictorio deleted the feature/add-rulesets branch January 4, 2019 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants