elm-analyse
elm-analyse copied to clipboard
UnnecessaryParens false positive
Example
myButton : Bool -> Element msg
myButton newTab =
(if newTab then
newTabLink
else
link
)
[]
{ url = "https://google.de"
, label = text "Label"
}
will trigger Unnecessary
But removing the parens results in wrong code:
myButton : Bool -> Element msg
myButton newTab =
if newTab then
newTabLink
else
link
[]
{ url = "https://google.de"
, label = text "Label"
}
Another example:
(if flags.can PurchaseBundles then
(::) Store.UserSettings.fetchBundles
else
identity
)
[ Store.UserSettings.fetchCreditCard
, Store.UserSettings.fetchCountries
, Store.UserSettings.fetchReceipts 1
]
Simplest example: (hours-24)*60
is flagged, but (hours - 24)*60 is not