jfmengels/review-common/1.2.0

NOTE: the latest version is 1.2.3

NoMissingTypeExpose

rule : Rule

Forbids exposed functions that use or return a private type.

If a used type is not exposed then it is impossible to annotate functions or values that use them outside of the module.

import NoMissingTypeExpose


config : List Rule
config =
    [ NoMissingTypeExpose.rule
    ]

Fail

module Happiness exposing (happy, toString)


-- Type `Happiness` is private because it's not been exposed


type Happiness
    = Happy


-- Private type `Happiness` used by exposed function `toString`
toString : Happiness -> String
toString happiness =
    "Happy"


-- Private type `Happiness` used by exposed function `happy`
happy : Happiness
happy =
    Happy

## Success

module Happiness exposing (Happy, happy, toString)


type Happiness
    = Happy


toString : Happiness -> String
toString happiness =
    "Happy"


happy : Happiness
happy =
    Happy