eslint-plugin-import
eslint-plugin-import copied to clipboard
rule import/no-unresolved support `exports` field in package.json
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
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.
Possible duplicate of #2132.
Try another resolver: https://gist.github.com/danielweck/cd63af8e9a8b3492abacc312af9f28fd
duplicate of #1810