rule : Review.Rule.Rule
Forbids exporting everything from a module.
🔧 Running with --fix
will automatically fix all the reported errors.
Modules should have hidden implementation details with an explicit API so that the module is used in a proper and controlled way. The users of this module should not have to know about what is inside a module it is using, and they shouldn't need to access its internal details. Therefore, the API should be explicitly defined and ideally as small as possible.
config =
[ NoExposingEverything.rule
]
If you would like to expose everything in your tests, you can configure the rule in the following manner:
config =
[ NoExposingEverything.rule
|> Rule.ignoreErrorsForDirectories [ "tests/" ]
]
module A exposing (..)
module A exposing (B(..), C, d)
You can try this rule out by running the following command:
elm-review --template jfmengels/elm-review-common/example --rules NoExposingEverything