We can warn it for aliases no problems and a PR would be welcome.

However, for imports it is a bit more complicated because you can import
something multiple times with different parts. Furthermore, maybe a library
Bar is doing "import Foo" and you want to repeat "import Foo" for clarity.
I think we will have false positives.

On Thu, Feb 3, 2022 at 9:48 PM ku...@goyman.com <k...@goyman.com> wrote:

> If a module is aliased or imported multipled times by the module, it would
> be handy to have a warning.
>
> For example:
>
> defmodule Foo do
>
>   alias Ecto.Changeset
>   alias Ecto.Changeset
>
> end
>
> should result in a warning "duplicate import".
>
> This is low priority, but as there is one for unused import/alias it would
> help make the code cleaner.
>
> --
> You received this message because you are subscribed to the Google Groups
> "elixir-lang-core" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to elixir-lang-core+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elixir-lang-core/0d85ffa7-3997-4637-915e-523a744d155cn%40googlegroups.com
> <https://groups.google.com/d/msgid/elixir-lang-core/0d85ffa7-3997-4637-915e-523a744d155cn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elixir-lang-core+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4KGJt4mOirBJKzadw-V%3DwabyHt4A15ZTVp2sKUTT-%3DCFw%40mail.gmail.com.

Reply via email to