Skip to content

Commit

Permalink
feat(sort-variable-declarations): adds tests and documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
hugop95 committed Feb 5, 2025
1 parent b46a433 commit cf06c40
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions docs/content/rules/sort-variable-declarations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,27 @@ Determines whether the sorted items should be in ascending or descending order.
- `'asc'` — Sort items in ascending order (A to Z, 1 to 9).
- `'desc'` — Sort items in descending order (Z to A, 9 to 1).

### fallbackSort

<sub>
type: `{ type: string; order?: 'asc' | 'desc' }[]`
</sub>
<sub>default: `[]`</sub>

Defines a list of fallback sort options to use when comparing two elements that are equal according to the primary sort
[`type`](#type).

Example: enforce alphabetical sort between two elements with the same length.
```ts
{
type: 'line-length',
order: 'desc'
fallbackSort: [
{ type: 'alphabetical', order: 'asc' }
]
}
```

### alphabet

<sub>default: `''`</sub>
Expand Down

0 comments on commit cf06c40

Please sign in to comment.