antfu-coding-style
Installation
SKILL.md
Antfu Coding Style & Philosophy
Goal: Maximal Developer Experience (DX) through minimalism and smart defaults. "Works out of the box."
1. Code Organization
- Single Responsibility: Keep files small. If you scroll too much, split it.
- Export: Use Named Exports for libraries, Default Exports for components.
- Constants: Extract magic strings/numbers to
constants.ts.
2. TypeScript Preferences
- Implicit over Explicit: Let TS infer types when obvious.
- Bad:
const count: number = 0 - Good:
const count = 0
- Bad:
- Return Types: Explicitly type return values for library limits (public API), infer for internal functions.
- No Enums: Use
const assertionobject or String Unions.type Mode = 'dark' | 'light'>enum Mode { ... }