0

In the the following screenshot you can see what I mean http://screencast.com/t/WMNkQ11CxSi:

Img

I need to disable this notice for jQuery. Please help me.

nnnnnn
  • 147,572
  • 30
  • 200
  • 241
Erik
  • 14,060
  • 49
  • 132
  • 218
  • Have you tried `Alt+Enter` while having cursor on problematic place, choose correct action from popup menu, then expand submenu (`arrow right`) and choose "Suppress for statement" (will affect that line only) or "Disable inspection" (will affect all files)? Not every inspection can be suppressed this way and I cannot verify this for you (without your files). See screenshot with some details here (not exactly your situation -- just to give you the idea): http://stackoverflow.com/a/20803118/783119 – LazyOne Jan 05 '14 at 18:54
  • Yes thanks, I've chosen "Disable inspection" item. Does it applies for jQuery only or for all constructors w/o new keyword? – Erik Jan 06 '14 at 09:37
  • All of them, of course. But you may narrow the scope (files where it will be disabled) -- right click on inspection (`Settings | Inspections | JavaScript | that inspection`), choose "Add Scope" and proceed from there. – LazyOne Jan 06 '14 at 09:45
  • I mean if I'll have something like MyClass('something') for example. Will it be ignored as well as? – Erik Jan 06 '14 at 09:46
  • "all" means exactly that. So yes -- it will be ignored as well. (unless it is located in completely different file which you can levae default behaviour as described in my previous comment) – LazyOne Jan 06 '14 at 09:49

2 Answers2

0

I've just tried and I think the issue may be related to the fact that Webstorm doesn't have jQuery at hand.

Normally that happens if you're linking jQuery in your HTML within the CDN for example:

<script src="//code.jquery.com/jquery-1.10.2.min.js"></script>

If you look carefully, you'll notice that the //code.jquery.com/jquery-1.10.2.min.js is highlighted and if you put your mouse over, you'll see:

enter image description here

If you click on that and press ALT + Enter, Webstorm will download the library and inspections will be fine.

If you want, you can go also to Preferences > JavaScript > Libraries and either Add it manually somewhere in your computer or even Download them.

enter image description here

Antonio Laguna
  • 8,973
  • 7
  • 36
  • 72
0

Unfortunately this dosen't work for me. I've just found what's my problem. I use jQuery expern file for google closure compiler https://code.google.com/p/closure-compiler/source/browse/contrib/externs/jquery-1.9.js and in the top of this file is the following

/**
* @constructor
* @param {(jQuerySelector|Element|Object|Array.<Element>|jQuery|string|
*     function())=} arg1
* @param {(Element|jQuery|Document|
*     Object.<string, (string|function(!jQuery.event=))>)=} arg2
* @return {!jQuery}
*/
function jQuery(arg1, arg2) {}

Due the jsdoc above @constructor tag I get my problem

Erik
  • 14,060
  • 49
  • 132
  • 218