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

No named exports found in module refer to mjs file #2228

Open
lwr opened this issue Sep 17, 2021 · 4 comments
Open

No named exports found in module refer to mjs file #2228

lwr opened this issue Sep 17, 2021 · 4 comments

Comments

@lwr
Copy link

lwr commented Sep 17, 2021

ref #2093 standard/standard#863

// File a.mjs
export const A = 'a'

// File b.js
export * from './a.mjs'

// File c.js
export * from './b.js'
eslint c.js
# output
#  1:15  error  No named exports found in module './b.js'  import/export

eslint c.js --ext .js,.mjs
# output
#  1:15  error  No named exports found in module './b.js'  import/export

only renaming a.mjs to a.js can workaround this problem

@ljharb
Copy link
Member

ljharb commented Sep 18, 2021

Do you have .mjs in the import/extensions setting? That seemed to be the fix for #2093.

@lwr
Copy link
Author

lwr commented Oct 5, 2021

Do you have .mjs in the import/extensions setting? That seemed to be the fix for #2093.

mjs is the official extension for modules in NodeJS, so I think that it should be parsed by default without any addition config

@ljharb
Copy link
Member

ljharb commented Oct 5, 2021

That's true, but it can't happen until resolve supports "exports".

@Derranion
Copy link

I can confirm that this issue is still exists - got it recently with .ts files.

Here is another good example.

Would love to see it fixed because import \ export check is pretty important.
( as a workaround for now you could change rule to throw warning instead of error )

Thanks a lot.

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

No branches or pull requests

4 participants