microsoft / microsoft/DefinitelyTyped-tools
Allow running dtslint without header checks
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 423
- Forks
- 237
- Avg merge
- 18h 18m
- Merged PRs (30d)
- 11
Description
Hello DT-tools team! I've been using the same approach as DT for lining all auto-generated auto-updated Google Client API types, that are indirectly published to DT by reference.
My goal is to have the same testing and quality standards as DT.
Now original dtslint doesn't work with TS5.0:
The 'unnecessary-bind' rule threw an error in '/home/runner/work/google-api-typings-generator/google-api-typings-generator/types/gapi.client.walletobjects-v1/tests.ts':
TypeError: DeprecationError: 'originalKeywordKind' has been deprecated since v5.0.0 and can no longer be used. Use 'identifierToKeywordKind(identifier)' instead.
So I'm following DT footsteps and migrating to @definitelytyped/dtslint: https://github.com/Maxim-Mazurok/google-api-typings-generator/pull/974
I do understand that @definitelytyped/dtslint is probably very specific to DT internal tooling, but it would be great to have the ability to use it outside of DT for use-cases such as mine, where types aren't published directly to DT, but still are referenced there and would like to have the highest level of quality.
Most of the header checks are irrelevant or even bad for me. For example, I use special versioning system to be in sync with how Google versions their schema revisions, and it doesn't pass the checks: gapi.client.abusiveexperiencereport-v1's package.json has bad "version": 0.0.20231106 must end with ".9999". Also even more critical one - my packages have to be public as I publish them myself to the public registry as https://www.npmjs.com/package/@maxim_mazurok/gapi.client.sheets-v4 for example, and then they are referenced in https://www.npmjs.com/package/@types/gapi.client.sheets-v4 so that I can push auto-updates hourly without extra maintenance burden for DT maintainers. Yet, I'm getting error parsing headers...
gapi.client.abusiveexperiencereport-v1's package.json has bad "private": must be `"private": true`
For now, I had to add a patch to disable these checks: https://github.com/Maxim-Mazurok/google-api-typings-generator/blob/dtslint-migration/patches/@definitelytyped+dtslint+0.0.197.patch
But it might become a maintenance burden with future updates.
If there was an option or a flag to disable header checks - that would be awesome! I could probably do that similarly to what I've done in the patch, if the flag is passed - assume that package.json is an empty object. If this looks fine - I'm happy to make a PR.
I appreciate your consideration!
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked @definitelytyped/dtslint migration and the patch in google-api-typings-generator. Trace how dtslint processes package.json headers, then determine where an option or flag can bypass those checks while retaining the remaining linting; done means the external packages run without header errors and existing checks still work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100