/lint
qualityidiom & content checksThe dotgui linter — idiom, best-practice, and content checks on top of schema legality. Where /validate answers “is this legal?”, lint answers “is this good, idiomatic dotgui?”.
It is the single source of truth for idiom rules, replacing the old per-consumer copies. Deterministic fixes for the issues it finds live in /autofix.
Signature
lintMarkup(xml: string): LintResult interface LintResult { issues: LintIssue[] // all findings errors: LintIssue[] // level === 'error' ok: boolean // no errors ran: boolean // false only if markup couldn't be parsed }
What it checks
- Structure — unknown tags, empty spacers, required w/h, fill children needing a sized parent.
- Attributes — invented attrs (margin, py, flex…), boolean="false", text-align on text, legacy stroke.
- Values — color formats (hex/$token only), gap="auto" without a fill dimension, undefined $token refs.
- Content “AI tells” — em/en-dashes, lorem ipsum, placeholder names/emails, emoji in copy, filler verbs.
Use cases
- gui lint in the CLI.
- gui-app authoring diagnostics.
- The skill linter — one rule set, not a re-port.
Lint markup and report errors
import { lintMarkup } from '@dotgui/kit/lint' const { ok, errors, issues } = lintMarkup(markup) if (!ok) for (const e of errors) console.error(`[${e.where}] ${e.message}`)