Coder Social home page Coder Social logo

Comments (2)

sparksp avatar sparksp commented on June 16, 2024

I completely agree with some type being a better way of configuring this - I had started making plans toward this when #15 didn't work out. Unfortunately I have lost all my notes on that so I need to flesh them out again.

One hold up is that I want to decide how to handle module shadowing. AlwaysAlias will happily handle importing Extras (as below), but @jfmengels and I would prefer not to allow any shadowing, which means needing a way to prevent the same module name or alias from being used (as in the above example).

-- NeverAlias
import Browser
-- AlwaysAlias "Browser"
import Browser.Extra as Browser

I do not think that DontCare is in the spirit of this rule. A module should either never be aliased or always aliased consistently - if you don't care then don't configure it and let the rule try to figure it out for you. The dream is that the rule needs as little configuration as possible and is able to tell from your code what 'consistent' is for your project. Configuring specific modules would then be most useful if you wanted to change an import and force the auto-fixes across the whole project.

from elm-review-imports.

MartinSStewart avatar MartinSStewart commented on June 16, 2024

I do not think that DontCare is in the spirit of this rule.

At work we've been using a very similar to this though it does allow for a DontCare choice. I think this is valuable when introducing this sort of rule to a team because it means you can incrementally restrict what import aliases to use. If we had to decide on how all imports would get aliased from the start the rule probably wouldn't be used.

from elm-review-imports.

Related Issues (14)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.