jfmengels / elm-review-unused / NoUnused.Patterns

Report useless patterns and pattern values that are not used.

rule : Review.Rule.Rule

Report useless patterns and pattern values that are not used.

🔧 Running with --fix will automatically remove all the reported errors.

config =
    [ NoUnused.Patterns.rule
    ]

This rule looks within let..in blocks and case branches to find any patterns that are unused. It will report any useless patterns as well as any pattern values that are not used.

Fail

Value something is not used:

case maybe of
    Just something ->
        True

    Nothing ->
        False

Success

case maybe of
    Just _ ->
        True

    Nothing ->
        False

Try it out

You can try this rule out by running the following command:

elm-review --template jfmengels/elm-review-unused/example --rules NoUnused.Patterns