jxxcarlson/elm-review-codeinstaller/6.1.1

NOTE: the latest version is 13.0.0

Install.Import

Add import statements to a given module. For example, to add import Foo.Bar to the Frontend module, you can use the following configuration:

Install.Import.init "Frontend" "Foo.Bar"
    |> Install.Import.makeRule

To add the statement import Foo.Bar as FB exposing (a, b, c) to the Frontend module, do this:

Install.Import.init "Frontend" "Foo.Bar"
    |> Install.Import.withAlias "FB"
    |> Install.Import.withExposedValues [ "a", "b", "c" ]
    |> Install.Import.makeRule
init : String -> String -> Config

Initialize the configuration for the rule.

makeRule : Config -> Rule

Create a rule that adds an import for a given module in a given module. See above for examples.

withAlias : String -> Config -> Config

Add an alias to the imported module.

withExposedValues : List String -> Config -> Config

Add an exposing list to the imported module.