List ( String
, List String
}
rule : Config -> Review.Rule.Rule
Reports when a module in a namespace imports from a list of other namespaces.
config : List Rule
config =
[ ForbidSpecificImports.rule
[ ( "App.Data", [ "App.View" ] )
]
]
This fails because we've forbidden modules in App.Data
to import from App.View
.
module App.Data.Image exposing (..)
import App.View.Image
This passes because we've only forbidden modules in App.Data
to import from App.View
, not the
other way around.
module App.View.Image exposing (..)
import App.Data.Image
This rule is useful when you have set up a namespace structure where you want your module dependencies to form a directed acyclic graph.