setup-prettier-eslint-husky
Set up ESLint, Prettier, Husky pre-commit with lint-staged and format-on-save for a TS or Angular project. Use when asked to add linting, formatting or pre-commit hooks.
SKILL.md.claude/skills/setup-prettier-eslint-husky/SKILL.md
GitHubSet up ESLint, Prettier and Husky for a TypeScript or Angular project. Paths to scripts/ and templates/ are relative to this skill's directory.
Stack
- ESLint flat config (
eslint.config.mjs),@typescript-eslint, plusangular-eslintfor Angular - Prettier with
prettier-plugin-organize-imports - Husky + lint-staged running
eslint --fixandprettier --writeon staged files
Steps
Ask: project type (Angular / plain TS), selector prefix (Angular only), IDE (VS Code / WebStorm / both / none)
Run the setup script:
pwsh scripts/Setup-CodeQuality.ps1 -ProjectType <angular|ts> [-SelectorPrefix app] [-IDE vscode]It installs the packages with pnpm or npm (detected from the lockfile /
packageManagerfield), copies the templates, initializes Husky, adds thelint-stagedblock topackage.jsonand writes the IDE settings.Verify:
npx eslint .andnpx prettier --check .
Templates
| File | Purpose |
|---|---|
.prettierrc |
Print width 100, single quotes, organize-imports plugin, Angular HTML override |
.prettierignore |
Ignores dist/, node_modules/, .angular/, coverage/, *.min.* |
.husky/pre-commit |
Runs npx lint-staged on commit |
angular/eslint.config.mjs |
TypeScript + Angular ESLint + Prettier rules |
plain-ts/eslint.config.mjs |
TypeScript + Prettier rules, no Angular deps |
Constraints
- Flat config only, never legacy
.eslintrc - Angular:
-SelectorPrefixmust match the project's component/directive prefix - Do not overwrite existing configs without confirmation
Report: summary, files created or changed, verify commands.