| name | code-quality-check |
| description | Comprehensive code quality verification for Node.js/TypeScript projects before production deployment.
Executes Prettier (formatting), ESLint (linting), TypeScript (type checking), and test runners.
Use this skill when:
- User asks to "verify code quality" or "check code quality"
- User wants to "run linter", "run prettier", "run type check", or "check types"
- User needs to "prepare code for production" or "pre-deploy check"
- User requests "code review" or "automated code review"
- User asks to "verify project standards" or "check coding standards"
- User mentions "format code", "lint code", or "fix formatting"
- Before deploying, merging, or releasing code
|
Code Quality Check
Run comprehensive code quality verification: formatting, linting, type checking, and tests.
Quick Start
1. Detect Project Tools
node scripts/detect-tools.js [project-path]
Returns JSON with detected tools (Prettier, ESLint, TypeScript, test runners) and their configurations.
2. Run All Checks
node scripts/check-all.js [project-path]
node scripts/check-all.js --fix [project-path]
node scripts/check-all.js --skip-tests [project-path]
Workflow
Step 1: Detection
Run detect-tools.js to identify what's configured in the project. Check for:
package.json existence
- Prettier config files (
.prettierrc, prettier.config.js, etc.)
- ESLint config files (
eslint.config.js for flat config, .eslintrc.* for legacy)
- TypeScript (
tsconfig.json)
- Test runners (Jest, Vitest, Mocha, Playwright, Cypress)
Step 2: Execution Order
Execute checks in this order (each step depends on previous):
- Prettier - Fix formatting first
- ESLint - Then fix linting (may depend on formatting)
- TypeScript - Type check (requires valid syntax from steps 1-2)
- Tests - Run test suite (requires all above passing)
Step 3: Report Results
Format output as:
[OK] Prettier - All files formatted
[X] ESLint - 3 errors, 5 warnings
[OK] TypeScript - No type errors
[-] Tests - Skipped (no runner configured)
SUMMARY: 1 check failed - fix issues before deploy
Manual Commands Reference
Prettier
npx prettier --check "**/*.{js,jsx,ts,tsx,json,css,md}"
npx prettier --write "**/*.{js,jsx,ts,tsx,json,css,md}"
npx prettier --list-different "**/*.{js,jsx,ts,tsx}"
ESLint
npx eslint .
npx eslint . --fix
npx eslint "**/*.{ts,tsx}"
npx @eslint/config-inspector
TypeScript
npx tsc --noEmit
npx tsc --noEmit --pretty
npx tsc --noEmit --watch
npx tsc --build --noEmit
Tests
npx jest
npx jest --coverage
npx vitest run
npx vitest run --coverage
npm test
Handling Issues
When issues are found:
- Auto-fixable issues: Run with
--fix flag
- Manual fixes needed: Show specific errors and suggest fixes
- Missing tool: Report as skipped, don't fail
For common issues and solutions, see references/common-issues.md.
For recommended configurations, see references/config-examples.md.
Output Format
Use these status indicators:
[OK] - Check passed
[X] - Check failed (errors found)
[!] - Check passed with warnings
[-] - Check skipped (tool not configured)
CI/CD Integration
Recommended npm scripts for package.json:
{
"scripts": {
"quality": "prettier --check . && eslint . && tsc --noEmit",
"quality:fix": "prettier --write . && eslint --fix . && tsc --noEmit"
}
}
Exit codes:
0 - All checks passed
1 - One or more checks failed