jfmengels / elm-review-common / NoMissingTypeAnnotationInLetIn

rule : Review.Rule.Rule

Reports let in declarations that do not have a type annotation.

Type annotations help you understand what happens in the code, and it will help the compiler give better error messages.

config =
    [ NoMissingTypeAnnotationInLetIn.rule
    ]

This rule does not report top-level declarations without a type annotation inside a let in. For that, enable NoMissingTypeAnnotation.

Fail

a : number
a =
    let
        -- Missing annotation
        b =
            2
    in
    b

Success

-- Top-level annotation is not necessary, but good to have!
a : number
a =
    let
        b : number
        b =
            2
    in
    b

Try it out

You can try this rule out by running the following command:

elm-review --template jfmengels/elm-review-common/example --rules NoMissingTypeAnnotationInLetIn