with one click
markuplint-setup
// Set up Markuplint in a project from scratch. Detects framework, creates config, runs initial lint, and guides the user through rule adoption with Bulk Suppressions support.
// Set up Markuplint in a project from scratch. Detects framework, creates config, runs initial lint, and guides the user through rule adoption with Bulk Suppressions support.
Triage one nu-only fixture from tests/external/snapshots/diff/nu-only.json by reading the spec, then drive its verdict to match-error, match-clean, or nu-over by either fixing markuplint or recording an excluded-ids.json entry. The core operation of the nu-validator coverage benchmark. Use when reducing the nu-only backlog, when checking a coverage-claim ("markuplint misses X" / "over-detects Y") against the bench, or when classifying a specific fixture. Trigger keywords: nu-only, ml-only, coverage gap, bench triage, verdict, match-error, match-clean, nu-over, excluded-ids, declare nu over-detection, claim audit, audit fixture, reduce nu-only, mark-up valid per spec, spec-cited exclusion.
Enable an existing or newly-added markuplint rule on the nu-validator bench by editing tests/external/bench/config.ts. Covers the flat-rule case (rules: { '<name>': true }) and the severity override case (rules: { '<name>': { severity: 'error' } }) that bench-virtual-rule does not. Use when a rule exists in the registry but the relevant nu fixtures stay nu-only because the rule is not enabled in the bench config, or when a rule's default severity is warning but the spec text it mirrors is a MUST / MUST NOT. Trigger keywords: enable bench rule, bench config flat rule, severity override bench, rule not flagging on bench, warning vs error in bench, escalate severity bench, wai-aria-implicit-props bench, bench coverage missing rule.
Set up the nu-validator benchmark environment — initialise the validator submodule, ensure Docker is running, populate the gitignored raw snapshots via yarn bench:update. Also covers Docker / nu-runner troubleshooting. Use when bench commands fail with "no snapshots found", "Docker daemon not reachable", port 28888 conflicts, or healthcheck timeouts; or when refreshing the bench after a long break. Trigger keywords: bench setup, bench Docker, validator submodule, no snapshots found, Docker daemon not reachable, healthcheck times out, port 28888, yarn bench:update first time, bench install, fresh clone bench.
Mirror a preset virtual rule (selectors under `nodeRules` in preset.html-standard.jsonc and similar) into bench/config.ts so the benchmark exercises it. Use when a new disallowed-element / similar selector lands in a preset and the matching nu fixtures remain stuck at nu-only despite the new rule existing in markuplint. Trigger keywords: virtual rule, nodeRules, disallowed-element, preset html-standard, bench config mirror, rule does not fire on bench, preset rule not exercised.
Sync benchmark cross-reference blocks onto GitHub Issue bodies via `yarn bench:xref`, manage `tests/external/bench/issue-xref.config.ts` mappings, and run the pre-release checklist. Use when adding / removing / updating a primary or secondary mapping, when an issue closes upstream, when the xref CLI's output disagrees with what's on the issue body, or before cutting a release that touches a rule the benchmark covers. Trigger keywords: bench-xref, issue-xref, xref CLI, GitHub issue body, primary mapping, secondary mapping, umbrella block, pre-release checklist, bench-xref-audit workflow, marker version.
Add, remove, or adjust Markuplint rules for specific files or elements. Analyzes violations, proposes scope-appropriate configuration changes, and confirms with the user.
| name | markuplint-setup |
| description | Set up Markuplint in a project from scratch. Detects framework, creates config, runs initial lint, and guides the user through rule adoption with Bulk Suppressions support. |
| disable-model-invocation | true |
| argument-hint | [target-glob] |
Set up Markuplint in a project from scratch.
package.json for markuplint and @markuplint/* packages.markuplintrc*, markuplint.config.*)/markuplint-configure insteadScan the project:
package-lock.json / yarn.lock / pnpm-lock.yamlpackage.json dependencies for react, vue, svelte, astro, @alpinejs/csp, etc. Also check file extensions (.jsx, .tsx, .vue, .svelte, .astro, .pug, .php)workspaces in package.json or lerna.json / nx.json / turbo.jsonUse WebFetch to get the latest supported syntaxes and preset information:
Use AskUserQuestion to confirm:
Install using the detected package manager. Example:
npm install -D markuplint @markuplint/jsx-parser @markuplint/react-spec
Do NOT use npx markuplint --init — it requires interactive terminal input.
Write .markuplintrc directly. Keep it minimal — only include what's needed for the detected framework.
Static HTML needs no parser or specs:
{
"extends": ["markuplint:recommended"]
}
Framework projects need parser and spec:
{
"extends": ["markuplint:recommended-react"],
"parser": {
"\\.[jt]sx$": "@markuplint/jsx-parser"
},
"specs": {
"\\.[jt]sx$": "@markuplint/react-spec"
}
}
Refer to https://markuplint.dev/docs/guides/beyond-html for the exact parser/spec package names and file patterns for each framework.
If the project uses external config plugins or shared configs that require fine-grained merging, recommend markuplint.config.ts (or .js) with spread syntax — similar to ESLint's flat config pattern:
import type { Config } from '@markuplint/ml-config';
import reactConfig from '@example/markuplint-config-react';
const config: Config = {
...reactConfig,
rules: {
...reactConfig.rules,
'class-naming': '/^[a-z][a-z0-9-]*$/',
},
};
export default config;
This gives full control over merge order and avoids the limitations of JSON extends (which uses a fixed merge strategy). Use JSON for simple setups; use JS/TS when composing multiple configs.
Run Markuplint and capture the results:
npx markuplint "$ARGUMENTS" --format JSON
If $ARGUMENTS is empty, ask the user for the target glob (e.g., "src/**/*.html").
Summarize:
Use AskUserQuestion for each rule that has violations. Present rules one at a time (or batch related rules).
For each rule, explain what it checks (fetch the rule page if needed: https://markuplint.dev/docs/rules/{rule-id}) and offer options:
When to recommend Bulk Suppressions:
When to recommend disabling:
.markuplintrc with disabled/warning rulesnpx markuplint "$TARGET" --suppressmarkuplint-suppressions.jsonAdd a lint script to package.json:
{
"scripts": {
"lint:html": "markuplint \"src/**/*.html\""
}
}
Adjust the glob to match the project's source files and framework extensions.