← Back to list

typescript-functional
by Seeker1911
backup dotfiles
⭐ 6🍴 0📅 Jan 21, 2026
SKILL.md
name: typescript-functional
IMPORTANT: Keep description on ONE line for Claude Code compatibility
prettier-ignore
description: TypeScript functional programming. Use for pure functions, immutability, composition. Favors ternaries, switch, map/filter/reduce over imperative code. Concise, declarative patterns.
TypeScript Functional Programming
Quick Start
Core principles: Pure functions | Immutability | Composition | Higher-order functions | Declarative over imperative
Prefer: ? : over if | switch over if/else chains |
map/filter/reduce over loops | const over let | Expressions over statements
Example
// ❌ Imperative
function processUsers(users: User[]): string[] {
let result = [];
for (let i = 0; i < users.length; i++) {
if (users[i].age >= 18) {
result.push(users[i].name.toUpperCase());
}
}
return result;
}
// ✅ Functional
const processUsers = (users: User[]): string[] =>
users
.filter(user => user.age >= 18)
.map(user => user.name.toUpperCase());
// ✅ Ternary over if
const getStatus = (age: number): string =>
age >= 18 ? 'adult' : 'minor';
// ✅ Switch for multiple conditions
const getDiscount = (tier: Tier): number => {
switch (tier) {
case 'gold': return 0.2;
case 'silver': return 0.1;
case 'bronze': return 0.05;
default: return 0;
}
};
Reference Files
Check these before suggesting code:
- references/pure-functions.md - Pure function patterns and side effect handling
- references/array-methods.md - map, filter, reduce, and functional iteration
- references/composition.md - Function composition and piping patterns
- references/immutability.md - Immutable data structures and updates
- references/control-flow.md - Ternaries, switch, and functional conditionals
Notes
- Avoid mutations: Use spread operators and array methods
- No
letunless absolutely necessary (preferconst) - Functions should be small, single-purpose, composable
- Prefer function expressions over statements
- Use type inference when possible, explicit types when needed
- Early returns are acceptable for guard clauses
- Last verified: 2025-12-03
Score
Total Score
50/100
Based on repository quality metrics
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
Reviews
💬
Reviews coming soon