Repository navigation
fix(types): fix tsgo (TS 7.0) type errors and re-enable the native-preview CI job - #5344
Merged
Merged
Conversation
Review or Edit in CodeSandboxOpen the branch in Web Editor • VS Code • Insiders |
✅ Deploy Preview for redux-starter-kit-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
@reduxjs/rtk-codemods
@rtk-query/codegen-openapi
@rtk-query/graphql-request-base-query
@reduxjs/toolkit
commit: |
Collaborator
|
thanks! |
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.
Fixes #5156.
Problem
The
test-types-native-preview(tsgo) job added in #5155 was disabled because it surfaced type errors under TypeScript 7.0 (tsgo), whiletscstayed green.Root cause
Not an actual type regression.
tscandtsgoattribute overload errors (TS2769) to different lines:tscreports them on the call site,tsgoon the argument that failed to match. As a result, some of our@ts-ignore/@ts-expect-errordirectives sat on the linetsgodoesn't associate with the error, so they either failed to suppress it or were flagged as unused (TS2578).Changes
buildHooks.ts: thepreSelectorargument tocreateSelectoris a union of the standard and infinite-query pre-selectors;tsgoreports the overload mismatch on that argument line. Added an inline@ts-ignoreon the argument, matching the existing one onselect(stableArg).mapBuilders.test-d.ts: the twoaddCasecalls that are expected to error had their@ts-expect-erroron thebuilder.addCase(line, buttsgoreports the error on the reducer argument. Collapsed each call onto a single line (with// prettier-ignore) so both compilers attribute the error to the line directly below the directive. Test intent is unchanged — the calls are still expected to error.tests.yml: removedif: falsefrom thetest-types-native-previewjob so it runs. Keptcontinue-on-error: true, since it targets a moving-devbuild and shouldn't block unrelated PRs if a future nightly changes behavior.Testing
Verified clean under both
tsc5.9.3 andtsgo7.0.0-dev across:tsconfig.test.json)TEST_DIST=true, prod path aliases erased)