jshint global variable problem (not recognize)

Hi, I'm working on a js project that uses jshintrc files for global variable configuration, I've enabled jshint in the IDE's languages & framework settings with the default location.

In my jshintrc file I have several global variables that are declared like this:

{
 "node": true,
 "esversion": 8,
 "globals": {
   "WPS": true,
   "domain": true,
   "object": true,
   "request": true,
   "response": true,
   "parse": true,
   "moment": true,
   "_": true,
   "params": true
 }
}


yet when I'm in a file I get this error, in the case of the request variable for example:

if (!request) {
}

Unresolved variable or type request

This error occurs for every global variable in the jshintrc file

Do you have any ideas on how to solve this problem? 
 

0

What does the error message look like? please share a screenshot of the error tooltip

Note that IDE own inspections don't take the JSHint configuration into account, they have to be configured separately

0

The error message looks like this 

How do I configure the IDE to recognize global variables in my jshintrc file? 
Thanks for your help 

0

thank you! The warning comes from the IDE own inspection
As I wrote, IDE inspections don't take the JSHint configuration into account. You can either suppress the error for statement using the // noinspection JSUnresolvedReference comment, or disable the JavaScript and TypeScript | General | Unresolved reference inspection for your project and rely on JSHint only when reporting undefined variables

1

Thanks for response, the issue can be closed now

0

请先登录再写评论。