TypeScript using jQuery issues

Completed

Hello

Recently we started having problems using jQuery in TypeScript with ReSharper. We have the officiel type declarations for jQuery referenced in our project.

But with ReSharper active we get errors everytime we use a jQuery method. ReSharper will read the returntype as "jQuery<HTMLElemenent>" even though it is defined as "<any>" in the declaration.

Here is an example:

Looking at the jQuery method "data" it is defined as <any>:

And the "index" is a <number>:

But for some weird reason ReSharper interprets it in another way. Disabling ReSharper removes the errors and the code compiles and runs as expected.

0
4 comments

Hello!

 

Thank you for the feedback.

Could you please provide some sample solution demonstrating the issue?

Thank you.

0

Hello,

I will put a sample solution together ASAP.

 

0

Hello,

Sorry for the delay, but just ran into the issue again. Sample available here:

https://biltorvet.as/TSDemo.zip

Best regards,
Christian

0

Hello Christian!

 

Sorry for delay in responding.

I've filed correspondent issue - https://youtrack.jetbrains.com/issue/RSRP-473479.

You are welcome to comment or vote for it.

Thank you.

0

Please sign in to leave a comment.