0

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.

fodma1
  • 3,485
  • 1
  • 29
  • 49
Sagar Hirapara
  • 1,677
  • 13
  • 24

2 Answers2

0

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.

Community
  • 1
  • 1
Tome Pejoski
  • 1,582
  • 2
  • 10
  • 34
-1

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.

Ahmad Alfy
  • 13,107
  • 6
  • 65
  • 99
  • i have tried to declare global in .jshintrc but some how it is not getting in consideration.i have already mention that in my question. – Sagar Hirapara Dec 28 '15 at 04:19
  • @Sagarpatel you didn't mention you that you tried `"predef": [ "angular" ]` ... Good luck – Ahmad Alfy Dec 28 '15 at 08:46
  • yes i havn't mentioned that "predef":["angular"] i used. but i mentioned that i have tried to declare in .jshintrc but somehow all the setting inside that file is not getting into consideration. – Sagar Hirapara Dec 28 '15 at 09:10