Comments (2)
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 Extra
s (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.
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)
- Ensure Consistent Aliases
- Check for default exposes HOT 1
- Shadowing when aliasing a type with the same name HOT 2
- Discussion: Allow multiple aliases? HOT 4
- Collision detection with preferred aliases HOT 1
- NoModuleOnExposedName fix can introduce name collision HOT 6
- Enforce preferred names
- Applying the fix doesn't always update instances of Module.Constructor HOT 3
- Enforce consistency for every alias
- Shadowing issue with record pattern matching for NoModuleOnExposedNames
- Enforce use of an alias when one is known
- Do not allow exposed names to be qualified HOT 1
- False negative on `Json.Decode` when `Json.Decode.Extra` import is also present
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from elm-review-imports.