-
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
📝 docs(vuepress): add keys-order rule spec
- Loading branch information
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# vue-i18n/keys-order | ||
|
||
> enforce order of localization keys | ||
- :black_nib: The `--fix` option on the [command line](https://eslint.org/docs/user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule. | ||
|
||
This rule aims to enforce ordering of localization keys. | ||
|
||
This rule is useful to provide browsability of localization keys. | ||
|
||
## :book: Rule Details | ||
|
||
:-1: Examples of **incorrect** code for this rule: | ||
|
||
```json | ||
// ✗ BAD | ||
{ | ||
"message3": "hi!", | ||
"message2": "hey!", | ||
"message1": "hello!" | ||
} | ||
``` | ||
|
||
|
||
:+1: Examples of **correct** code for this rule: | ||
|
||
```json | ||
// ✓ GOOD | ||
{ | ||
"message1": "hello!", | ||
"message2": "hey!", | ||
"message3": "hi!" | ||
} | ||
``` | ||
|
||
## Options | ||
|
||
```json | ||
{ | ||
"vue-i18n/keys-order": ["error", { | ||
"order": "desc" | ||
}] | ||
} | ||
``` | ||
|
||
- `order`: Case-sensitive sort order of localization keys. Possible values: `asc|desc`. If you don't set any options, it set to `asc` as default. |