Bug Fix: TypeScript migration for helpers.ts
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 48/100
- issue の種類
- リファクタリング
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- typescript
調査の方向性
app/lib/methods/helpers/helpers.ts から始めて、一覧にあるヘルパー関数を調べ、次に app/lib/hooks/useUserData.ts と app/containers/MessageComposer/components/ComposerInput.tsx での使用箇所を読んで、必要な型を判断します。@ts-nocheck を削除し、パラメーターと戻り値のアノテーションを追加しながら yarn lint と TypeScript コンパイラーを実行します。完了とは、ファイル全体がチェックされ、新しい型エラーがない状態を意味します。
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- TypeScript
- スター
- 2.4k
- フォーク
- 1.5k
- 平均マージ
- 1日 15時間
- マージ済み PR(30日)
- 29
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
RocketChat/Rocket.Chat.ReactNative のほかの issue
-
[IMPROVEMENT] Remove redundant `await` on synchronous `userPreferences.getBool` in `getUsersPresence`対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンtype: feature
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
RocketChat/Rocket.Chat.ReactNative#7737 ·
メンテナーはふだん 1 日以内に返信
-
UIKit modal: a viewSubmit response with no `type` field fails to close the modal on mobile (regression from #7057)対応中かも @erikurt9 が 106 日前に担当しました。 オープンtype: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
RocketChat/Rocket.Chat.ReactNative#7503 · コメント 3 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
type: bug
難易度 1/5 1時間未満 初心者へのやさしさ 86/100
RocketChat/Rocket.Chat.ReactNative#7437 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
✅ tests 👷 ci type: feature
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
RocketChat/Rocket.Chat.ReactNative#7247 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug: goRoom navigates to broken RoomView after failed DM creation from search対応中かも @deepak0x が 216 日前に担当しました。 オープンtype: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
RocketChat/Rocket.Chat.ReactNative#7098 ·
メンテナーはふだん 1 日以内に返信
RocketChat/Rocket.Chat.ReactNative の issue をすべて見る
似ている issue
-
Out of order / duplicate key error shows the key bytes as decimal or UTF-8, not hex対応中かも @bardrop が今日担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 86/100
-
`/leaderboard`, the page and the share image say "be the first" for a program that hasn't startedオープンbug good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
codercops/discord-bot#152 ·
メンテナーはふだん 1 日以内に返信
-
bug i18n
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
endora-commerce/endora-commerce#1315 ·
メンテナーはふだん 1 日以内に返信
-
area:data-quality importer size:S
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
enorm-labs/event-junkie#5136 ·
メンテナーはふだん 1 日以内に返信
-
fix(scripts): set-device-owner.ps1 fails to parse on Windows PowerShell 5.1 (UTF-8 without BOM)オープン
難易度 1/5 1時間未満 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信