mirror of
https://github.com/jfmengels/elm-review.git
synced 2024-09-11 08:05:46 +03:00
27 lines
891 B
Elm
27 lines
891 B
Elm
module NoElmJsonVisitorForModuleVisitorInProjectRule exposing (rule)
|
|
|
|
{-| We want to forbid module visitors from using `withElmJsonModuleVisitor`.
|
|
-}
|
|
|
|
import Review.Rule as Rule exposing (Rule)
|
|
|
|
|
|
rule : Rule
|
|
rule =
|
|
Rule.newProjectRuleSchema "NoElmJsonVisitorForModuleVisitorInProjectRule" ()
|
|
|> Rule.withModuleVisitor moduleVisitor
|
|
|> Rule.withModuleContext
|
|
{ fromProjectToModule = \_ _ () -> ()
|
|
, fromModuleToProject = \_ _ () -> ()
|
|
, foldProjectContexts = \_ () -> ()
|
|
}
|
|
|> Rule.withFinalProjectEvaluation (\_ -> [])
|
|
|> Rule.fromProjectRuleSchema
|
|
|
|
|
|
moduleVisitor : Rule.ModuleRuleSchema {} () -> Rule.ModuleRuleSchema { hasAtLeastOneVisitor : () } ()
|
|
moduleVisitor schema =
|
|
schema
|
|
|> Rule.withElmJsonModuleVisitor (\_ () -> ())
|
|
|> Rule.withModuleDefinitionVisitor (\_ () -> ( [], () ))
|