mirror of
https://github.com/jfmengels/elm-review.git
synced 2024-11-23 23:05:35 +03:00
NoUnusedExports: Don't report used functions or values
This commit is contained in:
parent
56e766ad62
commit
c21fbff07e
@ -81,10 +81,9 @@ a = 1
|
||||
}
|
||||
|> Review.Test.atExactly { start = { row = 2, column = 20 }, end = { row = 2, column = 21 } }
|
||||
]
|
||||
, Test.skip <|
|
||||
test "should not report an exposed function when it is used in other modules (qualified import)" <|
|
||||
\() ->
|
||||
[ """
|
||||
, test "should not report an exposed function when it is used in other modules (qualified import)" <|
|
||||
\() ->
|
||||
[ """
|
||||
module A exposing (a)
|
||||
a = 1
|
||||
""", """
|
||||
@ -92,12 +91,11 @@ module B exposing (main)
|
||||
import A
|
||||
main = A.a
|
||||
""" ]
|
||||
|> Review.Test.runOnModulesWithProjectData application rule
|
||||
|> Review.Test.expectNoErrors
|
||||
, Test.skip <|
|
||||
test "should not report an exposed function when it is used in other modules (using an alias)" <|
|
||||
\() ->
|
||||
[ """
|
||||
|> Review.Test.runOnModulesWithProjectData application rule
|
||||
|> Review.Test.expectNoErrors
|
||||
, test "should not report an exposed function when it is used in other modules (using an alias)" <|
|
||||
\() ->
|
||||
[ """
|
||||
module A exposing (a)
|
||||
a = 1
|
||||
""", """
|
||||
@ -105,12 +103,11 @@ module B exposing (main)
|
||||
import A as SomeA
|
||||
main = SomeA.a
|
||||
""" ]
|
||||
|> Review.Test.runOnModulesWithProjectData application rule
|
||||
|> Review.Test.expectNoErrors
|
||||
, Test.skip <|
|
||||
test "should not report an exposed function when it is used in other modules (using `exposing` to import)" <|
|
||||
\() ->
|
||||
[ """
|
||||
|> Review.Test.runOnModulesWithProjectData application rule
|
||||
|> Review.Test.expectNoErrors
|
||||
, test "should not report an exposed function when it is used in other modules (using `exposing` to import)" <|
|
||||
\() ->
|
||||
[ """
|
||||
module A exposing (a)
|
||||
a = 1
|
||||
""", """
|
||||
@ -118,12 +115,11 @@ module B exposing (main)
|
||||
import A exposing (a)
|
||||
main = a
|
||||
""" ]
|
||||
|> Review.Test.runOnModulesWithProjectData application rule
|
||||
|> Review.Test.expectNoErrors
|
||||
, Test.skip <|
|
||||
test "should not report an exposed function when it is used in other modules (using `exposing(..)` to import)" <|
|
||||
\() ->
|
||||
[ """
|
||||
|> Review.Test.runOnModulesWithProjectData application rule
|
||||
|> Review.Test.expectNoErrors
|
||||
, test "should not report an exposed function when it is used in other modules (using `exposing(..)` to import)" <|
|
||||
\() ->
|
||||
[ """
|
||||
module A exposing (a)
|
||||
a = 1
|
||||
""", """
|
||||
@ -131,8 +127,8 @@ module B exposing (main)
|
||||
import A exposing (..)
|
||||
main = a
|
||||
""" ]
|
||||
|> Review.Test.runOnModulesWithProjectData application rule
|
||||
|> Review.Test.expectNoErrors
|
||||
|> Review.Test.runOnModulesWithProjectData application rule
|
||||
|> Review.Test.expectNoErrors
|
||||
, test "should report an exposed function when it is not used in other modules, even if it is used in the module" <|
|
||||
\() ->
|
||||
"""
|
||||
@ -149,15 +145,14 @@ main = exposed
|
||||
}
|
||||
|> Review.Test.atExactly { start = { row = 2, column = 20 }, end = { row = 2, column = 27 } }
|
||||
]
|
||||
, Test.skip <|
|
||||
test "should not report anything for modules that expose everything`" <|
|
||||
\() ->
|
||||
"""
|
||||
, test "should not report anything for modules that expose everything`" <|
|
||||
\() ->
|
||||
"""
|
||||
module A exposing (..)
|
||||
a = 1
|
||||
"""
|
||||
|> Review.Test.runWithProjectData package_ rule
|
||||
|> Review.Test.expectNoErrors
|
||||
|> Review.Test.runWithProjectData package_ rule
|
||||
|> Review.Test.expectNoErrors
|
||||
, test "should not report the `main` function for an application even if it is unused" <|
|
||||
\() ->
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user