| name | lint |
| description | Runs the appropriate linter and formatter for specified files in react-gts-app. Maps file extensions to GTS-backed tools (eslint, prettier) and reports remaining errors. Use when linting a specific file or directory, or after editing code before moving on.
|
| user-invocable | true |
| disable-model-invocation | true |
| argument-hint | <file or directory> |
Lint
Run the right tool for each file type against the GTS-backed toolchain in example/.
Steps
1. Resolve target
- If
$ARGUMENTS is a file, lint that file.
- If
$ARGUMENTS is a directory, lint every supported file under it.
- If
$ARGUMENTS is empty, lint the working-tree changes: cd example && git diff --name-only HEAD.
2. Map extension → tool
Run all commands from inside example/ so local gts / eslint / prettier resolutions work:
| Extension | Commands |
|---|
.ts, .tsx, .js, .jsx | npx eslint --fix <file> then npx prettier --write <file> |
.css, .scss | npx prettier --write <file> |
.json, .md, .yaml, .yml | npx prettier --write <file> |
| anything else | skip — do not invent a tool |
Example invocation for a TS file:
cd example && npx eslint --fix src/App.tsx && npx prettier --write src/App.tsx
3. Re-check and report
After --fix passes, re-run npx eslint <file> on TS/JS files to surface anything that couldn't be auto-fixed. For CSS/JSON/MD, a successful prettier --write is the report.
Summarize:
- Files linted (count + paths).
- Files auto-fixed (if any diff was applied).
- Remaining errors (exact ESLint output, per file).
- Suggest a fix for each remaining error — don't silently swallow them.
4. Shortcut for the whole project
When the user asks to lint everything, prefer npm run fix (auto-fix) or npm run lint (report-only) inside example/ rather than walking files one at a time. They dispatch through GTS exactly as this skill does.
Rules
- Always
cd example before running tools — the linters rely on the local config and node_modules.
- Never bypass the linter with inline disables. If a rule is wrong for a file, raise it as an explicit discussion.
- For binary, lockfile, or generated files: skip, don't attempt to format.
- Report results; do not claim "all good" if ESLint still has errors.