← ClaudeAtlas

typescript-devlisted

Use when the user asks to implement, refactor, test, debug, or review TypeScript/TSX code, type definitions, Jest/Vitest tests, ESLint/Biome/Prettier issues, Zod validation, or TypeScript build errors.
iamtatsuki05/dotfiles · ★ 1 · Code & Development · score 51
Install: claude install-skill iamtatsuki05/dotfiles
# TypeScript開発スキル TypeScriptコードの実装、テスト、デバッグ、リファクタリングを効率的に行うためのガイド。 ## 実装前の必須確認 **tsconfig.json/package.jsonを必ず確認する。** プロジェクトの設定に従う。 確認項目: - `tsconfig.json`: target, module, strict, paths, baseUrl - `package.json`: type("module"/"commonjs"), scripts - `.eslintrc`/`eslint.config.js`: ESLint設定(ESLint 9+ は flat config(`eslint.config.js`)が既定。`.eslintrc` は legacy 形式) - `.prettierrc`: フォーマット設定 - `biome.json`: Biome使用時の設定 - 既存のテストランナー(Jest / Vitest / Playwright 等)と `package.json` scripts - React / Node / library / CLI など実行環境 - 既存の型設計、validation、DI、エラー処理のパターン ESLint、Biome、Prettier が併存する場合は、`package.json` scripts と既存CIで使われるものを優先する。`any` や型アサーションは既存方針に従い、必要な場合は理由を明確にする。 ## 型定義 既存の型から派生型を作るときは、手書きで再定義せず組み込みユーティリティ型を使う。 - `Partial<T>` / `Required<T>`: 全プロパティをオプショナル / 必須に - `Pick<T, K>` / `Omit<T, K>`: 特定プロパティの抽出 / 除外 - `Record<K, V>`: キーと値の型を指定したオブジェクト型 - `Readonly<T>`: 全プロパティを読み取り専用に 使用例は [references/common-patterns.md](references/common-patterns.md) を参照。 ## エラーハンドリング - カスタムエラーは `Error` を継承し、`this.name` にクラス名を設定する(instanceof 判定とログの識別のため)。 - Result 型パターンを導入するかは既存プロジェクトの方針に従う。方針がなければ例外ベースを既定とする。 - `fetch` 等の外部呼び出しの失敗は握りつぶさず、URL やステータスなど失敗時の文脈を付けて再 throw する。 - 詳細例(カスタムエラー、Result/Option 型)は [references/common-patterns.md](references/common-patterns.md) を参照。 ## クラス設計 アクセス修飾子、コンストラクタパラメータプロパティ、インターフェース実装・抽象クラスの例は [references/coding-standards.md](references/coding-standards.md) の「クラス設計」を参照。シングルトン等のデザインパターンは [references/common-patterns.md](references/common-patterns.md) を参照。 ## テスト