Here is a simple repository to reproduce the issue: https://github.com/tmtron/mathjs-typescript-types
Stackblitz works
Code completion works fine when we open the project in Stackblitz:
IntelliJ does not work
For some reason, code-completion in IntelliJ (2022.2.3 Ultimate) does not work:
When I Ctrl+Click the MathJsStatic import symbol, IntelliJ shows 2 options:
And it seems to use the wrong one (defined in node_modules/mathjs/types/index.ts):
Question
How can we make IntelliJ use the correct types from index.d.ts (and ignore index.ts)?




Update
The issue is fixed in version
11.3.1mathJs Fix #2812Original
I think the issue is that the library contains an
index.tsfile and anindex.d.tsfile which are not related and this should be fixed by the library authors: see this discussionWorkarounds for now:
node_modules/types/index.tstonode_modules/types/main.tsnode_modules/types/index.ts