Lint xaml
Use when the user asks to lint XAML, check a view, validate XAML markup, audit XAML for issues, or mentions XAML analysis. Invokes xaml-lint on the target file(s) and reports diagnostics.From its SKILL.md
npx -y skills add XAML-Lint/xaml-lint --skill lint-xamlAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 3 stars3 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
2.2 KB, as published. Nobody here has run it
Lint XAML
Run xaml-lint lint <path> to analyze one or more XAML files. The tool emits compact JSON with an array of diagnostics. Each diagnostic has ruleId, severity, message, file, and start/end line+column fields.
How to invoke
- Single file:
xaml-lint lint path/to/View.xaml - Multiple files / glob:
xaml-lint lint "src/**/*.xaml" - Explicit format:
xaml-lint lint --format compact-json path/to/View.xaml
If xaml-lint isn't on PATH, install with dotnet tool install -g xaml-lint and retry.
Dialect selection
Some rules are gated to specific XAML dialects (WPF, WinUI 3, UWP, MAUI, Avalonia, Uno). Detection order:
xaml-lint.config.jsonat or above the repo root withdefaultDialect— use it when present.dialect="..."pragma at the top of the XAML file — honored per-file.- Tool default — WPF.
If the target project isn't WPF and no config is set, pass --dialect <name> explicitly (winui3, uwp, maui, avalonia, uno). Otherwise the user's dialect-specific rules (e.g. LX0201 for x:Bind, LX0301 for x:Uid casing) won't fire.
Interpreting output
The envelope always has the shape:
{
"version": "1",
"tool": { "name": "xaml-lint", "version": "<tool-version>" },
"results": [ ... ]
}
Empty results means clean. For each diagnostic, read ruleId, message, file, and startLine to locate the issue. Use helpUri (when present) to look up the rule's documentation before deciding how to fix.
Severity meaning
error— almost certainly a bug; fix before shipping.warning— likely issue worth fixing; review case-by-case.info— suggestion; apply if it improves the code.
Suppressing a diagnostic
If the diagnostic is a false positive in this specific spot, suppress with a XAML comment immediately before the offending element:
<!-- xaml-lint disable once LX0300 -->
<Button x:Name="myButton" />
For broader suppression, edit xaml-lint.config.json:
{ "rules": { "LX0300": "off" } }