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

Attempt to solve #53 #55

Closed jfmengels closed 2 years ago

jfmengels commented 2 years ago

Fixes #53

The issue was that the parameters from let/lambda functions and patterns from case declarations were not taken into account. When we exit a scope, we look at the variables introduced in the scope and the used variables inside the scope. Used variables that are found in the parameters/patterns don't get sent back to the parent scopes, while those that are not found are propagated that way.

In this case, the root problem was that since the parameters were not registered for these cases, we were not preventing used variables from being propagated back to the top as we should have.

The solution I'll go for is in https://github.com/jfmengels/elm-review-unused/pull/56