Skip to main content

values-in-order

Overview

This rule belongs to the custom-rules-linting ruleset and states that:

The target values being validated must be orded in an ascending or descending order depending upon the chosen scheme.

PropertyValue
EnabledYes
Maximum SeverityError
MessageValues are out of order.
CodeCUSTOMRULES_L003
TypeLinting
Rule SystemSemantic
Broad CategoryCustom Rules
Tagscustom rules semantic linting order ascending descending

Suggested Fixes

  • If you are validating a list of string values, ensure that the list items are arranged in an alphabetical order for ascending order cases.
  • If you are validating a list of numeric values, ensure that the list items are arranged in an increasing order for ascending cases and decreasing order for descending cases.
  • If you are validating an object, ensure that the object keys are arranged in an alphabetical order for ascending order cases.
  • Ensure that you have configured the rule sorting scheme correctly i.e. the Ascending argument is set as false if the target values are expected to be ordered in a descending manner.

For More Information