mirror of
https://github.com/jfmengels/elm-review.git
synced 2024-12-26 19:24:40 +03:00
33 lines
713 B
Elm
33 lines
713 B
Elm
module Types exposing (..)
|
|
|
|
import Ast.Expression exposing (..)
|
|
import Ast.Statement exposing (..)
|
|
|
|
|
|
type alias Error =
|
|
{ rule : String
|
|
, message : String
|
|
}
|
|
|
|
|
|
type Direction node
|
|
= Enter node
|
|
| Exit node
|
|
|
|
|
|
type alias LintImplementation nodeType context =
|
|
context -> Direction nodeType -> ( List Error, context )
|
|
|
|
|
|
type alias LintRule context =
|
|
{ statementFn : LintImplementation Statement context
|
|
, typeFn : LintImplementation Type context
|
|
, expressionFn : LintImplementation Expression context
|
|
, moduleEndFn : context -> ( List Error, context )
|
|
, initialContext : context
|
|
}
|
|
|
|
|
|
type alias Visitor context =
|
|
LintRule context -> context -> ( List Error, context )
|