Skip to content

NoMissingTypeExpose should ignore local aliases #16

@edgerunner

Description

@edgerunner

NoMissingTypeExpose aims to make sure that a type is accessible if its value is accessible outside a module. However, it seems that it is giving a false positive result on a specific case.

That specific case is when a type alias is used inside a module to refer to an imported type with another name (usually to shorten it or to avoid clashes or confusion). NoMissingTypeExpose raises an error in that case, but I think it should not, because the type is actually available.

module ThisOne exposing (something)

import SomeModule exposing (OneLongTypeName)

type alias Short = OneLongTypeName
-- elm-review complains that Short isn't exposed, but that's unnecessary
-- because OneLongTypeName is already exposed by SomeModule and is accessible.

something : Int -> Short
something =

I think there could be a separate rule for preventing local aliasing like that if there's a need for that. The use case is different, and people may want one but not the other.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions