-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
2.0.0 Doesn't work with lodash #31
Comments
Then what's your actual codes? I'm using lodash without any problem. |
Here's a minimal repro: https://github.com/le0nik/resolver-typescript-repro If you remove the As an aside: I think that requirement to add |
@le0nik OK, I see. Now @benmosher Please point me if I'm incorrect. And also, I personally disable |
With the 2.0.0 update we're now getting an error from:
not sure i this is related though. |
@sakulstra I think it is just as expected, you can see https://unpkg.com/browse/[email protected]/index.d.ts.
|
I'm going to close this issue, because it is just working as expected, see my comments above, and I do think it relates to @benmosher Any advice for this? |
It looks like I may have found a solution. Try adding this to your eslint config: settings:
import/resolver:
node:
extensions:
- .ts
- .tsx
- .js
- .jsx This fixes the issue for me, making |
@mickdekkers I don't think it's a proper solution, if |
@mickdekkers And As a result, it seems that all imports are passes, even non existing ones, e.g. |
When ESLint is configured to prefer TypeScript modules over JavaScript (even in JavaScript files), attempting to import a named export from `lodash` fails the `import/named` rule with something like: capitalize not found in 'lodash' This seems to happen because `index.d.ts` links to other `.d.ts` files via `/// <reference ...>`, and either `eslint-plugin-import` or `eslint-import-resolver-typescript` does not know to follow those links. (I say "either" because I haven't quite been able to figure out where the exact issue is. The current maintainer of `eslint-import-resolver-typescript` hasn't provided any useful information; [here][1] is the closest issue on GitHub I've been able to find that could explain something.) However, `lodash-es` does not exhibit this issue, as its `index.d.ts` just imports types for individual functions from other files instead of using `/// <reference ...>`. [1]: import-js/eslint-import-resolver-typescript#31
It always throws errors like this(no errors in previous version):
Node version: 12.11.1
Relevant dependencies:
The text was updated successfully, but these errors were encountered: