-
-
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
Package export map & self-referencing not possible #2580
Comments
This plugin uses Duplicate of #2430. |
|
@toFrankie no, it's not supported yet. Since packages should be using |
I'm curious why is it using a custom-coded resolver when you could use the "built in" resolver from does eslint always run via node? |
node's built-in resolver can't consistently be used in the way we need it; and regardless, having this plugin behave unpredictably across different node versions would be undesirable. |
1. Description
Hey there 👋
I want to be able to self-reference my package without lint errors while using packages
eslint
&eslint-plugin-import
.I have a repo tree:
. ├── foo-bar.js ├── index.js ├── node_modules ├── package-lock.json ├── package.json └── resolver.cjs
with file contents…
index.js
:foo-bar.js
:package.json
:2. Expected behaviour
npm run lint
runs without errors3. Actual behaviour
npm run lint
throws error:error Unable to resolve path to module 'demo-export-map' import/no-unresolved
You can reproduce it via:
4. Possible solution/workaround
First, create a eslint-resolver.cjs file and add contents:
Then use it as import resolver in .eslintrc.js by adding:
You can reproduce it via:
View fix on github
The text was updated successfully, but these errors were encountered: