Open lpil opened 3 months ago
The tracking of unused imports should probably be improved a bit too, because if I have e.g.
(and not using the option
module itself anywhere) then it should mark the full import as being unused, not just the type.
Otherwise, it would only remove type Option
, but leave gleam/option
in place, which will then be detected as unused.
So the rule should probably be: if the imported module isn't used directly, and if none of its unqualified imports (types, constructors) are used, then the module itself should also be marked as unused.
The unused code detection is not good and will be deleted and rewritten from scratch in future.
Discussed in https://github.com/gleam-lang/gleam/discussions/3241