Skip to content

Commit

Permalink
docs(eslint-plugin): [member-ordering] correct options type (#4568)
Browse files Browse the repository at this point in the history
  • Loading branch information
fiahfy committed Feb 17, 2022
1 parent b83f597 commit cc71766
Showing 1 changed file with 12 additions and 16 deletions.
28 changes: 12 additions & 16 deletions packages/eslint-plugin/docs/rules/member-ordering.md
Expand Up @@ -25,24 +25,20 @@ These options allow to specify how to group the members and sort their groups.
- Sort members within groups: Use `memberTypes` and `order`

```ts
type TypeOptions<T> =
| {
memberTypes: Array<T> | 'never',
order?: 'alphabetically' | 'alphabetically-case-insensitive' | 'as-written',
}
| {
order: 'alphabetically' | 'alphabetically-case-insensitive' | 'as-written',
};

{
default?: TypeOptions<MemberTypes>,
type SortedOrderConfig = {
memberTypes?: MemberType[] | 'never';
order: 'alphabetically' | 'alphabetically-case-insensitive' | 'as-written';
};

classes?: TypeOptions<MemberTypes>,
classExpressions?: TypeOptions<MemberTypes>,
type OrderConfig = MemberType[] | SortedOrderConfig | 'never';

interfaces?: TypeOptions<'signature' | 'field' | 'method' | 'constructor'>,
typeLiterals?: TypeOptions<'signature' | 'field' | 'method' | 'constructor'>,
}
type Options = {
default?: OrderConfig;
classes?: OrderConfig;
classExpressions?: OrderConfig;
interfaces?: OrderConfig;
typeLiterals?: OrderConfig;
};
```

See below for the possible definitions of `MemberType`.
Expand Down

0 comments on commit cc71766

Please sign in to comment.