mk:lint-and-validate
Runs lint, format and static analysis after an edit. A lint-only subset of mk:verify for quick post-edit checks.
| Source | .claude/skills/lint-and-validate/SKILL.md |
| Owner | testing |
| Runtime | claude-code |
| Risk | medium |
| Phase | on-demand |
What it does
Runs the project's lint, format and static-analysis tools after you edit code, so errors surface before you call a change done. It is the lint-only subset of the pipeline. Use it for quick post-edit checks.
When not to use
For the full pipeline (build, lint, type-check, tests, coverage) use mk:verify.
Usage
Ask in plain words: "lint the changes I just made", "run type-check after refactoring the auth module". Script paths in the skill are relative to the skill directory, so prefix them with .claude/skills/lint-and-validate/.
| Ecosystem | Step | Command |
|---|---|---|
| Node.js, TypeScript | Lint | npm run lint |
| Lint with fixes | npx eslint "path" --fix | |
| Types | npx tsc --noEmit | |
| Dependency audit | npm audit --audit-level=high | |
| Python | Lint | ruff check "path" --fix |
| Security | bandit -r "path" -ll | |
| Types | mypy "path" |
The skill also ships two scripts, scripts/validate.py (general validation) and scripts/security-scan.py (security patterns). Run them through node .claude/hooks/lib/skill-python.cjs <script>; if the Python environment is missing, mewkit skill env lint-and-validate creates it.
Steps
- Edit the code.
- Run the audit, for example
npm run lint && npx tsc --noEmit. - Read the report and fix what failed. The skill's rule is that a change with failing checks is not reported as done.
- Repeat until clean. If no tool is configured, the skill looks for
.eslintrc,tsconfig.jsonorpyproject.tomland suggests creating one.
Gotchas
| Trap | Detail |
|---|---|
Flat config and .eslintrc | ESLint 9 uses eslint.config.mjs and silently ignores .eslintrc.* in the same folder, so legacy rules are never loaded. |
eslint --fix on unstaged files | It writes to disk and overwrites uncommitted edits. Stage with git add -p first or use --fix-dry-run. |
| Parser version | After a TypeScript upgrade, bump @typescript-eslint/parser, or new syntax fails to parse while tsc accepts it. |
extends order | Later entries win. Put prettier last. |
| Prettier and ESLint | Format rules in both fight each other. Disable ESLint formatting with eslint-config-prettier. |