Turbo87 / webpack-notifier

webpack + node-notifier = build status system notifications
ISC License
306 stars 41 forks source link

feat: add typescript definition file #67

Closed GerkinDev closed 3 years ago

GerkinDev commented 3 years ago

Typescript definition at DefinitelyTyped is obsolete, as it is still for webpack-notifier@1.8.0: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/webpack-notifier/index.d.ts. It would be easier to keep them in sync if both are in the same repo.

If you're not familiar with Typescript, I would be glad to help you maintain it.

Gvozd commented 3 years ago

Please add type testing to PR

  1. test code from webpack-notifier-tests.ts in DefinitelyTyped repo optionally, you can cover the contentImage in more detail
  2. npm script "dtslint": "dtslint types"
  3. add this npm script to .github/workflows/ci.yml in lint job
GerkinDev commented 3 years ago

Note that I've already improved typings on contentImage from what I've seen in the code. See https://github.com/Turbo87/webpack-notifier/pull/67/commits/a54ea92652bfc3a223509276471ca8a1d5f94558#diff-7aa4473ede4abd9ec099e87fec67fd57afafaf39e05d493ab4533acc38547eb8R20 based on https://github.com/Turbo87/webpack-notifier/blob/master/index.js#L43-L54

Gvozd commented 3 years ago

@GerkinDev available at v1.14.0