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?

1

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

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!!!

1

>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

1

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!

1

Still an issue as of July 28, 2023.

0

请先登录再写评论。