QuiiBz / sherif

Opinionated, zero-config linter for JavaScript monorepos
MIT License
915 stars 14 forks source link

feat: add `--fix` option to autofix issues #6

Closed QuiiBz closed 1 year ago

QuiiBz commented 1 year ago

As suggested by @juliusmarminge: https://twitter.com/jullerino/status/1703794047104479562

We should add support for a new --fix option, that will try to fix issues as much as possible. We can add a fn fix(&self) -> bool to the Issue trait, that will be executed on each issue. Returning true means the fix was successful, false that it wasn't: https://github.com/QuiiBz/sherif/blob/7b5a2075ace5d6c6ef88599612826fe4c62d668d/src/rules/mod.rs#L45

QuiiBz commented 1 year ago

Re-opening, only a single rule is auto-fixable right now.

QuiiBz commented 1 year ago

Released in https://github.com/QuiiBz/sherif/releases/tag/v0.6.0