Skip to content

Have NoImportingEverything provide a fix #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
jfmengels opened this issue Sep 25, 2020 · 1 comment · May be fixed by #5
Open

Have NoImportingEverything provide a fix #3

jfmengels opened this issue Sep 25, 2020 · 1 comment · May be fixed by #5
Labels
enhancement New feature or request

Comments

@jfmengels
Copy link
Owner

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).

@jfmengels jfmengels added enhancement New feature or request hacktoberfest help wanted Extra attention is needed labels Sep 25, 2020
@jfmengels jfmengels removed hacktoberfest help wanted Extra attention is needed labels Dec 27, 2020
@jfmengels
Copy link
Owner Author

jfmengels commented Dec 27, 2020

I'm currently working on this one :)

@sparksp sparksp linked a pull request Jan 22, 2021 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant