| name | format-js |
|---|---|
| description | Format JavaScript/TypeScript code with Prettier |
Use Prettier to automatically format JavaScript and TypeScript code:
- π¨ Consistent style: Unified formatting across multiple file types
- β‘ Fast execution: Millisecond-level formatting speed
- π§ Out of the box: Reasonable default configuration
- π Wide support: JS, TS, JSX, TSX, JSON, CSS, etc.
| Tool | Min Version | Check Command | Installation |
|---|---|---|---|
| Node.js | 16+ | node --version |
nodejs.org |
| Prettier | 2.8+ | prettier --version |
npm install -g prettier |
"Use format-js to format my JavaScript code"
# Windows
.\.agents\skills\format-js\scripts\format.ps1
# Linux/Mac
./.agents/skills/format-js/scripts/format.sh# Check without modifying
.\.agents\skills\format-js\scripts\format.ps1 -Check
# Format specific file types
.\.agents\skills\format-js\scripts\format.ps1 -Extensions "js,ts,jsx,tsx"- β Indentation and spacing
- β Quote unification (single/double)
- β Line length limits
- β Semicolon add/remove
- β Bracket and comma normalization
- β Arrow function formatting
Safety Gate: By default, this skill skips protected folders (
.agents/,bmad/) andREADME.md.
// .prettierrc
{
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5",
"printWidth": 80,
"arrowParens": "avoid"
}