File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ module RedundantQualification exposing (suite )
2+
3+ import Elm
4+ import Elm.Annotation
5+ import Elm.Arg
6+ import Elm.Expect
7+ import Test exposing (Test , describe , test )
8+
9+
10+ suite : Test
11+ suite =
12+ describe " Avoid redundant imports"
13+ [ inTypeAliases
14+ , inAnnotation
15+ ]
16+
17+
18+ inTypeAliases : Test
19+ inTypeAliases =
20+ test " In type aliases" <|
21+ \ _ ->
22+ Elm . file [ " Foo" ]
23+ [ Elm . alias " Bar" ( Elm . Annotation . named [ " Foo" ] " Baz" ) ]
24+ |> Elm . Expect . fileContentAs
25+ """
26+ module Foo exposing (..)
27+
28+
29+ type alias Bar =
30+ Baz
31+ """
32+
33+
34+ inAnnotation : Test
35+ inAnnotation =
36+ test " In annotation" <|
37+ \ _ ->
38+ Elm . file [ " Foo" ]
39+ [ Elm . fn
40+ ( Elm . Arg . varWith " v" ( Elm . Annotation . named [ " Foo" ] " Baz" ))
41+ identity
42+ |> Elm . declaration " id"
43+ ]
44+ |> Elm . Expect . fileContentAs
45+ """
46+ module Foo exposing (..)
47+
48+
49+ id : Baz -> Baz
50+ id v =
51+ v
52+ """
You can’t perform that action at this time.
0 commit comments