How to integrate Electron to WebStorm having no “Module is not installed” hint?

走远了吗. 提交于 2019-12-10 23:34:44

问题


My Electron project works just fine. But I can't go to the declaration of the electron plugin and I can't figure out how to solve that.

Basically I just wanna get rid of that hint shown in the image below and instead being able to go to it's declaration.

Module is not installed...

Unresolved function or method...

Thanks.


回答1:


You'll need to install TypeScript type definitions for Electron, the first section of this blog post explains how to setup code completion for ReactJS in WebStorm:

To enhance code completion with typed parameter information we recommend that you add a TypeScript definition file for react.d.ts as a JavaScript library for the project.

Go to Preferences | Languages & Frameworks | JavaScript | Libraries, click Download…, select TypeScript community stubs, search for react and click Download. The file will be added as JavaScript library for WebStorm to use in coding assistance.

You should be able to install the Electron type definitions the same way, keep in mind that the typings for Electron are named github-electron (as opposed to just electron).



来源:https://stackoverflow.com/questions/35846392/how-to-integrate-electron-to-webstorm-having-no-module-is-not-installed-hint

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!