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
Hello.
Thank you for your problem resolve!
I have opinion on catching error.
In my case, use subpath on node.
When cannot resolve
moduleId
in try,err.path
is alwayspackage.json
.When
moduleId
cannot be defined in the try syntax, theerror.path
in the catch syntax is alwayspackage.json
.I think, printing a path that cannot be resolved is much useful. also it is already defined in 'source'.
EX:) error Unable to resolve path to module '#utils/error' import/no-unresolved
Then, what kind of error situation should the following syntax be executed?
Thank you. :)