format-js

star 27

Format JavaScript/TypeScript code with Prettier

y1feng200156 By y1feng200156 schedule Updated 2/10/2026

name: format-js description: Format JavaScript/TypeScript code with Prettier

JavaScript/TypeScript Format Skill

๐Ÿ“‹ Overview

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.

๐Ÿ”ง Prerequisites

Tool Min Version Check Command Installation
Node.js 16+ node --version nodejs.org
Prettier 2.8+ prettier --version npm install -g prettier

๐Ÿš€ Usage

Method 1: AI Assistant

"Use format-js to format my JavaScript code"

Method 2: Run Script Directly

# Windows
.\.agent\skills\format-js\scripts\format.ps1

# Linux/Mac
./.agent/skills/format-js/scripts/format.sh

Method 3: With Parameters

# Check without modifying
.\.agent\skills\format-js\scripts\format.ps1 -Check

# Format specific file types
.\.agent\skills\format-js\scripts\format.ps1 -Extensions "js,ts,jsx,tsx"

๐ŸŽฏ What It Formats

  • โœ… Indentation and spacing
  • โœ… Quote unification (single/double)
  • โœ… Line length limits
  • โœ… Semicolon add/remove
  • โœ… Bracket and comma normalization
  • โœ… Arrow function formatting

โš™๏ธ Configuration

// .prettierrc
{
  "semi": true,
  "singleQuote": true,
  "tabWidth": 2,
  "trailingComma": "es5",
  "printWidth": 80,
  "arrowParens": "avoid"
}

๐Ÿ”— Related Resources

Install via CLI
npx skills add https://github.com/y1feng200156/ham-study --skill format-js
Repository Details
star Stars 27
call_split Forks 5
navigation Branch main
article Path SKILL.md
More from Creator
y1feng200156
y1feng200156 Explore all skills →