-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
Self imports are not working #86
Comments
Ok, just by commenting this three lines // const parent = import_path.default.dirname(dir);
// if (dir !== parent)
// return find(parent); that in fact doesn't exists in upstream it gets fixed. Not sure if create a PR removing them, or fully replacing the |
Properly fixed at #87 |
it should be has been fixed in v16.0.0. just leave it open as it still needs some tests. |
So far version |
I think we can close this now. |
Closed before reading that @aladdin-add wanted to keep it open to add some tests, sorry @aladdin-add 🙏 |
I want to be very careful to not break this in #139 Can you provide a simple example of this? (I want to add a test!) I assume its something like: // package.json
{ "name": "@org/pkg", "main": "./index.js" } // index.js
export function something() {
// magic
} // some.test.js
import { something } from '@org/pkg'; |
Yes, self-imports works like that. |
When doing a self-import (at least for scoped packages) I get a
n/no-missing-import
error. I'm doing it for my project tests files, and when debugging it, I've traced it down toeslint-plugin-n/lib/converted-esm/import-meta-resolve.js
Lines 41 to 62 in 2ce285d
package.json
file and returning its contend when called fromeslint-plugin-n/lib/converted-esm/import-meta-resolve.js
Line 303 in 2ce285d
eslint-plugin-n/lib/converted-esm/import-meta-resolve.js
Lines 683 to 688 in 2ce285d
On the other hand, I've found that in fact this file is a transpiled one, probably generated with webpack or something like that, so it's ugly to work with it. Original import-meta-resolve exists, and it's updated from two months ago, so why don't use it instead using a big blob?
The text was updated successfully, but these errors were encountered: