Skip to content

Have NoImportingEverything provide a fix #3

@jfmengels

Description

@jfmengels

The following import would be reported

import Html exposing (..)
--                    ^^

view : Html msg
view = div [] [ span [] [ text "hello" ] ]

We could have the rule provide an automatic fix that would replace (..) by the list of all implicit functions and types for that module.

import Html exposing (Html, div, span, text)

view : Html msg
view = div [] [ span [] [ text "hello" ] ]

Ideally, the formatting would already look like something elm-format would produce, meaning types first in alphabetical order, then functions/values in alphabetical order.

Detecting what module the function/type comes from can be done using the module name lookup table.

The trickiest part here would likely be detecting from which custom type a constructor comes from, so we need when to do exposing (A(..)) instead of exposing (A).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions