Helps with preventing redundant usage of concatenation. Expressions like [ a ] ++ b can be rewritten as a :: b, and expressions like [ a ] ++ [ b ] could
be simply [ a, b ].
module ReviewConfig exposing (config)
import NoRedundantConcat
import Review.Rule exposing (Rule)
config : List Rule
config =
[ NoRedundantConcat.rule
]- Concatenating list literals with
++([ foo ] ++ [ bar ] -> [ foo, bar ]) - Concatenating a list literal with some other value (
[ foo ] ++ bar -> foo :: bar) - Using
List.concatwith list literals (List.concat [ [ foo ], [ bar ] ] -> [ foo, bar ]) - Using
++withStringliterals ("foo" ++ "bar" -> "foobar")
- Using
List.appendwith list literals - Using
String.appendwith string literals - Using
String.concatwith string literals - Using
String.join ""overString.concat
These all follow a common pattern of making the concatenation of literals more complex than it has to be.