Skip to content

Latest commit

 

History

History
39 lines (29 loc) · 1013 Bytes

SA1203.md

File metadata and controls

39 lines (29 loc) · 1013 Bytes

SA1203

TypeName SA1203ConstantsMustAppearBeforeFields
CheckId SA1203
Category Ordering Rules

Cause

A constant field is placed beneath a non-constant field.

Rule description

A violation of this rule occurs when a constant field is placed beneath a non-constant field. Constants should be placed above fields to indicate that the two are fundamentally different types of elements with different considerations for the compiler, different naming requirements, etc.

How to fix violations

To fix an instance of this violation, place all constants above all fields.

How to suppress violations

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