Skip to content
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

rule import/no-unresolved support exports field in package.json #2495

Open
aladdin-add opened this issue Jul 14, 2022 · 4 comments
Open

rule import/no-unresolved support exports field in package.json #2495

aladdin-add opened this issue Jul 14, 2022 · 4 comments

Comments

@aladdin-add
Copy link
Contributor

import '@dian/dn/serve'

the package @dian/dn has an exports like:

  "exports": {
    ".": "./dist/mod.js",
    "./actuator": "./dist/actuator/app.js",
    "./monitor": "./dist/monitor/index.js",
    "./middlewares": "./dist/middlewares/index.js",
    "./serve": "./dist/serve.js"
  },

it's working as expected, but eslint is reporting an error:

1:8  error  Unable to resolve path to module '@dian/dn/serve'  import/no-unresolved
@ljharb
Copy link
Member

ljharb commented Jul 14, 2022

This plugin uses resolve, which does not yet support exports.

It's a best practice, for backwards compatibility, to have your exports LHS map to a RHS that pre-exports node would be able to resolve - doing so would make things Just Work with this plugin in the meantime.

@ljharb
Copy link
Member

ljharb commented Jul 14, 2022

Possible duplicate of #2132.

@Airkro
Copy link

Airkro commented Sep 8, 2022

@KubaJastrz
Copy link

duplicate of #1810

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants