-
-
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
Importing modules from d.ts #72
Comments
No idea how to fix this case easily. Maybe @bradzacher can help, because But in another thought, And also, if there are multiple modules defined at a single So there will be no fix quickly. |
Typescript-ESLint is built directly on top of TypeScript, so we don't need to worry about this. TS parses and checks all files together, so it implicitly finds and applies the module declaration. This is essentially impossible for the resolver to handle. A If the module declaration declares a module from Maybe consider instead defining a file somewhere in your project and using |
@bradzacher Do you know is there a TypeScript API to search that? |
There's probably something attached to the Though I don't know offhand. There's a lot of data exposed on its properties and via the type checker. TBH though if this project starts touching the type-information you'd really just be rebuilding typescript's module checks using typescript. And at that point you might as well just scrap all the logic and instead just gather and report the TS diagnostics. |
Yeah, I don't know whether worth to do that. I will do a research first recently. |
I think you should just use |
Or we can provide a simple mapper option to declare the mapping manually, if you want, PR welcome. |
Hi,
I have a case within a project that I tried to reduce to a minimal repro, see here: https://github.com/jeffrson/import_unresolved_dts
eslint with eslint-import-resolver-typescript apparently fails to recognize a module from d.ts, whether or not it is located in / or /@types.
startup.ts looks like this
and there's a file called my_modules.d.ts (name shouldn't matter):
which, when linting, shows the import/no-unresolved error.
The text was updated successfully, but these errors were encountered: