From f1ae2d69d0a8eb8e31f5b1720924c67b66e48c6b Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sun, 1 Sep 2024 03:56:10 +0200 Subject: [PATCH] [Docs] describe the new options --- docs/rules/order.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/rules/order.md b/docs/rules/order.md index fc4bc2910..3172d2e26 100644 --- a/docs/rules/order.md +++ b/docs/rules/order.md @@ -285,14 +285,23 @@ import index from './'; import sibling from './foo'; ``` -### `named: true|false` +### `named: true|false|{enabled: true|false, import: true|false, export: true|false, require: true|false, groups: [array]}` Enforce ordering of names within imports: - If set to `true`, named imports must be ordered according to the `alphabetize` options - If set to `false`, named imports can occur in any order -The default value is `false` +`import`, `export` and `require` allows forcing ordering of named `import`s/`export`s for the corresponding kind of expression. +Use `enabled` to force ordering all of the aforementioned groups. + +The `groups` option allows to specify the order of the following kind of named `import`/`export` expressions: + + - `value`: Importing/exporting ordinary values + - `default`: Exporting the `default` member in an expression like `export { default as Console } from './my-awesome-console.js'` + - `type`: Explicitly importing or exporting types: `import { type Readline } from 'node:readline'` + +The default value is `false` and the default `groups`-option is `['default']`. Example setting: