name: fe-js-ts-quality-gate description: Enforces ESLint, Prettier, and TypeScript compiler checks from the frontend package.json for JavaScript and TypeScript source. Use when creating or editing .js, .jsx, .ts, or .tsx files under fe/, when generating React or Vite frontend code in this repo, or when the user asks for lint-, format-, or tsc-compliant frontend changes.
Frontend JS/TS Quality Gate
Scope
Apply this skill whenever you create or modify any of:
.js,.jsx,.ts,.tsx
under the frontend package that owns the tooling scripts. In this repository, that is fe/ (see fe/package.json).
If the repo later adds other Node packages with their own package.json, use the nearest package.json to the changed files and the scripts defined there instead.
Source Of Truth
Compliance means whatever is configured for:
| Concern | How it is enforced (this repo) | Defined in / via |
|---|---|---|
| ESLint | pnpm run lint → eslint . --max-warnings=0 | fe/package.json, fe/eslint.config.js |
| Prettier | pnpm run format → prettier --check . | fe/package.json, Prettier config in fe/ |
| TypeScript | pnpm run typecheck → tsc -b --pretty false | fe/package.json, fe/tsconfig*.json |
Do not invent style or type rules that conflict with these tools. Prefer fixes in code over disabling rules, unless the user explicitly asks otherwise.
Required Workflow
After implementing changes to .js, .jsx, .ts, or .tsx under fe/src/ (or other frontend sources under fe/):
- Run typecheck (catches
tscerrors for TS and project references). - Run lint (ESLint must pass with zero warnings).
- Run format check (Prettier must pass).
Run from fe/:
pnpm run typecheck
pnpm run lint
pnpm run format
- If any command fails, fix the code (or config, only if the user requested it) and rerun until all three pass.
- In your final response, state which commands you ran and that they passed (or what failed and the exact error if you could not run them).
For larger edits, you may use pnpm run check once the above are green to also run tests (typecheck + lint + format + test).
Optional Autofix
If ESLint/Prettier report fixable issues, you may run:
pnpm run lint:fix
pnpm run format:fix
Then rerun pnpm run lint and pnpm run format (check mode) to confirm a clean state.
Failure Handling
- If
pnpmor dependencies are missing, say so and give the exact commands for the user to run locally afterpnpm installinfe/. - Do not claim ESLint/Prettier/tsc compliance unless the relevant scripts were executed successfully (or you clearly state they were not run).
Relationship To Other Skills
- For PHP/Symfony code under
api/, use thephp-quality-gateskill instead. - The older
ts-tsx-eslint-prettierskill is style-focused; this skill adds mandatory verification viafe/package.jsonscripts for all listed extensions.