mirror of
https://github.com/jfmengels/elm-review.git
synced 2024-12-02 22:31:35 +03:00
33 lines
704 B
Elm
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 )
|