QuiiBz / sherif

Opinionated, zero-config linter for JavaScript monorepos
MIT License
607 stars 10 forks source link

Customizable rule severity #73

Open DaniFoldi opened 5 days ago

DaniFoldi commented 5 days ago

Hi :wave:,

I saw your tweet and gave sherif a go on a few different repositories. One rule that constantly triggered errors was multiple-dependency-versions. Large monorepos may require different versions of typescript, for example. Some packages like expo have a very strong opinion about the version of typescript they are compatible with, while others are updated, naturally.

It would be nice if rules had a way to change their severity, so large monorepos wouldn't break in CI.

QuiiBz commented 5 days ago

Thanks for trying Sherif - indeed, this tool is opinionated and zero-config which is why we don't allow to customize rule levels. However, for cases such as the one you described, you can ignore a specific dependency from this rule: see the docs

sherif --ignore-dependency typescript

If you want, you can also completely disable the multiple-dependency-versions rule if it doesn't provide any value for you:

sherif -ignore-rule multiple-dependency-versions

Does that help?

DaniFoldi commented 2 days ago

Thanks for the quick response!

I saw the --ignore-rule option, and it's probably what we are going to have to use in order to adopt sherif. I understand that zero-config means that some settings cannot be changed, even if that means we lose out on warnings which devs may manually attend to.

I'm happy to close this issue if you feel adding a --warning/--error <rule> flag is out of scope.