-
Notifications
You must be signed in to change notification settings - Fork 4
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
Discussion: Allow multiple aliases? #25
Comments
Sure thing. The rule would currently ignore config =
[ NoInconsistentAliases.config
[ ( "Html.Attributes", "Attrs", [] )
, ( "Gwi.Html.Attributes", "Attrs", [] )
, ( "Html.Attributes.Extra", "Attrs", [ "Attrs_" ] )
]
|> NoInconsistentAliases.rule
]
(4) comes up for me when I use |
My expectations are:
|
Thanks for your answers - I think they align with how I saw this going. The rule currently avoids or ignores conflicts so I need to change the logic a bit to force aliases that are configured, that'll probably simplify things for me overall. |
I've made some good progress over at #31 however I realised as I was writing up the PR that the imports are checked in module alphabetical order and you might have some other ordering in mind (e.g., config). This will require some reorganising/rethinking of the final evaluation but shouldn't be impossible. |
At GlobalWebIndex we have our own custom
ConsistentImports
rule.It allows multiple aliases (we need this because of us having a convention
import List.Extra as List
, andHtml.Attributes.Extra.autocomplete
colliding withHtml.Attributes.autocomplete
, which makes us need to import the Extra asAttrs_
instead ofAttrs
in the modules that use theautocomplete
value) - described more in the Elm Slack discussion.We wanted to publish our rule, then found out this package exists, so we'd love to not divide the ecosystem.
Would you consider allowing multiple aliases for a given imported module in
elm-review-imports
?The text was updated successfully, but these errors were encountered: