jxxcarlson/elm-review-codeinstaller/2.0.3

NOTE: the latest version is 13.0.0

Install.FieldInTypeAlias

Add a field to specified type alias in a specified module. For example, if you put the code below in your ReviewConfig.elm file, running elm-review will add the field quot: String to the type alias FrontendModel in the Types module.

-- code for ReviewConfig.elm:
Install.FieldInTypeAlias.makeRule "Types" "FrontendModel" "quot: String"

Thus we will have

type alias FrontendModel =
    { counter : Int
    , clientId : String
    , quot : String
    }
makeRule : String -> String -> String -> Rule

Create a rule that adds a field to a type alias in a specified module. Example usage:

module Types exposing (FrontendModel)


type alias FrontendModel =
    { counter : Int
    , clientId : String
    }

After running the rule with the following code:

Install.FieldInTypeAlias.makeRule "Types" "FrontendModel" "quot: String"


    type alias FrontendModel =
        { counter : Int
        , clientId : String
        , quot : String
        }