-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Check packages for index.d.ts without types
or typings
field in package.json
#64
Comments
Is that file included in the files array of the package? |
Yep, it is: https://unpkg.com/browse/[email protected]/package.json Is the I guess this would work in most cases! Wonder if there are any cases in which this would fail (eg. no |
I suppose a check for any |
Could you just check for the existence of |
I would prefer not having to check node modules, currently everything works off of the package defs. |
Just so I understand the issue, you want the presence of |
Yep, that seems like an accurate description 👍 |
It seems even the NPM API doesn't return the |
Files on disk would be an alternative. Also, there are other ways of doing it - eg. relying on a single request (either GET or HEAD) to the popular, performant CDN UNPKG:
I think it's a popular enough pattern in npm package publishing to put in some work to try to support it. |
Files on disk would not be deterministic, as there would be a difference between running typesync before or after an Using
|
#24 implemented checks for internal types in packages, but it seems like it didn't address the case of a package with an
index.d.ts
but notypes
/typings
field inpackage.json
.This is apparently allowed, according to TypeScript docs (and also used in the wild):
https://twitter.com/sindresorhus/status/1342368373296881664
The text was updated successfully, but these errors were encountered: