hustcc / timeago.js

:clock8: :hourglass: timeago.js is a tiny(2.0 kb) library used to format date with `*** time ago` statement.
https://timeago.org
MIT License
5.32k stars 410 forks source link

Add `@types/jquery` as dependency #185

Closed samuelmeuli closed 5 years ago

samuelmeuli commented 5 years ago

I am using timeago.js in a TypeScript project. When compling the code, I get the following error:

$ tsc --noEmit
node_modules/timeago.js/timeago.d.ts:1:23 - error TS2688: Cannot find type definition file for 'jquery'.

1 /// <reference types="jquery" />
                        ~~~~~~

Adding @types/jquery as a dependency instead of a devDependency in this library should fix this problem. This is also what was suggested in an earlier comment.

hustcc commented 5 years ago

add as peer dependence is better.

tofra commented 5 years ago

Is your error solved with this fix @samuelmeuli ?

samuelmeuli commented 5 years ago

Yes, it is, thanks!

hustcc commented 5 years ago

@tofra add @types/jquery into your package.json.