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

NoUnused.Variables reports an alias as unused, but it's used #89

Closed miniBill closed 1 year ago

miniBill commented 1 year ago

Describe the bug

import Generated.Types as Types exposing (Faction)
import Types exposing (Choice)

foo = Types.factionFromString "..."

factionFromString is coming from Generated.Types, so the alias is not redundant, and telling me to remove it is a false positive.

jfmengels commented 1 year ago

I know it's possible for elm-review to get this incorrect when it can't actually find some of the files. Do you know if you by any chance ran elm-review with the Generated.Types being absent from the source code? I believe that having it be present would solve the problem here.

If that's not the case, could you possibly create a SSCCE for this? Or at least some kind of reproducible case.

miniBill commented 1 year ago

Ah, yeah, I think that may have happened because elm-review ran while elm-codegen was creating that file, so it would have been missing. I can't actually reproduce it now, so a race condition seems likely :(

Sorry for the false alarm.