Roslyn analyzers for Umbraco projects, published as a NuGet package.
dotnet add package ThePensionsRegulator.Analyzers.UmbracoNo extra .csproj configuration is needed — NuGet automatically wires up the analyzer because the DLL is placed in analyzers/dotnet/cs/ inside the package.
| ID | Severity | Description |
|---|---|---|
| TPRUMB0001 | Warning | .Value<T>() called without IPublishedValueFallback |
Umbraco's .Value<T>() extension method has an overload that accepts IPublishedValueFallback. Always use this overload to ensure correct fallback behaviour and testability.
// ❌ Triggers TPRU0001
var x = page.Value<string>("alias");
// ✅ Correct
var x = page.Value<string>(_publishedValueFallback, "alias");Adjust the severity per-project via .editorconfig:
# Treat as an error
dotnet_diagnostic.TPRUMB0001.severity = error
# Or demote to a suggestion
dotnet_diagnostic.TPRUMB0001.severity = suggestiondotnet build
dotnet test
dotnet pack --configuration ReleaseMIT