validateOrderInObjectKeys

Validates the order in object keys.

Types: Boolean or String

Values:

  • true (alias to asc)
  • "asc": requires sorting in ascending order
  • "asc-insensitive": requires sorting in ascending order (case-insensitive)
  • "asc-natural": requires sorting in ascending natural order
  • "desc": requires sorting in descending order
  • "desc-insensitive": requires sorting in descending order (case-insensitive)
  • "desc-natural": requires sorting in descending natural order

Example

"validateOrderInObjectKeys": "asc"
Valid
var x = {
 x: 'foo',
 y: 'bar'
}
Invalid
var x = {
 y: 'foo',
 x: 'bar'
}
Rule source
Test source