ESLint import resolver for ESM modules via package.json exports map.
Relies on NPM package resolve.exports
https://github.com/lukeed/resolve.exports
See:
- import-js/eslint-plugin-import#1868
- import-js/eslint-plugin-import#1810
- browserify/resolve#224
- wooorm/import-meta-resolve#2
- eslint-community/eslint-plugin-n#4
- mysticatea/eslint-plugin-node#255
- mysticatea/eslint-plugin-node#244
- mysticatea/eslint-plugin-node#258
- https://github.com/webpack/enhanced-resolve
Thank you. I am actually using a slightly different technique in my project, which I probably figured out after I posted this Gist (note to self: update the Gist!)
I am not sure which technique is "best" (in terms of of how the resolver stack is expected to work). Here's my additions:
... as opposed to your fix which returns
false
after a successfulrequire.resolve()
:What do you think? (I'll run some tests at my end)