react
3
总安装量
1
周安装量
#57953
全站排名
安装命令
npx skills add https://github.com/vainjs/skills --skill react
Agent 安装分布
opencode
1
claude-code
1
iflow-cli
1
Skill 文档
Standards Detection
Search for ESLint config (.eslintrc.*, eslint.config.*, package.json). If found, merge with baseline (ESLint takes precedence). Otherwise use baseline only.
Baseline Standards
Types & Imports
- Use
type(notinterface) - Use
import typefor type-only imports - Naming:
ComponentNameProps,UseHookNameOptions - Order: types â libraries â components â utilities â styles
Naming
| Element | Convention | Example |
|---|---|---|
| Components | PascalCase | UserProfile |
| Variables/functions | camelCase | getUserData |
| Constants | UPPER_SNAKE_CASE | MAX_RETRY_COUNT |
| Event handlers | on* | onClick |
| Hooks | use* | useAuth |
Components
- Functional components with arrow functions
- Destructure props with defaults
- Named exports preferred
- Set
displayName - Memoize:
useCallbackfor callbacks,useMemofor computations - Early returns for guards
- Conditional rendering with
&&
Custom Hooks
export function useHookName(options: UseHookNameOptions) {}
Code Style
- TypeScript strict mode
- Avoid
anyâ useunknownor specific types - Prefer
constoverlet - Single responsibility functions