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

NoUnused.Variables: Report unused imports of types with constructors #3

Closed
jfmengels opened this issue Sep 30, 2019 · 2 comments
Closed
Labels
hacktoberfest help wanted Extra attention is needed

Comments

@jfmengels
Copy link
Owner

jfmengels commented Sep 30, 2019

We already report unused imports, but we give up when are also import the type's constructors.

We did this back in v1.0.0 where we had no knowledge of what constructors were imported. Since elm-review v2.0.0, we can collect this information and we already do in other rules from this package.

I'd like to:

-- Report
import A exposing (B(..), a)
                   ^^^^^
a : B
a = A.BConstructor
-- Autofix to
import A exposing (B, a)
-- Report
import A exposing (B(..), a)
                   ^^^^^
-- Autofix to
import A exposing (a)
-- Report
import A exposing (B(..))
                   ^^^^^
a : A.C -- Import A is still being used
a = ...
-- Autofix to
import A
-- Report
import A exposing (B(..))
                   ^^^^^
-- Autofix by deleting import
@jfmengels jfmengels changed the title New rule: NoUnused.ImportedConstructors NoUnused.Variables: Report unused imports of types with constructors Jun 16, 2020
@jfmengels
Copy link
Owner Author

jfmengels commented Jun 16, 2020

I changed the issue to mention we want this behavior in NoUnused.Variables.

@jfmengels jfmengels transferred this issue from jfmengels/review-unused Aug 14, 2020
@jfmengels jfmengels added hacktoberfest help wanted Extra attention is needed labels Sep 27, 2020
@jfmengels
Copy link
Owner Author

jfmengels commented Dec 12, 2020

Fixed on master 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hacktoberfest help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant