Skip to content

Commit

Permalink
[Docs] order: update the description of the `pathGroupsExcludedImpo…
Browse files Browse the repository at this point in the history
…rtTypes` option
  • Loading branch information
liby authored and ljharb committed Sep 28, 2021
1 parent 4bdf61a commit 6407c1c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 24 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ This change log adheres to standards from [Keep a CHANGELOG](https://keepachange
- [actions] migrate OSX tests to GHA ([ljharb#37], thanks [@aks-])
- [Refactor] `exportMapBuilder`: avoid hoisting ([#2989], thanks [@soryy708])
- [Refactor] `ExportMap`: extract "builder" logic to separate files ([#2991], thanks [@soryy708])
- [Docs] [`order`]: update the description of the `pathGroupsExcludedImportTypes` option ([#3036], thanks [@liby])

## [2.29.1] - 2023-12-14

Expand Down Expand Up @@ -1122,6 +1123,7 @@ for info on changes for earlier releases.

[`memo-parser`]: ./memo-parser/README.md

[#3036]: https://github.com/import-js/eslint-plugin-import/pull/3036
[#3033]: https://github.com/import-js/eslint-plugin-import/pull/3033
[#3012]: https://github.com/import-js/eslint-plugin-import/pull/3012
[#3011]: https://github.com/import-js/eslint-plugin-import/pull/3011
Expand Down
26 changes: 2 additions & 24 deletions docs/rules/order.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ Example:
### `pathGroupsExcludedImportTypes: [array]`

This defines import types that are not handled by configured pathGroups.
This is mostly needed when you want to handle path groups that look like external imports.
If you have added path groups with patterns that look like `"builtin"` or `"external"` imports, you have to remove this group (`"builtin"` and/or `"external"`) from the default exclusion list (e.g., `["builtin", "external", "object"]`, etc) to sort these path groups correctly.

Example:

Expand All @@ -212,29 +212,7 @@ Example:
}
```

You can also use `patterns`(e.g., `react`, `react-router-dom`, etc).

Example:

```json
{
"import/order": [
"error",
{
"pathGroups": [
{
"pattern": "react",
"group": "builtin",
"position": "before"
}
],
"pathGroupsExcludedImportTypes": ["react"]
}
]
}
```

The default value is `["builtin", "external", "object"]`.
[Import Type](https://github.com/import-js/eslint-plugin-import/blob/HEAD/src/core/importType.js#L90) is resolved as a fixed string in predefined set, it can't be a `patterns`(e.g., `react`, `react-router-dom`, etc). See [#2156] for details.

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

Expand Down

0 comments on commit 6407c1c

Please sign in to comment.