mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-11-28 06:05:31 +03:00
Point unexposed error to more narrow exposing line.
This commit is contained in:
parent
194470aaf4
commit
27c75fba9b
@ -8,7 +8,7 @@ module Pages.Review.NoContractViolations exposing (rule)
|
||||
|
||||
import Dict exposing (Dict)
|
||||
import Elm.Syntax.Declaration as Declaration exposing (Declaration)
|
||||
import Elm.Syntax.Exposing as Exposing
|
||||
import Elm.Syntax.Exposing as Exposing exposing (Exposing)
|
||||
import Elm.Syntax.Module as Module exposing (Module)
|
||||
import Elm.Syntax.Node as Node exposing (Node)
|
||||
import Elm.Syntax.TypeAnnotation as TypeAnnotation exposing (TypeAnnotation)
|
||||
@ -107,7 +107,7 @@ But it is not exposing: """
|
||||
++ (nonEmpty |> String.join ", ")
|
||||
]
|
||||
}
|
||||
(Node.range node)
|
||||
(Node.range (exposingListNode (Node.value node)))
|
||||
]
|
||||
, { moduleName = Node.value node |> Module.moduleName
|
||||
, isPageModule = isPageModule
|
||||
@ -122,16 +122,6 @@ But it is not exposing: """
|
||||
)
|
||||
|
||||
|
||||
exposedFunctionName : Node Exposing.TopLevelExpose -> Maybe String
|
||||
exposedFunctionName value =
|
||||
case Node.value value of
|
||||
Exposing.FunctionExpose functionName ->
|
||||
Just functionName
|
||||
|
||||
_ ->
|
||||
Nothing
|
||||
|
||||
|
||||
routeParamsMatchesNameOrError : Node a -> Node TypeAnnotation -> List String -> List (Error {})
|
||||
routeParamsMatchesNameOrError typeAliasNode annotation moduleName =
|
||||
case stringFields typeAliasNode annotation of
|
||||
@ -391,3 +381,16 @@ getExposedName exposedValue =
|
||||
|
||||
Exposing.TypeExpose exposedType ->
|
||||
Just exposedType.name
|
||||
|
||||
|
||||
exposingListNode : Module -> Node Exposing
|
||||
exposingListNode m =
|
||||
case m of
|
||||
Module.NormalModule x ->
|
||||
x.exposingList
|
||||
|
||||
Module.PortModule x ->
|
||||
x.exposingList
|
||||
|
||||
Module.EffectModule x ->
|
||||
x.exposingList
|
||||
|
@ -28,7 +28,7 @@ a = 1
|
||||
|
||||
But it is not exposing: Model"""
|
||||
]
|
||||
, under = "module Page.Blog.Slug_ exposing (Data, Msg, page)"
|
||||
, under = "exposing (Data, Msg, page)"
|
||||
}
|
||||
]
|
||||
, test "reports RouteParams mismatch" <|
|
||||
|
Loading…
Reference in New Issue
Block a user