Skip to content

Commit cc71766

Browse files
authored
docs(eslint-plugin): [member-ordering] correct options type (typescript-eslint#4568)
1 parent b83f597 commit cc71766

File tree

1 file changed

+12
-16
lines changed

1 file changed

+12
-16
lines changed

packages/eslint-plugin/docs/rules/member-ordering.md

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,20 @@ These options allow to specify how to group the members and sort their groups.
2525
- Sort members within groups: Use `memberTypes` and `order`
2626

2727
```ts
28-
type TypeOptions<T> =
29-
| {
30-
memberTypes: Array<T> | 'never',
31-
order?: 'alphabetically' | 'alphabetically-case-insensitive' | 'as-written',
32-
}
33-
| {
34-
order: 'alphabetically' | 'alphabetically-case-insensitive' | 'as-written',
35-
};
36-
37-
{
38-
default?: TypeOptions<MemberTypes>,
28+
type SortedOrderConfig = {
29+
memberTypes?: MemberType[] | 'never';
30+
order: 'alphabetically' | 'alphabetically-case-insensitive' | 'as-written';
31+
};
3932

40-
classes?: TypeOptions<MemberTypes>,
41-
classExpressions?: TypeOptions<MemberTypes>,
33+
type OrderConfig = MemberType[] | SortedOrderConfig | 'never';
4234

43-
interfaces?: TypeOptions<'signature' | 'field' | 'method' | 'constructor'>,
44-
typeLiterals?: TypeOptions<'signature' | 'field' | 'method' | 'constructor'>,
45-
}
35+
type Options = {
36+
default?: OrderConfig;
37+
classes?: OrderConfig;
38+
classExpressions?: OrderConfig;
39+
interfaces?: OrderConfig;
40+
typeLiterals?: OrderConfig;
41+
};
4642
```
4743

4844
See below for the possible definitions of `MemberType`.

0 commit comments

Comments
 (0)