Skip to content

Commit

Permalink
📝 docs(vuepress): add keys-order rule spec
Browse files Browse the repository at this point in the history
  • Loading branch information
kazupon committed Mar 26, 2019
1 parent 767cb34 commit df3cf08
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions docs/rules/keys-order.md
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.

0 comments on commit df3cf08

Please sign in to comment.