Open Bouke opened 2 weeks ago
2.0.176
MA0115
net8.0
C# 12
When a component has a Parameter specifying CaptureUnmatchedValues, MA0115 should no longer apply for that component.
Parameter
CaptureUnmatchedValues
Minimal code:
<Foo Bar="1" />
@* Foo.razor *@ @code { [Parameter(CaptureUnmatchedValues = true)] public IReadOnlyDictionary<string, object>? AdditionalAttributes { get; set; } }
Produces:
Components_Pages_Home_razor.g.cs(100,13): Warning MA0115 : The parameter 'Bar' does not exist on component 'BlazorComponentLifecycle2.Components.Foo'. Available parameters: AdditionalAttributes. (https://github.com/meziantou/Meziantou.Analyzer/blob/main/docs/Rules/MA0115.md)
Arbitrary attributes
By default the rule reports unmatched pascal case parameters. You can disable it by using the .editorconfig:
.editorconfig
MA0115.ReportPascalCaseUnmatchedParameter = false
Version of the Meziantou.Analyzer NuGet package
2.0.176
Rule Identifier
MA0115
Target Framework
net8.0
C# Language version
C# 12
Description
When a component has a
Parameter
specifyingCaptureUnmatchedValues
, MA0115 should no longer apply for that component.Reproduction Steps
Minimal code:
Produces:
Other information
Arbitrary attributes