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
[Fix] extensions
: handle .
and ..
properly
#2778
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we also add some test cases with the "always" option where .
and ..
refer to dirs with package.json, and show that these don't error?
It seems like that may be an existing bug. I'm open to fixing it, but it looks like the case where you import a relative package (i.e. relative path to a directory containing a package.json) is broken. Some options:
Do you have any thoughts here? Additionally, I think |
Ideally I'd like this PR to either add tests documenting the current behavior (with a TODO comment if it's broken), or, tests matching the desired behavior and fixes for it. While |
I added tests that show the current behavior (says extensions are required when they shouldn't be) + TODOs |
73a7e84
to
b993075
Compare
'import * as test from ".."', | ||
].join('\n'), | ||
filename: testFilePath('./internal-modules/plugins/plugin.js'), | ||
options: [ 'ignorePackages' ], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about whether these should be always
. I think with ignorePackages
it should definitely not error, so it makes for a less ambiguous test case.
In the always + relative case it's a bit more ambiguous to me, since if we assume the relative path is in your project, you might have this set to always
because you always want someone to choose a file (within the project).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what to do here, tbh.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to merge this, and please file followup issues and/or PRs :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Filed #2844!
This comment was marked as resolved.
This comment was marked as resolved.
extensions
: handle .
and ..
properly
Thank you! |
The issue was
isExternalRootModule
was returningtrue
for these, since they had no/
in them. This fixes that.Closes #2777