picomatch icon indicating copy to clipboard operation
picomatch copied to clipboard

add basic typescript typings

Open larshp opened this issue 6 years ago • 8 comments

This PR adds basic typescript typings based on the existing jsdoc comments.

The types are not perfect as they are auto generated, but on the other hand it does not need to be maintained manually, and something is better than nothing. The automatic generation of types from Javascript was introduced in https://devblogs.microsoft.com/typescript/announcing-typescript-3-7/

  • Add configuration for Typescript compiler
  • 2 JSDoc comments fixed
  • package.json changed to include the types

#18

larshp avatar Dec 24 '19 13:12 larshp

any thoughts?

larshp avatar Feb 14 '20 11:02 larshp

@jonschlinkert ?

larshp avatar Mar 04 '20 05:03 larshp

Would love to see this get merged.

p-kuen avatar Apr 13 '20 08:04 p-kuen

Yeah, lets see, been a while...

larshp avatar Apr 13 '20 08:04 larshp

@jonschlinkert would this be better to live here or on DefinitelyTyped?

shellscape avatar Apr 13 '20 14:04 shellscape

I just added picomatch types to DefinitelyTyped. This can be closed.

p-kuen avatar Apr 28 '20 05:04 p-kuen

from my point of view, it would be nicer to always have the types as part of the package, and always have it matching without additional manual effort

but thanks @Patcher56, I'll probably go ahead and use those types to convert my project to using picomatch

larshp avatar Apr 28 '20 05:04 larshp

Yeah, I am the same opinion. But as we didn't get an answer this is the only option to add types to picomatch.

The best solution in my opinion would be to convert picomatch to typescript. Then the types would be no problem at all.

p-kuen avatar Apr 28 '20 06:04 p-kuen