Run ESLint and Prettier validation to check code style, formatting, and linting rules. Works with any TypeScript/JavaScript project using ESLint/Prettier. Returns structured output with error/warning counts, rule violations, and affected files.
Execute ESLint and Prettier to validate code style, formatting standards, and linting rules across the project.
quality-gate skillnpm run lint)eslint .)npx eslint .)# Check package.json for lint script
if grep -q '"lint"' package.json; then
LINT_CMD="npm run lint"
echo "Using npm script: npm run lint"
# Check for eslint in node_modules
elif [ -f node_modules/.bin/eslint ]; then
LINT_CMD="npx eslint ."
echo "Using npx eslint"
# Use global eslint
elif command -v eslint &>/dev/null; then
LINT_CMD="eslint ."
echo "Using global eslint"
else
echo "❌ Error: ESLint not available"
echo "Install: npm install --save-dev eslint"
exit 1
fi
echo "→ Running lint validation..."
# Run linter and capture output
if $LINT_CMD 2>&1 | tee .claude/validation/lint-output.txt; then
LINT_STATUS="passing"
LINT_EXIT_CODE=0
echo "✅ Lint validation passed"
else
LINT_STATUS="failing"
LINT_EXIT_CODE=$?
echo "❌ Lint validation failed"
fi
if [ "$LINT_STATUS" = "failing" ]; then
# Count errors and warnings
ERROR_COUNT=$(grep -c 'error ' .claude/validation/lint-output.txt || echo "0")
WARNING_COUNT=$(grep -c 'warning ' .claude/validation/lint-output.txt || echo "0")
echo " Errors: $ERROR_COUNT"
echo " Warnings: $WARNING_COUNT"
# Extract affected files
AFFECTED_FILES=$(grep -oP '^/.+\.tsx?(?=\s)' .claude/validation/lint-output.txt | \
sort -u | \
jq -R -s -c 'split("\n") | map(select(length > 0))')
# Parse rule violations (top offenders)
RULE_VIOLATIONS=$(grep -oP '\w+/[\w-]+(?=\s+)' .claude/validation/lint-output.txt | \
sort | uniq -c | sort -rn | head -5 | \
awk '{print "{\"rule\": \"" $2 "\", \"count\": " $1 "}"}' | \
jq -s -c '.')
else
ERROR_COUNT=0
WARNING_COUNT=0
AFFECTED_FILES="[]"
RULE_VIOLATIONS="[]"
fi
{
"status": "$([ "$LINT_STATUS" = "passing" ] && echo 'success' || echo 'error')",
"lint": {
"status": "$LINT_STATUS",
"errors": $ERROR_COUNT,
"warnings": $WARNING_COUNT,
"files": $AFFECTED_FILES,
"ruleViolations": $RULE_VIOLATIONS
},
"canProceed": $([ "$LINT_STATUS" = "passing" ] && echo 'true' || echo 'false')
}
{
"status": "success",
"lint": {
"status": "passing",
"errors": 0,
"warnings": 0,
"files": [],
"ruleViolations": []
},
"canProceed": true
}
{
"status": "error",
"lint": {
"status": "failing",
"errors": 15,
"warnings": 8,
"files": [
"src/components/Settings.tsx",
"src/utils/helpers.ts"
],
"ruleViolations": [
{"rule": "react/prop-types", "count": 5},
{"rule": "@typescript-eslint/no-explicit-any", "count": 4},
{"rule": "prettier/prettier", "count": 3}
]
},
"canProceed": false,
"details": "15 lint errors must be fixed before proceeding"
}
Used in quality-gate skill:
### Step 2: Lint Validation
Use `validate-lint` skill:
Expected result:
- Status: passing
- Errors: 0
- Warnings: acceptable (configurable)
If lint errors found:
❌ BLOCK - Quality gate fails
→ Fix linting errors
→ Re-run quality gate
If lint passes:
✅ Continue to next check
react/prop-types - Missing prop type validation
@typescript-eslint/no-explicit-any - Using 'any' type
react-hooks/exhaustive-deps - Missing hook dependencies
Action: Fix according to project style guide
prettier/prettier - Formatting inconsistencies
Action: Run npm run format or prettier --write .
import/no-unresolved - Cannot resolve import
import/order - Incorrect import ordering
Action: Fix import paths and organize imports
Many linting issues can be auto-fixed:
# Auto-fix ESLint issues
eslint --fix .
# Auto-format with Prettier
prettier --write .
# Combined (if configured)
npm run lint:fix
quality-gate - Uses this for lint validationvalidate-typescript - Type checking (separate from linting){
"status": "error",
"error": "ESLint not available",
"suggestion": "Install ESLint: npm install --save-dev eslint"
}
if [ ! -f .eslintrc.json ] && [ ! -f .eslintrc.js ] && [ ! -f eslint.config.js ]; then
echo "⚠️ Warning: No ESLint config found - using default rules"
fi
.claude/validation/lint-output.txt.eslintignore and .prettierignoreSearch for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer