rule : Review.Rule.Rule
Reports type aliases to single-value primitive types, like type alias UserId = String
. Does not report errors for
type aliases of Record, List, Dict, Maybe, or Result types (i.e. compound primitives).
config =
[ NoPrimitiveTypeAlias.rule
]
type alias UserId =
String
type alias User =
{ first : String, last : String }
This rule is useful when you want to make sure you can trust types to represent Custom Types that will give you helpful compiler feedback, as described in the Rationale section of the README. This rule is not useful when you have low-level workarounds where you are choosing to use simple primitive type aliases, or if you disagree with this advice choose to use that style as your personal preference.
You can try this rule out by running the following command:
elm-review --template dillonkearns/elm-review-no-primitive-type-alias/example --rules NoPrimitiveTypeAlias