-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Open
Labels
type: featurePull requests that introduces new featurePull requests that introduces new feature
Description
[Refactor] Fix untyped array in MessageBox.tsx:76
Description
In apps/meteor/client/views/room/composer/messageBox/MessageBox.tsx at line 76, there is a generic untyped array (any[]). This practice leads to type inference failure when the array is passed as a prop, causing a loss of type safety and information throughout the component.
Bug / Issue Details
- Rocket.Chat version: Latest / Develop
- Target File:
apps/meteor/client/views/room/composer/messageBox/MessageBox.tsx(lines 76-77)
Expected behavior
The code should use strict typing to ensure that the IDE and the TypeScript compiler can correctly infer types, avoiding the "leakage" of any into other parts of the frontend.
Actual behavior
The current implementation uses a shortcut that bypasses linting but compromises type safety:
const a: any[] = [];
const getEmptyArray = () => a;Proposed Solution
Replace the untyped array with a strictly typed empty array or a typed function return.
const getEmptyArray = (): never[] => [];Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
type: featurePull requests that introduces new featurePull requests that introduces new feature