rule : Review.Rule.Rule
NoTypeAliasConstructorCall
forces you to use Record Expression for any type aliases declared in the current module
config : List Rule
config =
[ NoTypeAliasConstructorCall.rule ]
The following code will report an error
type alias Foo =
{ foo : String
, bar : Bool
, baz : Float
}
init : Foo
init =
Foo "hello" True 0.2
To get rid of the error, do this:
type alias Foo =
{ foo : String
, bar : Bool
, baz : Float
}
init : Foo
init =
{ foo = "hello"
, bar = True
, baz = 0.2
}
This rule does not apply to map
functions in Json.Decode
, so the following code will NOT report an error
type alias Point =
{ x : Float, y : Float }
point : Decoder Point
point =
map2 Point
(field "x" float)
(field "y" float)