jfmengels/elm-review-unused

New rule: No unused tuple values

Open

#16 opened on Sep 25, 2020

View on GitHub
 (2 comments) (0 reactions) (0 assignees)Elm (14 forks)github user discovery
hacktoberfesthelp wanted

Repository metrics

Stars
 (26 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

What the rule should do:

Report unused values in tuples

What problems does it solve:

It will help remove and uncover more unused code.

Example of things the rule would report:

The second value in the tuple is never used, so we might as well remove it.

let
    a : ( Int, Int )
    a = ( 1, 2 )
    --       ^ reported here

    first = Tuple.first a

    ( otherFirst, _ ) = a
in
first + otherFirst

Same for 3-tuples. Also type aliases to such tuples should also be checked.

Example of things the rule would not report:

let
    a : ( Int, Int )
    a = ( 1, 2 )

    first = Tuple.first a

    ( _, second ) = a
in
first + second

I am looking for:

  • A good name. NoUnused.TupleValues?
  • Someone to implement it (I can provide help and guidance)

Contributor guide