Skip to main content

typescript

TypeScript + React typing conventions for Ledger Wallet. Read when writing or reviewing .ts and .tsx files.

معلومات المصدر

المستودع
LedgerHQ/ledger-live
آخر نشاط في المصدر
٢١ مايو ٢٠٢٦ في ٠٨:٥٠
لغة SKILL.md المكتشفة
الإنجليزية
النجوم
٦٢٢
التفرعات
٤٩١

خيارات التثبيت

يُحدَّد Prompt الذي يراجع المصدر أولًا بشكل افتراضي. يمكنك التبديل إلى أمر مباشر أو تنزيل نسخة محلية.

مراجعة ملفات المصدر

اقرأ SKILL.md وأي ملفات مرافقة يعرضها SkillsMP قبل أن تقرر التثبيت.

عرض SKILL.md

SKILL.md
تعليمات المصدر · معاينة للقراءة فقط
name
typescript
description
TypeScript + React typing conventions for Ledger Wallet. Read when writing or reviewing .ts and .tsx files.
globs
["**/*.ts","**/*.tsx"]
## Components - Use function components with typed props. - Prefer `React.FC` only when children typing is needed; otherwise avoid. - Memoize when beneficial (`React.memo`, `useMemo`, `useCallback`). ## Props & State - Type props with interfaces or type aliases (PascalCase). - Use `readonly` for immutable props/state shapes. - Avoid `any`; use `unknown` when necessary. - Prefer discriminated unions for state machines. ## Hooks - Extract logic into custom hooks. - Type hook return values explicitly. - Avoid unnecessary dependencies in hook arrays. ## Data & Types - Store types in `types.ts` files. - Use Zod for runtime validation. ## Imports & Exports - Prefer named imports and named exports. - Always declare imports at the beginning of source files. - Import order: 1. External libs 2. Internal modules 3. Types - Avoid default exports. ## Error Handling - Use custom error classes with `code` and optional context. - Prefer `Result<T, E>` patterns for recoverable failures. ## Async Patterns - Use `async/await`. - Wrap async code with `try/catch`. - Avoid inline Promises inside JSX. ## Performance - Use `as const` for literals. - Use mapped types for transformations. - Use memoization and stable references to reduce re-renders.
عرض على GitHub