xaml-lint 1.2.0

dotnet tool install --global xaml-lint --version 1.2.0
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local xaml-lint --version 1.2.0
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=xaml-lint&version=1.2.0
                    
nuke :add-package xaml-lint --version 1.2.0
                    

logo

xaml-lint

NuGet CI License: MIT

A XAML linter, with Claude Code plugin integration so Claude can catch XAML problems as it writes and edits code.

Install

dotnet tool install -g xaml-lint

Requires the .NET 8, 9, or 10 SDK on PATH.

Use with Claude Code

The plugin's PostToolUse hook shells out to the xaml-lint CLI, so the CLI must be installed and on PATH before the plugin can do anything:

dotnet tool install -g xaml-lint
xaml-lint --version

If xaml-lint --version fails, add the global tool directory to your PATH (%USERPROFILE%\.dotnet\tools on Windows, ~/.dotnet/tools on macOS/Linux) and try again.

Then, inside Claude Code:

/plugin marketplace add XAML-Lint/xaml-lint
/plugin install xaml-lint@xaml-lint

The bundled PostToolUse hook runs xaml-lint on every .xaml / .axaml file Claude writes or edits and feeds diagnostics back into the conversation automatically. Use /xaml-lint:lint <path-or-glob> to trigger a manual lint.

Use from the CLI

xaml-lint lint src/Views/MainView.xaml
xaml-lint lint "src/**/*.xaml"

Sample output:

src/Views/MainView.xaml
     8:20  warning LX0100  Grid.Row="5" but the enclosing Grid declares only 2 rows.
     8:33  info    LX0400  Hardcoded string on 'Text' should be moved to a resource.
     9:18  warning LX0300  x:Name 'userInput' should start with an uppercase letter.

Configure

Create xaml-lint.config.json at your repo root:

{
  "$schema": "https://raw.githubusercontent.com/XAML-Lint/xaml-lint/main/schema/v1/config.json",
  "extends": "xaml-lint:recommended",
  "defaultDialect": "wpf",
  "rules": { "LX0005": "off" }
}

See docs/config-reference.md for the full schema, and docs/rules/ for the full rule catalog (37 rules across Layout, Bindings, Naming, Resources, Input, Usability, Accessibility, and Platform categories, dialect-gated for WPF / WinUI 3 / UWP / MAUI / Avalonia / Uno).

Output formats

xaml-lint lint --format <name>:

  • pretty — colored, TTY default.
  • compact-json — stable JSON envelope; default when stdout is redirected; Claude's plugin hook reads this format.
  • msbuild — one line per diagnostic; matches dotnet build output style.
  • sarif — SARIF 2.1.0 for CI integrations.

Exit codes

  • 0 — no findings or only warning/info.
  • 1 — at least one error-severity diagnostic.
  • 2 — tool-level failure (malformed config, unreadable input, engine crash).

Attribution

Many of the lint rules in this project are ports of checks from the Rapid XAML Toolkit by Matt Lacey, used under the MIT License. Ported rules carry the upstream RXT### code via their UpstreamId field and a source-file header comment. Tool/engine diagnostics (LX0001–LX0006) and some lint rules (e.g., LX0104) are original to xaml-lint — their UpstreamId is null. The VS extension, code generation, and IDE-specific pieces of the original project are not part of this fork's scope. See docs/comparison-with-rapid-xaml-toolkit.md for the per-rule mapping.

Contributing

See CONTRIBUTING.md for the versioning policy, the "add a new rule" flow, and how to run tests locally.

License

MIT

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
1.2.0 113 4/27/2026
1.1.0 107 4/23/2026
1.0.0 96 4/19/2026
0.5.1-alpha 95 4/19/2026
0.4.13-alpha 100 4/18/2026
0.3.21-alpha 103 4/18/2026
0.2.19-alpha 93 4/18/2026
0.1.50-alpha 101 4/17/2026