Repository navigation
feat(typescript)!: change base target and lib to es2025 - #247
Merged
Merged
Conversation
The ESLint presets enable unicorn/prefer-iterator-to-array and unicorn/prefer-iterator-helpers, which suggest ES2025 Iterator helpers (`Iterator#toArray()`, `Iterator#some()`, ...). With `lib: ["es2024"]` every suggested fix is a type error in a project that uses both presets, so consumers have to turn the rules off. es2025 also brings the new Set methods, Promise.try and RegExp.escape types. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
commit: |
|
🎉 This PR is included in version 26.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The ESLint presets enable
unicorn/prefer-iterator-to-arrayandunicorn/prefer-iterator-helpers, which suggest ES2025 Iterator helpers (Iterator#toArray(),Iterator#some(), …).typescript/base.jsonstill setslib: ["es2024"], so every fix they suggest is a type error in a project that extends both, and consumers end up turning the rules off (leitstand does today).What
typescript/base.json:targetandlibes2024→es2025(TypeScript 6 shipslib.es2025.*)tsconfig.jsonandtypescript/README.mdfollow alonglib.json/js-lib.jsonstay ones2022on purpose (library targets)BREAKING CHANGE:
@peerigon/configs/typescriptnow setstargetandlibtoes2025(wases2024). The type checker now accepts ES2025 APIs that not every runtime covered byengines: ">=22"implements: Iterator helpers and the new Set methods work in Node 22, butRegExp.escape,Float16ArrayandPromise.tryneed Node 24 or a recent browser. Projects targeting older runtimes should pinlibback to["es2024"]in their owntsconfig.json. Projects that overridelib(e.g.["es2024", "dom"]) keep their value and should bump it toes2025to use the new APIs.Verification
npm run build && npm testpasses (and passes onmainas a baseline)🤖 Generated with Claude Code