Validate Code
Workflow
- Read
package.jsonto identify available scripts - Format + lint fix: run
npm run lint-fixornpm run lint:fix(whichever exists) - Lint + types: run
npm run lint(runstsc --noEmit+ eslint) - Tests: run
npm test - Report overall PASS or FAIL with file:line error references
Rules
- Always auto-fix before reporting errors
- Run lint-fix → lint check → test sequentially
- If lint-fix fails, still run lint check and tests; report all failures at the end
- Report errors as
file:linereferences - Never commit, stage, or push anything
Error Handling
- If no
package.json→ report and stop - If neither
lint-fixnorlint:fixscript exists → skip fix, still runlint - If
lintscript missing → skip lint entirely, note it was skipped - If
testscript missing → skip tests, note it was skipped - If all scripts missing → report nothing to run, stop
- If tests time out → report and suggest increasing
--testTimeoutin runner config - If runner crashes (exit code other than 0 or 1) → report crash output and stop