jQuery Inspection Anomaly

This has been bugging me a while now!

When using jQuery, this passes fine:

$('.test').fadeIn(200);

However, this does not:

let test = $('.test);
test.fadeIn(200);

fadeIn is getting flagged as 'Method expression is not of Function type'

Any ideas?

4 comments
Comment actions Permalink

works fine for me

do you have jquery typings (.d.ts files) installed? This can be done in Settings | Languages & Frameworks | JavaScript | Libraries: press Download..., type jquery in Download Libraries

see https://www.jetbrains.com/help/webstorm/configuring-javascript-libraries.html#ws_jsconfigure_libraries_ts_definition_files

0
Comment actions Permalink

When I use that method, I get a tonne of 'Argument type string is not assignable to parameter...' problems, as well as others.

I'm using the jQuery CDN and have downloaded the unminified version into php storm to use.

It only seems to be a certain group of functions that are all grouped together in jQuery (slideDown, slideUp, slideToggle, fadeIn, fadeOut, fadeToggle);

Any advice is most welcome!!!

0
Comment actions Permalink

>When I use that method, I get a tonne of 'Argument type string is not assignable to parameter...' problems, as well as others

Must be https://youtrack.jetbrains.com/issue/WEB-48543

0
Comment actions Permalink

Yeah that is absolutely what is happening when I add jQuery through the language preferences. It's mostly flagging up when I use find.

I think the lesser annoyance for me is going to be to carry on using the CDN version of jQuery and have it flag any slide/fade animations!

0

Please sign in to leave a comment.