jxxcarlson/elm-review-codeinstaller/12.0.1

NOTE: the latest version is 13.0.0

Install.Function.ReplaceFunction

Replace a function in a given module with a new implementation.

-- code for ReviewConfig.elm:
rule =
    Install.Function.InsertFunction.config
        "Frontend"
        "view"
        """view model =
        Html.text "This is a test\""""
        |> Install.Function.InsertFunction.makeRule

Running this rule will replace the function view in the module Frontend with the provided implementation.

The form of the rule is the same for nested modules:

rule =
    Install.Function.ReplaceFunction.config
        "Foo.Bar"
        "earnInterest"
        "hoho model = { model | interest = 1.03 * model.interest }"
        |> Install.Function.ReplaceFunction.makeRule
makeRule : Config -> Rule

Create a rule that replaces a function in a given module with a new implementation.

config : String -> String -> String -> Config

Initialize the configuration for the rule.

type Config

Configuration for makeRule: replace a function in a specified module with a new implementation.

Custom error message to be displayed when running elm-review --fix or elm-review --fix-all