Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jetbrains: Suppress unresolved variable error (sometimes)

Within my web project I use jQuery. There is a function registered to jQuery click event.

toggleCalculationSelection : function(ev) {
  var src = typeof ev !== 'undefined' ? $(ev.target) : $('form.attribute input[name="calculation"][value="3"]');

jQuery delivers an event object with a target property. JetBrains Webstorms tells me, that target is an unresolved variable.

I don't want to turn off this check completely.

How can I either tell Jetbrains to ignore this error in this case or teach it, that jQuery has this property?

like image 592
Nabor Avatar asked Sep 30 '13 11:09

Nabor


1 Answers

  1. ev.target is not reported as unresolved for me. Do you have JQuery library enabled for your project?
  2. Alt+Enter, choose any of suggestions ('Create field 'target'', for example), hit Right (or press an arror icon next to suggestion), choose 'Suppress for Statement'
like image 67
lena Avatar answered Sep 20 '22 05:09

lena