elm-review/rules/NoExposingEverything.elm
2017-01-08 11:44:37 +01:00

33 lines
704 B
Elm

module NoExposingEverything exposing (rule)
import Lint exposing (LintRule, Error, doNothing)
import Ast.Statement exposing (..)
type alias Context =
{}
rule : LintRule Context
rule =
{ statementFn = statementFn
, typeFn = doNothing
, expressionFn = doNothing
, context = Context
}
statementFn : Context -> Statement -> ( List Error, Context )
statementFn ctx node =
case node of
ModuleDeclaration names AllExport ->
case names of
[ name ] ->
( [ "Do not expose everything from module " ++ name ++ " using (..)" ], ctx )
_ ->
( [], ctx )
_ ->
( [], ctx )