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

[import/default] - false negative for react-test-renderer #2183

Closed
Maxim-Mazurok opened this issue Aug 9, 2021 · 3 comments · Fixed by #2184
Closed

[import/default] - false negative for react-test-renderer #2183

Maxim-Mazurok opened this issue Aug 9, 2021 · 3 comments · Fixed by #2184

Comments

@Maxim-Mazurok
Copy link
Contributor

I'm doing this:

import reactTestRenderer from 'react-test-renderer';

Getting this:

No default export found in imported module "react-test-renderer". eslint (import/default)

Using these types: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react-test-renderer/index.d.ts

And I have esModuleInterop in my tsconfig, so this should not throw error (thanks to #1689)

@alasdairhurst
Copy link

alasdairhurst commented Aug 9, 2021

This may be related to this, what seems like a regression in the latest version of elsint-plugin-import, although we're not using esmoduleInterop.

We're using [email protected]

const Mingo = require('mingo');

Suddenly started resulting in the error:

Unable to resolve path to module 'mingo' import/no-unresolved

Not fully versed with how typescript imports work, but Mingo also uses it. My module does not.
https://github.com/kofrasa/mingo/tree/2.5.3

note we're also not using the "import" syntax here, but require. Maybe plugin-import is mixing up "main" and "module" in package.json?

"main": "./dist/mingo.js",
 "module": "./lib/index.js",

the file at "module" is not available in this case.
image

@ljharb ljharb closed this as completed in ce540b6 Aug 10, 2021
@Maxim-Mazurok
Copy link
Contributor Author

@alasdairhurst I didn't put a lot of effort into figuring out if this is regression or not, your issue is probably different... Probably you should open a new one.

@ljharb
Copy link
Member

ljharb commented Aug 10, 2021

@alasdairhurst i don't think that is related; please do file a new issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants