mk-lint-and-validate
Linting and static analysis after code edits. Triggers on lint, format, check, validate, types. NOT for full build verification (mk:verify) or test coverage (mk:testing).
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 16
- Forks
- 3
01 前言 Front Matter
- name
- mk-lint-and-validate
- description
- Linting and static analysis after code edits. Triggers on lint, format, check, validate, types. NOT for full build verification (mk:verify) or test coverage (mk:testing).
- disable-model-invocation
- true
02 资源文件 1
- 参考文档references/linter-commands.md2.8 KB
03 SKILL.md 正文
Lint and Validate Skill
MANDATORY: Run appropriate validation tools after EVERY code change. Do not finish a task until the code is error-free.
For the full pipeline (build → lint → type-check → tests → coverage), use
mk:verify.mk:lint-and-validateis a lint-only subset intended for post-edit quick checks.
Procedures by Ecosystem
See references/linter-commands.md for full command reference per ecosystem (Node.js/TS, Python) and Shared validation scripts.
The Quality Loop
- Write/Edit Code
- Run Audit:
npm run lint && npx tsc --noEmit - Analyze Report: Check the "FINAL AUDIT REPORT" section.
- Fix & Repeat: Submitting code with "FINAL AUDIT" failures is NOT allowed.
Error Handling
- If
lintfails: Fix the style or syntax issues immediately. - If
tscfails: Correct type mismatches before proceeding. - If no tool is configured: Check the project root for
.eslintrc,tsconfig.json,pyproject.tomland suggest creating one.
Strict Rule: No code should be committed or reported as "done" without passing these checks.
Scripts
See references/linter-commands.md for full command tables and Shared validation scripts.
Gotchas
- ESLint flat config (
eslint.config.mjs) and legacy.eslintrcare mutually exclusive — ESLint 9 auto-detects the flat config format and ignores any.eslintrc.*files in the same directory; if the project has both, the flat config silently wins and all legacyextendsrules are dropped without error, making it look like rules pass when they were never loaded. eslint --fixrun on unstaged files destroys uncommitted work —--fixwrites changes directly to disk without prompting; if run on a file with uncommitted edits, ESLint's changes overwrite the working tree diff; always stage changes withgit add -pbefore running--fix, or use--fix-dry-runto preview.- TypeScript ESLint parser version must match the installed
typescriptversion —@typescript-eslint/parserpins against specific TypeScript minor versions; a TypeScript upgrade (e.g., 5.3 → 5.5) without bumping@typescript-eslint/parsercausesUnexpected tokenparse errors on new syntax even thoughtscaccepts it fine. extendsorder determines rule precedence and later entries win — in legacy.eslintrc,extends: ['plugin:vue/recommended', 'prettier']works (prettier overrides vue formatting), but reversing to['prettier', 'plugin:vue/recommended']re-enables vue formatting rules that conflict with prettier, producing unfixable lint errors on every save.- Prettier and ESLint format rules conflict when both run on the same file —
eslint --fixapplyingquotes: 'single'thenprettierreformatting to double quotes creates an infinite fix loop in editor save hooks; disable all formatting rules in ESLint (eslint-config-prettier) and let Prettier own formatting exclusively.
04 同仓库更多 Skills
mk-worktree
Manages git worktrees for parallel agent isolation: creates parallel/{name}-{timestamp} branches, merges with conflict detection. NOT for user feature branches (use git worktree directly).
mk-workflow-orchestrator
Auto-invoked 7-phase workflow for complex-feature intent; fasttrack mode for pre-approved specs. NOT for explicit single tasks (mk:cook), green-field builds (mk:autobuild), or simple fixes (mk:fix).
mk-web-to-markdown
Fetch a URL and return clean markdown, for arbitrary external pages (blog, RFC, GitHub issue, vendor doc) not covered by mk:docs-finder. Static-only by default; opt-in JS rendering available.
mk-vulnerability-scanner
Vulnerability analysis: OWASP Top 10, current threat landscape, supply chain security, attack surface mapping, risk prioritization. Use for security audits. NOT for STRIDE/CSO infra audits (mk:cso).
mk-vue
Vue 3 authoring/review: components, composables, reactivity, Pinia, Pinia Colada, file routing, forms. Composition API + script setup. Auto-activates on .vue files. Deep review: mk:vue-best-practices.
mk-vue-testing-best-practices
Vue 3 testing best-practices review: Vitest + Vue Test Utils for components, composables, Pinia, Router, async/Suspense, forms, a11y, plus Playwright E2E strategy. Advisory only.