Is the latest jQuery for TypeScript throwing syntax errors?

I am almost 100% sure that I am doing something wrong to cause this, as I am incredibly new to TypeScript and have been updating the old code base.

When I upgrade jQuery to the latest version , I get the following errors when I try to build my project using grunt.

/jquery/jquery.d.ts(279,40): TS1005 error: ',' is expected.

/jquery/jquery.d.ts(279.61): TS1005 error: '=' expected.

/jquery/jquery.d.ts(279.64): error TS1003: Expected identifier.

/jquery/jquery.d.ts(279.97): TS1005 error: ',' is expected.

/jquery/jquery.d.ts(279,118): TS1005 error: '=' expected.

I shortened the paths and did not give each individual line, but there are many of them.

I create this with grunt-ts and seem to be using tsc v1.0.1 - I'm not sure where this will be installed. I just go to the conclusion when he is trying to build.

+6
source share
1 answer

The new version of jquery.d.ts uses the syntax new to TypeScript 1.4. Either upgrade your compiler, or upgrade to an earlier version of the .d.ts [0] file. There is a “1.3” branch at a certain level, specifically designed for files with a .d.ts extension of up to 1.4.

[0] https://github.com/borisyankov/DefinitelyTyped/blob/1.3.0/jquery/jquery.d.ts

+8
source

Source: https://habr.com/ru/post/981407/


All Articles