Repository navigation
Ban any, unknown and casts through unknown in the client (GRYT-1792) - #890
Merged
Merged
Conversation
any is an error. A cast through unknown (x as unknown as Y) is an error. unknown itself is an error too: our own values get real types. A file that parses outside input carries one disable at the top saying why, and the goal is to remove each. Fixed rather than disabled: the internal socket props typed unknown and cast back to Socket (ChatView, ForumView, MobileServerView, SearchPanel, useChatActions, useForum, useMessageSearch, usePins, useThreads), the window and worker globals, the remark mention node, and pairing's attachment keys, which also check iv now. The SendQueue and MLS session casts stay with a reason: socket.io's generic on and off don't fit those small interfaces. 157 files carry a disable. The 21 marked "not typed yet" are the first to fix. Review-required auth files are exempted in the config, not in the files, and so is e2e. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… (GRYT-1792) A disable comment at the top of 142 files made the PR unreviewable. The exceptions are now lists in .eslintrc.cjs, grouped by why each file still uses unknown, so the only code files this touches are the ones actually fixed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The iv check changed which records survive pairing; check-pairing-approver expects an attachment key with only id and key to come through. Only the type fix stays. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Sivert wants
anyandunknownto be errors, with every existing use either fixed or excepted with a reason, and the goal of emptying the exceptions.Rules (
.eslintrc.cjs)@typescript-eslint/no-explicit-any: error.no-restricted-syntaxforx as unknown as Y: error.@typescript-eslint/ban-typeswithunknown: error.Exceptions, in the config rather than in each file
Files that still use
unknownare listed underoverrides, grouped by why. The goal is to empty these lists:e2e/**is exempt, because tests read hooks offwindow. The review-requiredcommon/src/auth/**is exempt too, so it isn't touched here.Fixed rather than excepted (the only code files in this PR)
socketConnection: unknownplusas Socketin 9 components and hooks is nowSocket | null.windowand workerglobalThisassignments useObject.assign.mentionnode is declared in mdast'sPhrasingContentMapand checked withsatisfies.historyRecordsbuilds the attachment key from the fields it checks, instead of a double cast. What it accepts is unchanged.SendQueueand MLSSessionSocket(socket.io's genericon/off), and electron-updater's read-onlycurrentVersion.18 files.
yarn lint,check-comment-lengthand the mention, history, search, send-queue, plugin, ai-toolkit and pairing checks pass.Vikunja: GRYT-1792
🤖 Generated with Claude Code