-
-
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
No exported names found in module 'prettier' in an ESM project #3101
Comments
This plugin uses prettier's In other words, as far as the plugin's concerned, you'd need to What happens if you change how you're importing it? |
I tried that above:
$ npx eslint foo.mjs
/tmp/test/foo.mjs
1:8 error No default export found in imported module "prettier" import/default
✖ 1 problem (1 error, 0 warnings) |
aha, well then that's certainly not a viable workaround :-) |
Also, the plugin does not complain about |
It's likely some complex interaction with the combination of |
In an ESM project (
.mjs
or"type": "module"
), eslint-plugin-import can’t find any exports in theprettier
package. Onimport * as prettier from "prettier";
, theimport/namespace
rule complains “No exported names found in module 'prettier'”. Similarly, onimport prettier from "prettier";
, theimport/default
rule complains ‘No default export found in imported module "prettier"’.Complete reproducible example:
eslint.config.mjs
foo.mjs
import/namespace
creates false positives for 'prettier' in v2.30.0 #3069.The text was updated successfully, but these errors were encountered: