0

In my index.html I have added this line:

<script src="scripts/vendor/linq.js."></script>

My Web storm IDE says that linq.js can not be resolved.

But the path is for sure correct I checked it many times...

When I run grunt it says there are 51 errors starting with:

It seems that web storm has other code formattings as grunt is using...

app/scripts/vendor/linq.js
  line 12  col 5   Missing "use strict" statement.
  line 16  col 5   Expected '}' to have an indentation at 7 instead at 5.
  line 22  col 26  Strings must use singlequote.
  line 26  col 5   Expected '}' to have an indentation at 7 instead at 5.
...

What could be the error?

UPDATE:

Look at the image the path to linq.js is correct.

enter image description here

When I run grunt it is aborted due to 51 problems see above...

UPDATE 2:

I have removed now the <script linq.js...> and re-run grunt and still the same error.

So it seems to me that it is reason enough that I have a .js file under scripts folder which is somehow not correctly formatted to the jshint task because here it is aborted.

I have still found this link: JSHint behave differently in Webstorm and Grunt

seems very similar to me I will try that out!

UPDATE 3

These is the full error list:

I do NOT want to change a 3rd party script just to fullfil my IDE`s code format settings thats stupid...

app/scripts/vendor/linq.js

 line 12  col 5   Missing "use strict" statement.
  line 16  col 5   Expected '}' to have an indentation at 7 instead at 5.
  line 22  col 26  Strings must use singlequote.
  line 26  col 5   Expected '}' to have an indentation at 7 instead at 5.
  line 29  col 25  Strings must use singlequote.
  line 35  col 28  Expected '===' and instead saw '=='.
  line 35  col 37  Expected '{' and instead saw 'return'.
  line 38  col 17  Expected 'var' to have an indentation at 15 instead at 17.
  line 39  col 17  Expected 'if' to have an indentation at 15 instead at 17.
  line 39  col 23  Expected '!==' and instead saw '!='.
  line 40  col 21  Expected 'return' to have an indentation at 17 instead at 21.
  line 41  col 17  Expected '}' to have an indentation at 15 instead at 17.
  line 43  col 17  Expected 'if' to have an indentation at 15 instead at 17.
  line 43  col 44  Strings must use singlequote.
  line 44  col 21  Expected 'var' to have an indentation at 17 instead at 21.
  line 44  col 51  Strings must use singlequote.
  line 44  col 56  Strings must use singlequote.
  line 46  col 21  Expected 'var' to have an indentation at 17 instead at 21.
  line 47  col 21  Expected 'var' to have an indentation at 17 instead at 21.
  line 48  col 21  Expected 'while' to have an indentation at 17 instead at 21.
  line 48  col 62  Expected '!==' and instead saw '!='.
  line 49  col 25  Expected 'var' to have an indentation at 19 instead at 25.
  line 50  col 25  Expected 'if' to have an indentation at 19 instead at 25.
  line 51  col 29  Expected 'maxLength' to have an indentation at 21 instead at 29.
  line 52  col 25  Expected '}' to have an indentation at 19 instead at 25.
  line 53  col 21  Expected '}' to have an indentation at 17 instead at 21.
  line 55  col 21  Expected 'var' to have an indentation at 17 instead at 21.
  line 56  col 21  Expected 'for' to have an indentation at 17 instead at 21.
  line 57  col 25  Expected 'var' to have an indentation at 19 instead at 25.
  line 57  col 40  Strings must use singlequote.
  line 58  col 25  Expected 'for' to have an indentation at 19 instead at 25.
  line 59  col 29  Expected 'dollar' to have an indentation at 21 instead at 29.
  line 59  col 42  Strings must use singlequote.
  line 60  col 25  Expected '}' to have an indentation at 19 instead at 25.
  line 61  col 25  Expected 'argArray' to have an indentation at 19 instead at 25.
  line 62  col 21  Expected '}' to have an indentation at 17 instead at 21.
  line 64  col 21  Expected 'var' to have an indentation at 17 instead at 21.
  line 64  col 71  Strings must use singlequote.
  line 66  col 21  Expected 'f' to have an indentation at 17 instead at 21.
  line 66  col 37  The Function constructor is a form of eval.
  line 66  col 53  Strings must use singlequote.
  line 67  col 21  Expected 'funcCache' to have an indentation at 17 instead at 21.
  line 68  col 21  Expected 'return' to have an indentation at 17 instead at 21.
  line 69  col 17  Expected '}' to have an indentation at 15 instead at 17.
  line 71  col 21  Expected 'var' to have an indentation at 17 instead at 21.
  line 72  col 21  Expected 'f' to have an indentation at 17 instead at 21.
  line 72  col 37  The Function constructor is a form of eval.
  line 72  col 56  Strings must use singlequote.
  line 73  col 21  Expected 'funcCache' to have an indentation at 17 instead at 21.
  line 74  col 21  Expected 'return' to have an indentation at 17 instead at 21.
  line 74  col 21  Too many errors. (2% scanned).
Community
  • 1
  • 1
HelloWorld
  • 4,671
  • 12
  • 46
  • 78
  • 1
    These look like [JSHint warnings](http://jshint.com/docs/). And, `linq.js` may not follow your project's syntax guidelines. So, perhaps [ignore it](https://github.com/gruntjs/grunt-contrib-jshint#ignores)? – Jonathan Lonowski Mar 15 '14 at 23:57
  • grunt is aborting due to this 'warnings' so they are actually not warnings. Its a real problem. – HelloWorld Mar 16 '14 at 10:34
  • As @JonathanLonowski said, you shouldn't be linting 3rd party libraries. Exclude the `vendor` subdirectory from your JSHint task. – Emerson Farrugia Mar 17 '14 at 00:42
  • @JonathanLonowski Yes I had to ignore linq.js. That was the solution on my question but then other errors started... ;-) – HelloWorld Mar 20 '14 at 14:32

1 Answers1

0

You have an extra . after linq.js in the src attribute of the script tag. The Grunt errors look like linting warnings, not errors (update: I meant, not errors in your code).

Emerson Farrugia
  • 11,153
  • 5
  • 43
  • 51
  • I have removed the extra . but still web storm says: unresolved variable or type linq. I have uploaded a screenshot! – HelloWorld Mar 16 '14 at 10:31
  • Seems you have javascript injected in these URLs for some reason. Please can you attach your .html? If it's not possible, I'd suggest creating a support ticket – lena Mar 16 '14 at 13:35
  • The problem seems to be that webstorm has other code formattings as grunt seems to use. – HelloWorld Mar 16 '14 at 16:55