require('chai').expect does not resolve
I am a newbie to JS and Webstorm...
Screenshot:

Webstorm 2018.2.5
package.json:
{
"name": "redacted-core",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "mocha"
},
"author": "",
"license": "ISC",
"devDependencies": {
"chai": "^4.2.0",
"mocha": "^5.2.0"
},
"dependencies": {
"winston": "^3.1.0"
}
}
Please sign in to leave a comment.
npm i @types/chai should help:
Thanks for the quick response...
It does help :)
That said, would you know why most tutorials do not mention this npm install ? Is this a Webstorm requirement ?
In case if the properties are created dynamically in runtime, installing Typescript stubs is the only way to get them resolved using static code analysis.
see https://www.jetbrains.com/help/webstorm/configuring-javascript-libraries.html#ws_jsconfigure_libraries_ts_definition_files, https://blog.jetbrains.com/webstorm/2014/07/how-webstorm-works-completion-for-javascript-libraries/