eslint-community / eslint-plugin-promise

Enforce best practices for JavaScript promises
ISC License
939 stars 91 forks source link

feat: add type validation / generate typescript declaration file #512

Open voxpelli opened 1 month ago

voxpelli commented 1 month ago

What is the purpose of this pull request?

Fix #488

What changes did you make? (Give an overview)

  1. Added a tsconfig.json as well as a type compiling declaration.tsconfig.json
  2. Added a TypeScript oriented eslint-plugin-jsdoc and improved the JSDoc comments to be compliant with that
  3. Added a CI job that validates the types
  4. Added deactivated npm scripts that can be activated to build on publish once we pass
brettz9 commented 1 month ago

I've made my own attempt so far at https://github.com/eslint-community/eslint-plugin-promise/compare/main...brettz9:ts . I have not yet added types for __tests__, but the rest are passing tsc.

I'm not partial to using my version or anything, but would you mind providing some general feedback on the general approach (which in my case at least seems to require quite a few type checks)?