Skip to content

Commit

Permalink
docs: added documentation for new options: alphabetize.caseInsensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
dbrewer5 committed Dec 27, 2019
1 parent 5f0d3aa commit 2dc4100
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docs/rules/order.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,16 +189,18 @@ import index from './';
import sibling from './foo';
```

### `alphabetize: {order: asc|desc|ignore}`:
### `alphabetize: {order: asc|desc|ignore, caseInsensitive: true|false}`:

Sort the order within each group in alphabetical manner based on **import path**:

- `order`: use `asc` to sort in ascending order, and `desc` to sort in descending order (default: `ignore`).
- `caseInsensitive`: use `true` to ignore case, and `false` to consider case (default: `false`).

Example setting:
```js
alphabetize: {
order: 'asc', /* sort in ascending order. Options: ['ignore', 'asc', 'desc'] */
caseInsensitive: true /* ignore case. Options: [true, false] */
}
```

Expand All @@ -210,12 +212,14 @@ import React, { PureComponent } from 'react';
import aTypes from 'prop-types';
import { compose, apply } from 'xcompose';
import * as classnames from 'classnames';
import blist from 'BList';
```

While this will pass:

```js
/* eslint import/order: ["error", {"alphabetize": true}] */
import blist from 'BList';
import * as classnames from 'classnames';
import aTypes from 'prop-types';
import React, { PureComponent } from 'react';
Expand Down

0 comments on commit 2dc4100

Please sign in to comment.