How can i compile a file containing different libr

2019-09-21 01:53发布

I am working on a project that contains multiple libraries (Jquery, jq-ui, fileupload plugins and some other 3rd party plugins) i am converting my project to typescript but in order to work with those libraries I need a .d.ts file to include in my project but when i compile my plugins.ts (just rename from .js to .ts) it give me a bunch of errors and generate a .js file but no .d.ts file and i cannot compile my other files as i need to include a reference of my plugin file

is there any kind of -force type flag in tsc or is their a way to compile my file.

I use this command to compile my ts file tsc --declaration bmkjqplugins.ts

1条回答
贪生不怕死
2楼-- · 2019-09-21 02:41

is there any kind of -force type flag in tsc or is their a way to compile my file.

No. You need to reference those files for complete type safety. That said : typescript will generate valid JavaScript in the presence of TYPEONLY errors.

Note: grunt-TS does support not failing on type errors : https://github.com/TypeStrong/grunt-ts#grunt-ts-gruntfilejs-options

查看更多
登录 后发表回答