mirror of
https://github.com/jfmengels/elm-review.git
synced 2024-09-11 16:16:09 +03:00
21 lines
601 B
Elm
21 lines
601 B
Elm
module No_WithModuleVisitor_Without_WithModuleContext exposing (rule)
|
|
|
|
{-| We want to require calling `Rule.withModuleContext` after using `withModuleVisitor`.
|
|
-}
|
|
|
|
import Review.Rule as Rule exposing (Rule)
|
|
|
|
|
|
rule : Rule
|
|
rule =
|
|
Rule.newProjectRuleSchema "No_WithModuleVisitor_Without_WithModuleContext" ()
|
|
|> Rule.withModuleVisitor moduleVisitor
|
|
|> Rule.fromProjectRuleSchema
|
|
|
|
|
|
moduleVisitor : Rule.ModuleRuleSchema {} () -> Rule.ModuleRuleSchema { hasAtLeastOneVisitor : () } ()
|
|
moduleVisitor schema =
|
|
schema
|
|
|> Rule.withModuleDefinitionVisitor (\_ () -> ( [], () ))
|
|
|