stil4m/elm-analyse

Suggestion: Don't warn about unused import aliases in some edge cases

Closed this issue · 1 comments

Hi! I'm loving elm-analyse so far :)

In one of my files I have these imports:

import Svg as UntypedSvg exposing (Svg)
import TypedSvg as Svg
import TypedSvg.Types as Svg

I don't use the UntypedSvg alias, but if I were to remove it, the Svg import would clash with my aliased import TypedSvg as Svg.

Maybe my work-around for imports is questionable. What do you think is the best way to resolve this? Should the exist an option for allowing what I'm doing, or should everyone never alias to a name that's already imported?

I have since revised what I think of this rule. It should warn that something is unused, when something is unused, period. Even if one needed to add an import so that something else doesn't break.

And for anyone wondering, there's a type alias to Svg in TypedSvg.Core ;)