Skip to content
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

Generate types rather than relying on type-fest #209

Merged
merged 12 commits into from
Feb 10, 2024

Conversation

voxpelli
Copy link
Contributor

@voxpelli voxpelli commented Jan 31, 2024

I was first going to update this repository to use the latest type-fest (^4.10.2) instead of the old ^0.20.2, but then I thought: Why do ReadonlyDeep<> on the fly, with input from a JSON-file, when we can just as well generate it up front instead?

So I threw together a quick script that generates a readonly structure using interface:s.

Should probably do something that automates this generation, any specific way you would prefer?

(Found this as I found that ESLint is relying on this module and thus that an old type-fest is pulled in to all of my projects)

Fixes #208

package.json Outdated Show resolved Hide resolved
package.json Show resolved Hide resolved
@voxpelli
Copy link
Contributor Author

voxpelli commented Feb 9, 2024

@sindresorhus Done ✔️

Also, I see that there's an index.test-d.ts in there as well, but tsd is never run in test?

@sindresorhus
Copy link
Owner

Also, I see that there's an index.test-d.ts in there as well, but tsd is never run in test?

I think that's a mistake. It should run tsd in the test script.

@voxpelli
Copy link
Contributor Author

voxpelli commented Feb 9, 2024

Got tsd running, and that was good as that uncovered what would had been a regression, now fixed the generated types to look more like the old ones

@voxpelli
Copy link
Contributor Author

voxpelli commented Feb 9, 2024

Now... I'm way to trigger-happy today, sorry

@voxpelli voxpelli requested a review from sindresorhus February 9, 2024 11:25
@sindresorhus sindresorhus merged commit da83698 into sindresorhus:main Feb 10, 2024
3 of 6 checks passed
@voxpelli voxpelli deleted the remove-type-fest-dependency branch February 10, 2024 22:14
voxpelli added a commit to voxpelli/eslintrc that referenced this pull request Feb 12, 2024
Only breaking change is the dropping of old Node.js versions but it still support all versions that `@eslint/eslintrc` supports.

The one impactful thing it does though is that it removes the only dependency – replacing an outdated `type-fest` module with built-in types – making it so that everyone that installs `eslint` doesn't also get an outdated `type-fest` and thus doesn't have to contend with it in their `npm` deduping and hoisting.

Relevant PR: sindresorhus/globals#209
nzakas pushed a commit to eslint/eslintrc that referenced this pull request Feb 12, 2024
Maintenance update of `globals` to `v14`

Only breaking change is the dropping of old Node.js versions but it still support all versions that `@eslint/eslintrc` supports.

The one impactful thing it does though is that it removes the only dependency – replacing an outdated `type-fest` module with built-in types – making it so that everyone that installs `eslint` doesn't also get an outdated `type-fest` and thus doesn't have to contend with it in their `npm` deduping and hoisting.

Relevant PR: sindresorhus/globals#209
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.

package types return any if the project's tsconfig does not enable resolveJsonModule: true
2 participants