Report parameters that are not used.
rule : Review.Rule.Rule
Report parameters that are not used.
🔧 Running with --fix
will automatically remove some of the reported errors.
config =
[ NoUnused.Parameters.rule
]
This rule looks within function arguments, let functions and lambdas to find any values that are unused. It will report any parameters that are not used.
We're only offering fixes for lambdas here because we believe unused parameters in functions are a code smell that should be refactored.
Value number
is not used:
add1 number =
1
The rule will also report parameters that are only used to be passed again to the containing recursive function:
last list unused =
case list of
[] ->
Nothing
[ a ] ->
Just a
_ :: rest ->
last rest unused
add1 number =
number + 1
You can try this rule out by running the following command:
elm-review --template jfmengels/elm-review-unused/example --rules NoUnused.Parameters