NTComponents.Analyzers
2.0.0-preview.80
See the version list below for details.
dotnet add package NTComponents.Analyzers --version 2.0.0-preview.80
NuGet\Install-Package NTComponents.Analyzers -Version 2.0.0-preview.80
<PackageReference Include="NTComponents.Analyzers" Version="2.0.0-preview.80"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
<PackageVersion Include="NTComponents.Analyzers" Version="2.0.0-preview.80" />
<PackageReference Include="NTComponents.Analyzers"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add NTComponents.Analyzers --version 2.0.0-preview.80
#r "nuget: NTComponents.Analyzers, 2.0.0-preview.80"
#:package NTComponents.Analyzers@2.0.0-preview.80
#addin nuget:?package=NTComponents.Analyzers&version=2.0.0-preview.80&prerelease
#tool nuget:?package=NTComponents.Analyzers&version=2.0.0-preview.80&prerelease
NTComponents.Analyzers
Roslyn analyzers for NTComponents applications. The package reports invalid component configurations, inaccessible icon-only controls, conflicting data-grid options, and other mistakes that NTComponents can identify at build time.
Install
<PackageReference Include="NTComponents.Analyzers" Version="VERSION">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Diagnostics use the NTC prefix and run during IDE analysis and builds. They check NT component parameters written in Razor markup or hand-written RenderTreeBuilder code, and point at the .razor line when Razor maps one.
- Warnings predict a runtime exception or broken rendering, such as an empty required label, a background that does not match the variant, or a component rendered outside the parent it needs.
- Accessibility rules report controls that would render without an accessible name.
- Info suggestions report values a component ignores or adjusts, such as a parameter that only applies in another mode.
The analyzers only report what they can prove from constant values; anything computed at runtime is left alone. See RULES.md for every rule, and tune one with dotnet_diagnostic.NTC1003.severity or a category with dotnet_analyzer_diagnostic.category-Accessibility.severity in .editorconfig.
Color Migration
NTC1077 migrates TnTColor references to NTColor; NTC1079 migrates ToCssTnTColorVariable() calls to ToCssNTColorVariable(). Both diagnostics provide code fixes and Fix All support. The package includes NTComponents.Analyzers.CodeFixes.dll alongside the analyzer.
After updating NTComponents, analyze and apply supported C# fixes from your application directory:
dotnet format analyzers --diagnostics NTC1077 NTC1079 --severity warn
Pass a project or solution path after analyzers when needed. The CLI covers C# and .razor.cs files; update .razor expressions through your editor. NTC1078 reports removed None, Black, and White values for manual replacement. Use an omitted/null optional color for defaults or choose a semantic role; those members have no safe automatic replacement.
Fix All converts color references throughout the selected C# scope. Legacy TnT components and obsolete NTInputSelect still accept TnTColor; retain their legacy arguments or use ToLegacyColor() for migrated shared colors, and review mixed NT/TnT bindings after applying fixes.
Source and issue tracking: https://github.com/Notallthatevil/NTComponents
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.