miniBill/elm-review-no-internal-imports

Prevent boundary-crossing imports when vendoring packages


Keywords
elm, elm-review
License
BSD-3-Clause
Install
elm-package install miniBill/elm-review-no-internal-imports 1.0.0

Documentation

elm-review-no-internal-imports

Provides elm-review rules to enforce boundaries in projects that vendor code.

Provided rules

Configuration

module ReviewConfig exposing (config)

import NoInternalImports
import Review.Rule exposing (Rule)

config : List Rule
config =
    [ NoInternalImports.rule []
    ]

You must pass as parameter all the source-directories that are outside your project's root (that is, the ones that start with .. or /).

Package boundaries are automatically detected by searching for elm.json files one level up from the directories ending with /src.

The packages don't need to be published, so you can separate a larger app into "packages" by simply creating the necessary elm.json files. The rule extracts the exposed modules from there and prevents importing of anything else.

Try it out

You can try the example configuration above out by running the following command:

elm-review --template miniBill/elm-review-no-internal-imports/example