A 'CSS reset' for TypeScript, improving types for common JavaScript API's
by mattpocockTypeScript
Last 12 weeks · 0 commits
2 of 6 standards met
Summary update GitHub Actions workflows from Node 20-based action versions to Node 24-compatible versions run CI and publish jobs on Node 24 add explicit least-privilege workflow permissions format existing test files that failed the repository's current CI step Details This updates: → → → → It also adds explicit workflow token permissions: CI: Publish: , Validation Parsed both workflow YAML files locally Ran Checked there are no remaining Node 20 / old v4 action references in Ran locally I intentionally did not add a publish environment gate here, to avoid changing the current release approval flow.
I just read through that skill and I like it a lot. And I was thinking, I would actually find it very valuable to be able to read Claude's reports on some of the typing decisions you asked it to research. That would help me understand better why certain type "fixes" haven't been included in this project and would hopefully save you from having the same conversation too often. For example, on your website I read a bit of your reasoning about not changing the result type of to , but then I don't understand why you didn't then opt for changing it to . You probably considered it and decided against it, but I haven't found your reasoning for why.
This PR aims to implement the suggestion in #142 It declares the fill method on a readonly array as never (because fill mutates the original array) It could be improved by removing the method completely from the interface so if someone has any advice on how to do that let me know It also changes the fill method on the normal array by typing it based on the type of the value provided Before: After: This takes into consideration the rest of the arguments of the fill function such that: If the start and end arguments are undefined then the array type is based on the fill value If the start argument is equal to zero and the end argument is undefined, the array is still typed based on the fill value If the start argument is different from zero regardless of the end argument, then the array type is a combination of it's base type and the value type You can see an example of this in the tests Note This type only works if there is a newly created array, it doesn't retype the original array itself I'm also open to any help or suggestions for this
Repository: mattpocock/ts-reset. Description: A 'CSS reset' for TypeScript, improving types for common JavaScript API's Stars: 8612, Forks: 146. Primary language: TypeScript. Languages: TypeScript (100%). License: MIT. Homepage: https://www.totaltypescript.com/ts-reset Topics: reset, typescript. Latest release: v0.4.2 (3y ago). Open PRs: 18, open issues: 36. Last activity: 5mo ago. Community health: 42%. Top contributors: mattpocock, github-actions[bot], amitdahan, Kadrei, CloudNStoyan, none23, donavon, jzlocz, mefechoel, pnowak.