Skip to content

Commit

Permalink
Docs: Update sort-keys doc to define natural ordering (fixes #9043) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
karansharma27 authored and not-an-aardvark committed Aug 1, 2017
1 parent 7ecfe6a commit 50e3cf3
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion docs/rules/sort-keys.md
Expand Up @@ -70,7 +70,23 @@ The 1st option is `"asc"` or `"desc"`.
The 2nd option is an object which has 2 properties.

* `caseSensitive` - if `true`, enforce properties to be in case-sensitive order. Default is `true`.
* `natural` - if `true`, enforce properties to be in natural order. Default is `false`.
* `natural` - if `true`, enforce properties to be in natural order. Default is `false`. Natural Order compares strings containing combination of letters and numbers in the way a human being would sort. It basically sorts numerically, instead of sorting alphabetically. So the number 10 comes after the number 3 in Natural Sorting.

Example for a list:

With `natural` as true, the ordering would be
1
3
6
8
10

With `natural` as false, the ordering would be
1
10
3
6
8

### desc

Expand Down

0 comments on commit 50e3cf3

Please sign in to comment.