lue-bird/elm-review-record-alias-constructor/1.0.2

NOTE: the latest version is 1.1.3

NoRecordAliasConstructor

rule : Rule

🔧NoRecordAliasConstructor forbids using the automatically generated record type alias constructor.

Examples

type alias User =
    { name : String, age : Int }


User "Balsa" 42

will be marked as error and automatically fixed:

{ name = "Balsa", age = 42 }

The same goes for cases where no arguments are applied:

map2 User
    (field "name" string)
    (field "age" int)

fixed

map2 (\name age -> { name = name, age = age })
    (field "name" string)
    (field "age" int)

See the readme for why this is useful.

Configuration

config : List Rule
config =
    [ NoRecordAliasConstructor.rule
    ]