-
Notifications
You must be signed in to change notification settings - Fork 17
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
Importing from parent behaving unexpectedly #14
Comments
Hi there! Sorry for the late response. I've done some investigating and have determined the issue is with the |
Hmm, question for you @alexlafroscia: What would you expect I think by strict definition they should be in the I see a few possible solutions:
Which solution do you like best? or do you have a different one? I'm leaning towards 3 and releasing this change as v2. |
I think option 3 sounds right to me, too!
…On Thu, Jul 4 2019 at 12:03 AM, < ***@***.*** > wrote:
Hmm, question for you @alexlafroscia ( https://github.com/alexlafroscia ) :
What would you expect.. to be classified as?
What about../.. or../../index.ts ?
I think by strict definition they should be in the index group... but I
don't think it's super valuable to classify these parent directory imports
as index. To me, if I'm importing from an index file a few directories up,
I want it to be sorted with the other files from that directory, not in a
separate group of index files.
I see a few possible solutions:
* If the import path ends in a directory (../.. ,. ,../ ) or relative
directories and then an index (../../index.ts ,./index ), it is classified
as index.
* If the path is one of:. ,./ ,./index ,./index.js (or any line ending),
classify as an index. Anything with.. will be classed as relative to parent
* Remove the index group and have them all be classified as relative to parent
or relative to sibling.
Which solution do you like best? or do you have a different one? I'm
leaning towards 3 and releasing this change as v2.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub (
#14
) , or mute the thread (
https://github.com/notifications/unsubscribe-auth/AAMR2OI4242ZFDWFZLIPPFLP5VZCNANCNFSM4H3DA3ZA
).
|
@ai, as a vocal user of this rule, do you have any other thoughts on this? |
I think According to the docs, I thought that only
|
I have
import-helpers/sort-order
configured like so:I am seeing that either of these are considered "allowable" by the plugin
But this is not, because there must be a newline between groups
This doesn't seem right to me, since it seems like they are in separate groups, but the groups can be ordered either way. Any idea what might be going on?
The text was updated successfully, but these errors were encountered: