简体   繁体   中英

JsHint: .jshintrc not working

I am getting error regarding 'angular' was used before it declared. I have tried to declare it in .jshintrc as per below

"globals": {
    "angular": true
}

but still I am getting an error. Also I am getting error of 'alert' is undefined even I have keept below setting in .jshintrc

"browser": true,

Could you please help me setting in .jshintrc is not working. What I am doing wrong. I have also tried to add / global angular / at top of file but after adding to the file I am getting error of Unsupported rule: validateJSDoc: Thanks in advance.

Try to use https://github.com/cfjedimaster/brackets-jshint/ .

Or maybe the answer of this question Adobe Brackets disable jslint but allow jshint will solve your issue.

According to JSHint Documentation globals can be defined inline at the beginning of your JavaScript files like this:

/* globals Angular */

Or in a the .jshintrc JSON object like this:

{
  ....,
  "predef": [ "angular" ]
}

prefed means predefiend . You should include all the globals you are using in this array.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM