It is possible to jump to TS source files inside node_modules
When I ctrl+click some type definitions that belong to lib present in node_modules, PHPStorm opens some *.d.ts file with type definitions. Is there some way, or maybe plugin, to peek actual typescript (or javascript) sources of libraries?
Please sign in to leave a comment.
In JavaScript files:
After that, Ctrl+click will try to take you to the library sources. The same limitation regarding the kind of definition in .d.ts applies.
In TypeScript files:
So jumping to .d.ts files and .ts files works fine, but when a .tsx file is provided,instead it jumps to .d.ts files and not .tsx file.
@Jetbrains please fix it. This would be awesome!
Please share a project the issue can be repeated with
Created example setup and realized it works here.
In my project, there were some missing .d.ts files, that is why it was not proper working.
After proper setup it works now:
- proper mark as "source folder" of node_modules/mylibrary
- generate .d.ts, copy .ts source code inside of node_modules/mylibrary
- create dummy tsconfig.json file inside of node_modules/mylibrary with baseUrl config, and jsx, so IntelliJ does not mark it red and can navigate inside