Replace a function in a given module with a new implementation.
-- code for ReviewConfig.elm:
rule =
Install.Function.InsertFunction.init
"Frontend"
"view"
"""view model =
Html.text "This is a test\""""
|> Install.Function.InsertFunction.makeRuleRunning 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.init
"Foo.Bar"
"earnInterest"
"hoho model = { model | interest = 1.03 * model.interest }"
|> Install.Function.ReplaceFunction.makeRuleConfiguration 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
Create a rule that replaces a function in a given module with a new implementation.