Skip to content

Add elm-review rule NoMissingTypeAnnotation

Overview

Add elm-review rule NoMissingTypeAnnotation

This rule forbids top-level declarations that do not have a type annotation, like a function in a module

-- defaultString: String
defaultString = "MyDefaultValue"

An example error follows

-- ELM-REVIEW ERROR ----------------------------------- src/ServerDeploy.elm:4:1

NoMissingTypeAnnotation: Missing type annotation for `cloudInitUserDataTemplate`

4| cloudInitUserDataTemplate =
    ^^^^^^^^^^^^^^^^^^^^^^^^^
5|     {-

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

Discussion

We already have typed all module-level declarations, and I think its valuable to keep it that way.

Merge request reports