mirror of
https://github.com/jfmengels/elm-review.git
synced 2024-11-23 23:05:35 +03:00
Removed unused things and improved some patterns, hinted by elm-analyse
This commit is contained in:
parent
bce10c8488
commit
d1f87f4a5c
1
elm.json
1
elm.json
@ -18,7 +18,6 @@
|
||||
"elm-version": "0.19.0 <= v < 0.20.0",
|
||||
"dependencies": {
|
||||
"elm/core": "1.0.2 <= v < 2.0.0",
|
||||
"elm/regex": "1.0.0 <= v < 2.0.0",
|
||||
"elm-community/list-extra": "8.2.0 <= v < 9.0.0",
|
||||
"elm-explorations/test": "1.2.2 <= v < 2.0.0",
|
||||
"mgold/elm-nonempty-list": "4.0.1 <= v < 5.0.0",
|
||||
|
@ -1015,8 +1015,8 @@ expressionChildren node =
|
||||
++ [ expression ]
|
||||
|
||||
CaseExpression { expression, cases } ->
|
||||
[ expression ]
|
||||
++ List.map (\( pattern, caseExpression ) -> caseExpression) cases
|
||||
expression
|
||||
:: List.map (\( pattern, caseExpression ) -> caseExpression) cases
|
||||
|
||||
LambdaExpression { args, expression } ->
|
||||
[ expression ]
|
||||
|
@ -89,8 +89,6 @@ import Elm.Syntax.Expression exposing (Expression(..))
|
||||
import Elm.Syntax.Node as Node exposing (Node)
|
||||
import Elm.Syntax.Pattern exposing (Pattern(..))
|
||||
import Lint.Rule as Rule exposing (Error, Rule)
|
||||
import List.Extra exposing (findIndex)
|
||||
import Regex
|
||||
|
||||
|
||||
{-| Configures whether the default pattern should appear first or last.
|
||||
|
@ -48,14 +48,11 @@ if it is not used anywhere in the project.
|
||||
import Dict exposing (Dict)
|
||||
import Elm.Syntax.Declaration exposing (Declaration(..))
|
||||
import Elm.Syntax.Exposing exposing (Exposing(..), TopLevelExpose(..))
|
||||
import Elm.Syntax.Expression exposing (Expression(..), Function, FunctionImplementation, LetDeclaration(..))
|
||||
import Elm.Syntax.Import exposing (Import)
|
||||
import Elm.Syntax.Expression exposing (Expression(..))
|
||||
import Elm.Syntax.Module as Module exposing (Module(..))
|
||||
import Elm.Syntax.Node as Node exposing (Node)
|
||||
import Elm.Syntax.Range exposing (Range)
|
||||
import Elm.Syntax.TypeAnnotation exposing (TypeAnnotation(..))
|
||||
import Lint.Rule as Rule exposing (Direction, Error, Rule)
|
||||
import List.Nonempty as Nonempty exposing (Nonempty)
|
||||
import Set exposing (Set)
|
||||
|
||||
|
||||
@ -194,17 +191,6 @@ finalEvaluation context =
|
||||
|
||||
else
|
||||
context.declaredTypesWithConstructors
|
||||
|> Dict.filter (\name node -> not <| Set.member name context.usedFunctionOrValues)
|
||||
|> Dict.filter (\name _ -> not <| Set.member name context.usedFunctionOrValues)
|
||||
|> Dict.toList
|
||||
|> List.map (\( _, node ) -> error node)
|
||||
|
||||
|
||||
|
||||
-- if context.exposesEverything then
|
||||
-- []
|
||||
--
|
||||
-- else
|
||||
-- context.scopes
|
||||
-- |> Nonempty.head
|
||||
-- |> makeReport
|
||||
-- |> Tuple.first
|
||||
|
@ -59,7 +59,6 @@ import Elm.Syntax.Range exposing (Range)
|
||||
import Expect exposing (Expectation)
|
||||
import Lint exposing (Severity(..), lintSource)
|
||||
import Lint.Rule as Rule exposing (Error, Rule)
|
||||
import List.Extra
|
||||
|
||||
|
||||
{-| The result of running a rule on a `String` containing source code.
|
||||
|
Loading…
Reference in New Issue
Block a user