diff --git a/CHANGELOG.md b/CHANGELOG.md index 667d9fffb..775247301 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 @@ -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 diff --git a/docs/rules/order.md b/docs/rules/order.md index 24692f2d2..67849bb7e 100644 --- a/docs/rules/order.md +++ b/docs/rules/order.md @@ -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: @@ -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]`