Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False negative on Json.Decode when Json.Decode.Extra import is also present #97

Open
Janiczek opened this issue Aug 15, 2022 · 0 comments
Labels
bug Something isn't working NoInconsistentAliases Relates to the NoInconsistentAliases rule

Comments

@Janiczek
Copy link

This is on:

  • jfmengels/elm-review 2.8.1
  • sparksp/elm-review-imports 1.0.1

The files below result in a false negative: the import Json.Decode as Json is not picked upon (should warn and offer a fix to rename the alias to as Decode):

Screenshot 2022-08-15 at 10 07 24

Note that if the import of Json.Decode.Extra in Main.elm is removed, the false negative disappears and the rule suddenly offers to rename the Json.Decode alias!


Review config:

module ReviewConfig exposing (config)

import NoInconsistentAliases
import Review.Rule exposing (Rule)

config : List Rule
config =
    [ NoInconsistentAliases.config
        [ ( "Json.Decode", "Decode" )
        , ( "Json.Decode.Extra", "Decode" )
        ]
        |> NoInconsistentAliases.noMissingAliases
        |> NoInconsistentAliases.rule
    ]

Main.elm:

module Main exposing (x)

import Json.Decode as Json
import Json.Decode.Extra as Json

x = 1
@Janiczek Janiczek changed the title False negative on Json.Decode when Json.Decode.Extra alias rule is also present False negative on Json.Decode when Json.Decode.Extra import is also present Aug 15, 2022
@sparksp sparksp added NoInconsistentAliases Relates to the NoInconsistentAliases rule bug Something isn't working labels Feb 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working NoInconsistentAliases Relates to the NoInconsistentAliases rule
Projects
None yet
Development

No branches or pull requests

2 participants