Skip to content

Latest commit

 

History

History
42 lines (31 loc) · 1.22 KB

SA1215.md

File metadata and controls

42 lines (31 loc) · 1.22 KB

SA1215

TypeName SA1215InstanceReadonlyElementsMustAppearBeforeInstanceNonReadonlyElements
CheckId SA1215
Category Ordering Rules

⚠️ This rule has been intentionally omitted from StyleCop Analyzers. See KnownChanges.md for additional information.

Cause

An instance readonly element is positioned beneath an instance non-readonly element of the same type.

Rule description

A violation of this rule occurs when an instance readonly element is positioned beneath an instance non-readonly element of the same type.

How to fix violations

To fix an instance of this violation, place all instance readonly elements above all instance non-readonly elements of the same type.

How to suppress violations

[SuppressMessage("StyleCop.CSharp.OrderingRules", "SA1215:InstanceReadonlyElementsMustAppearBeforeInstanceNonReadonlyElements", Justification = "Reviewed.")]
#pragma warning disable SA1215 // InstanceReadonlyElementsMustAppearBeforeInstanceNonReadonlyElements
#pragma warning restore SA1215 // InstanceReadonlyElementsMustAppearBeforeInstanceNonReadonlyElements