Webstorm Code Assistance For Global Variables
Solution 1:
When using libraries that define their own global symbols, it is recommended that you add the corresponding TypeScript type definition file as a JavaScript library in Preferences | Languages & Frameworks | JavaScript | Libraries. Click Download and search for the library you're using.
Solution 2:
Additionally to Ekaterina's answer. If you have defined globally PropTypes = require('prop-types');
via webpack provide plugin for example, you can't just add library from node_modules/prop-types/index.js because it doesn't define any global variables except module.exports
that doesn't help.
In this case you can create separate file
globals.jswindow.PropTypes = require('prop-types')
and add it as Ekaterina sayed to Preferences | Languages & Frameworks | JavaScript | Libraries
P.S. You don't need to import this file in any place of your code if have already set up webpack provide plugin. This file is just to show this global variables for IDE.
Post a Comment for "Webstorm Code Assistance For Global Variables"