Skip to content

Commit b236748

Browse files
libyljharb
authored andcommittedJul 22, 2021
[Docs] order: improve the documentation for the pathGroupsExcludedImportTypes option
1 parent bfab4cc commit b236748

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed
 

‎CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ This change log adheres to standards from [Keep a CHANGELOG](http://keepachangel
1515
### Changed
1616
- [Docs] `extensions`: removed incorrect cases ([#2138], thanks [@wenfangdu])
1717
- [Tests] `order`: add tests for `pathGroupsExcludedImportTypes: ['type']` ([#2158], thanks [@atav32])
18+
- [Docs] `order`: improve the documentation for the `pathGroupsExcludedImportTypes` option ([#2156], thanks [@liby])
1819

1920
## [2.23.4] - 2021-05-29
2021

@@ -812,6 +813,7 @@ for info on changes for earlier releases.
812813

813814
[#2160]: https://github.com/benmosher/eslint-plugin-import/pull/2160
814815
[#2158]: https://github.com/benmosher/eslint-plugin-import/pull/2158
816+
[#2156]: https://github.com/benmosher/eslint-plugin-import/pull/2156
815817
[#2138]: https://github.com/benmosher/eslint-plugin-import/pull/2138
816818
[#2121]: https://github.com/benmosher/eslint-plugin-import/pull/2121
817819
[#2099]: https://github.com/benmosher/eslint-plugin-import/pull/2099
@@ -1347,6 +1349,7 @@ for info on changes for earlier releases.
13471349
[@lencioni]: https://github.com/lencioni
13481350
[@leonardodino]: https://github.com/leonardodino
13491351
[@Librazy]: https://github.com/Librazy
1352+
[@liby]: https://github.com/liby
13501353
[@lilling]: https://github.com/lilling
13511354
[@ljharb]: https://github.com/ljharb
13521355
[@ljqx]: https://github.com/ljqx

‎docs/rules/order.md

+21
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,27 @@ Example:
148148
}]
149149
}
150150
```
151+
152+
You can also use `patterns`(e.g., `react`, `react-router-dom`, etc).
153+
154+
Example:
155+
```json
156+
{
157+
"import/order": [
158+
"error",
159+
{
160+
"pathGroups": [
161+
{
162+
"pattern": "react",
163+
"group": "builtin",
164+
"position": "before"
165+
}
166+
],
167+
"pathGroupsExcludedImportTypes": ["react"]
168+
}
169+
]
170+
}
171+
```
151172
The default value is `["builtin", "external"]`.
152173

153174
### `newlines-between: [ignore|always|always-and-inside-groups|never]`:

0 commit comments

Comments
 (0)
Please sign in to comment.