Skip to content
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

Have NoExposingEverything provide a fix #2

Closed
jfmengels opened this issue Sep 25, 2020 · 0 comments · Fixed by #4
Closed

Have NoExposingEverything provide a fix #2

jfmengels opened this issue Sep 25, 2020 · 0 comments · Fixed by #4
Labels
enhancement New feature or request hacktoberfest help wanted Extra attention is needed

Comments

@jfmengels
Copy link
Owner

jfmengels commented Sep 25, 2020

The following module definition would be reported

module A exposing (..)

type A = B | C
type alias D = {}
a = 1

We could have the rule provide an automatic fix that would replace (..), like here:

module A exposing (A(..), D, a)

Ideally, the formatting would already look like something elm-format would produce, meaning types first in alphabetical order, then functions/values in alphabetical order. That would help the user see quite easily what is happening. I don't think it is useful to try and format in accordance to the @docs, since elm-format will re-format anyway.

Proposed solution

We would need to add a declarationListVisitor that goes through all declarations and registers them.

Then, when we create the error, which we now need to do in a final module evaluation, we'd provide the fix.

@jfmengels jfmengels added enhancement New feature or request help wanted Extra attention is needed hacktoberfest labels Sep 25, 2020
jfmengels pushed a commit that referenced this issue Nov 29, 2020
Adds all declarations as the exposing list, in the order they appear. `elm-format` will reorganise them based on @docs or alphabetically.

Fixes #2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hacktoberfest help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant