Using Wrong JavaScript Library Type Declaration
How to use JS library type declaration in node_modules instead of the auto gerenated one by IntelliJ in External Libraries? The type declaration in External Libraries mismatch the version in node_modules, for example I use v6.x.x react-router-dom installed in node_modules, but the type declaration in External Libraries used from DefinitelyTyped/types/ is still v5.x.x so it's make me cant import new exported function from library.
请先登录再写评论。
The IDE downloads typings for some popular libraries to its configuration folder and uses them to enhance code completion. You can remove the auto-downloaded typings from your
<system directory>/javascript/typings
(https://www.jetbrains.com/help/webstorm/directories-used-by-the-ide-to-store-settings-caches-plugins-and-logs.html#system-directory) and then either disabletypescript.external.type.definitions
Registry key or removereact-router-dom
fromtypescript.external.type.definitions.packages
keyThe Registry can be located via: Help > Find action > type
Registry...
The first option only work temporary, when IntelliJ do Indexing again it will re-download again in my case.
The second option is work in my case, and I choose disabling typescript.external.type.definitions.
Thank you.
This is happening to me as well, on the same library. I don't mind the external typings idea but if it isn't going to smarter then it's close to useless.
I disabled it.