-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Open
Labels
Description
Describe the Bug
The file app/lib/methods/helpers/helpers.ts has @ts-nocheck at the top, which disables TypeScript checking for the entire file. All 8 exported functions lack proper TypeScript type annotations, reducing type safety and developer experience.
Steps to Reproduce
- Open
app/lib/methods/helpers/helpers.ts - Observe
@ts-nocheck - TEMPcomment at line 1 - Notice all function parameters lack type annotations (e.g.,
room,sender,itemare untyped) - Run
yarn lintor TypeScript compiler - no type errors are reported for this file despite missing types
Expected Behavior
- Remove
@ts-nocheckdirective - Add proper TypeScript types to all function parameters and return types
- All functions should have complete type annotations
- TypeScript compiler should properly check this file
Actual Behavior
- TypeScript checking is disabled for the entire file
- No type safety for 8 exported functions
- Potential runtime errors that could be caught at compile time
- Poor IDE autocomplete and IntelliSense support
Rocket.Chat Server Version
N/A (Code quality issue, not server-dependent)
Rocket.Chat App Version
4.67.0
Device Name
N/A (Code quality issue, not device-specific)
OS Version
N/A (Code quality issue, not OS-specific)
Additional Context
File: app/lib/methods/helpers/helpers.ts
Functions to migrate:
isGroupChat(room)getRoomAvatar(room)getUidDirectMessage(room)getRoomTitle(room)getSenderName(sender)canAutoTranslate()isRead(item)hasRole(role)hasPermission(permissions, rid?)
Impact: This file is used in multiple places:
app/lib/hooks/useUserData.tsapp/containers/MessageComposer/components/ComposerInput.tsx- And potentially other files
Related: Part of TypeScript migration effort to improve code quality and maintainability.