-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
detect up a directory then down the same directory #471
Comments
Ooo, nice. Yeah, that would be cool. Not sure what to call it, but would be a pretty straightforward rule. Would basically enforce that the path be the same as the Need a good name, though. (edit: I initially misused |
import/no-up-a-directory-then-down-the-same-directory ;) Could also be an easy auto fix too |
👍
|
@jfmengels ooo, I like
|
I think I'd be fine with |
I like extraneous On 2 Aug 2016 21:52, "Jeroen Engels" [email protected] wrote:
|
I guess I've just got other meaning primed for also also I don't love I have weak and meandering enough opinions on this that I'm going to abstain from further name discussion. |
I'm starting to like |
You can't use "relative" because it's redundant. All paths in node are On 2 Aug 2016 22:10, "Jeroen Engels" [email protected] wrote:
|
|
NODE_PATH and support for other non relative paths is being removed On 2 Aug 2016 22:30, "Ben Mosher" [email protected] wrote:
|
External modules (things installed with npm for instance), internal modules (when you use Webpack) are not relative. Also, I'm pretty sure you can specify an absolute path. |
Does that also apply to |
External modules are actually relative to the current module, they just go On 2 Aug 2016 22:39, "Jeroen Engels" [email protected] wrote:
|
Only import, but I presume everyone will switch to import/ whatever dynamic On 2 Aug 2016 22:41, "Thomas Grainger" [email protected] wrote:
|
@graingert mind blown. |
I'd still like to see this implemented. If someone wants to have a go at it, let's go with |
@benmosher another aberration I've discovered in my travels: import foo from './../foo'; which should of course be import foo from '../foo'; |
@benmosher I've bike-sheded this a bit more, and think that no-useless-path-segments would be the best. To go with the other eslint "no-useless-" rules. |
|
I'd like it to start with no- or no-useless- |
|
add no-useless-path-segments rule Fixes #471
I have a structure like:
then in /ham/egg/chips/index.js I sometimes have code that accidental ends up like:
but I'd much rather it be:
The text was updated successfully, but these errors were encountered: