Skip to content

Commit df3cf08

Browse files
committed
📝 docs(vuepress): add keys-order rule spec
1 parent 767cb34 commit df3cf08

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

docs/rules/keys-order.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# vue-i18n/keys-order
2+
3+
> enforce order of localization keys
4+
5+
- :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.
6+
7+
This rule aims to enforce ordering of localization keys.
8+
9+
This rule is useful to provide browsability of localization keys.
10+
11+
## :book: Rule Details
12+
13+
:-1: Examples of **incorrect** code for this rule:
14+
15+
```json
16+
// ✗ BAD
17+
{
18+
"message3": "hi!",
19+
"message2": "hey!",
20+
"message1": "hello!"
21+
}
22+
```
23+
24+
25+
:+1: Examples of **correct** code for this rule:
26+
27+
```json
28+
// ✓ GOOD
29+
{
30+
"message1": "hello!",
31+
"message2": "hey!",
32+
"message3": "hi!"
33+
}
34+
```
35+
36+
## Options
37+
38+
```json
39+
{
40+
"vue-i18n/keys-order": ["error", {
41+
"order": "desc"
42+
}]
43+
}
44+
```
45+
46+
- `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.

0 commit comments

Comments
 (0)