Fix dev-only lint errors in universal-kyc packages - #10154
Merged
Conversation
Currently, there are some type errors that exist in delegation packages. These type errors are not present in production code, so they are not flagged by `yarn build`, but they _will_ be flagged soon by `yarn lint:tsc`, and so we need to fix them. The notable change here is that since `@metamask/profile-sync-controller` has custom subpath exports, they need to be added to the mapping in `tsconfig.packages.json` to ensure that TypeScript resolves types from source files, _not_ built files.
jiexi
reviewed
Sep 9, 2026
| */ | ||
| function decodeHeader(header: string): { | ||
| payload: Record<string, unknown>; | ||
| payload: UkycStorageAccessToken['payload']; |
Member
There was a problem hiding this comment.
why not UkycStorageAccessTokenPayload directly? I don't really mind either way, just wondering if this was explicit or not
Collaborator
Author
There was a problem hiding this comment.
You're right! No specific reason except that this was done by AI (along with a bunch of other type fixes in a bunch of other files). Switched to UkycStorageAccessTokenPayload in 6c4115b
jiexi
previously approved these changes
Sep 9, 2026
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.
Explanation
Currently, there are some type errors that exist in packages owned by
@MetaMask/universal-kyc. These type errors are not present in production code, so they are not flagged byyarn build, but they will be flagged soon byyarn lint:tsc, and so we need to fix them.The notable change here is that since
@metamask/profile-sync-controllerhas custom subpath exports, they need to be added to the mapping intsconfig.packages.jsonto ensure that TypeScript traces types imported via these subpaths back to files insrc/, not to files indist/.References
https://consensyssoftware.atlassian.net/browse/WPC-1275
Checklist
Note
Low Risk
Test-only and TypeScript path-mapping changes with no production logic edits; verify the user-storage
pathsentry uses${configDir}/../(the diff shows a possible missing slash) and that Jest mappings stay aligned.Overview
Prepares universal-kyc packages for
yarn lint:tscby fixing type/lint issues in tests and monorepo TypeScript resolution—no production KYC behavior changes in the diff.tsconfig.packages.jsonadds explicitpathsfor@metamask/profile-sync-controller/authand.../user-storageso subpath imports resolve tosrc/instead ofdist/, matching the pattern used for other in-repo packages (and intended to stay in sync with Jest’smoduleNameMapper).KYC controller/service tests drop unnecessary suppressions and casts: the missing T&C2
@ts-expect-erroris removed, messenger setup uses a spread onSERVICE_ACTIONS,KycServiceconstruction passes the messenger without aMockAnyNamespacecast, and a nock 409 body is sent as the string'null'instead of JSONnull.testToken.test.tstypes decoded token payloads asUkycStorageAccessTokenPayloadinstead of a loose record.Reviewed by Cursor Bugbot for commit 6c4115b. Bugbot is set up for automated code reviews on this repo. Configure here.