lxierita/no-typealias-constructor-call/1.0.0

NOTE: the latest version is 1.0.1

Renamed to xie-lang/no-typealias-constructor-call. That is where the repository lives now. It has not been published as a package under the new name.

Versions published as lxierita/no-typealias-constructor-call still install under that name. 2 versions of 2 come from the new location (see their notes).

Rerouted (renamed, verified). The GitHub user or repository was renamed. The tag is still there, at the new name. The Lamdera package server serves a copy recovered from https://github.com/xie-lang/no-typealias-constructor-call.

What we checked: The repo moved to github.com/xie-lang/no-typealias-constructor-call. Rebuilt with git archive from commit 172be82ec1e9 of https://github.com/xie-lang/no-typealias-constructor-call (zip prefix lxierita-no-typealias-constructor-call-172be82/, America/Los_Angeles times): the zip is byte-identical to the one package.elm-lang.org recorded, SHA-1 b5c6ae09e1e980a9f54947f3ac839b6bf0a6b762.

The Lamdera compiler uses this copy and prints a one-line notice saying so. elm itself fails to download this version.

Details · package.elm-lang.org's zip: https://github.com/lxierita/no-typealias-constructor-call/zipball/1.0.0/

NoTypeAliasConstructorCall

rule : Rule

NoTypeAliasConstructorCall forces you to use Record Expression for any type aliases declared in the current module

Configuration

config : List Rule
config =
    [ NoTypeAliasConstructorCall.rule ]

Example

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
    }

Caution

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)