jfmengels / elm-review-unused

Provides elm-review rules to detect unused elements in your Elm project
https://package.elm-lang.org/packages/jfmengels/elm-review-unused/latest/
BSD 3-Clause "New" or "Revised" License
23 stars 12 forks source link

Autofix removing unused constructors #36

Closed jfmengels closed 3 years ago

jfmengels commented 3 years ago

Propose a fix for removing unused constructors in the NoUnused.CustomTypeConstructors rule.

This is only done when the constructor is only used or referenced in the file it was defined in, because elm-review doesn't allow multi-file fixes.

What this autofix does:

Screenshot from 2021-04-10 12-09-48

Testing

I would like people to test this one out, since there's a higher chance than usual that I messed things up and that it leads to a compiler error. I'd love it if people could try this one out, and see whether it causes any code to stop compiling or behaving differently.

npx elm-review --template jfmengels/elm-review-unused/preview#remove-unused-constructor --rules NoUnused.CustomTypeConstructors --fix