Skip to content

add basic typescript typings#53

Closed
larshp wants to merge 2 commits intomicromatch:masterfrom
larshp:types
Closed

add basic typescript typings#53
larshp wants to merge 2 commits intomicromatch:masterfrom
larshp:types

Conversation

@larshp
Copy link
Copy Markdown

@larshp larshp commented Dec 24, 2019

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
Copy link
Copy Markdown
Author

larshp commented Feb 14, 2020

any thoughts?

@larshp
Copy link
Copy Markdown
Author

larshp commented Mar 4, 2020

@jonschlinkert ?

@larshp larshp mentioned this pull request Apr 4, 2020
@p-kuen
Copy link
Copy Markdown

p-kuen commented Apr 13, 2020

Would love to see this get merged.

@larshp
Copy link
Copy Markdown
Author

larshp commented Apr 13, 2020

Yeah, lets see, been a while...

@shellscape
Copy link
Copy Markdown

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

@p-kuen
Copy link
Copy Markdown

p-kuen commented Apr 28, 2020

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

@larshp
Copy link
Copy Markdown
Author

larshp commented Apr 28, 2020

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

@p-kuen
Copy link
Copy Markdown

p-kuen commented Apr 28, 2020

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.

@danez
Copy link
Copy Markdown
Member

danez commented Mar 21, 2026

closing this, as there are now typings available.

@danez danez closed this Mar 21, 2026
@larshp larshp deleted the types branch March 21, 2026 18:45
@sxzz
Copy link
Copy Markdown

sxzz commented Mar 27, 2026

@danez I think built-in typings would still be better in the long run.

@types/picomatch works, but first-party typings give a better DX: no extra install, no version drift, and the types stay aligned with the actual API.

Many projects started with DefinitelyTyped, but later moved their dts into the package itself as TypeScript became standard (for example ESLint and many others).

Since this PR is based on existing JSDoc, the maintenance cost also seems quite low.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants