|
1 | 1 | import { TSESTree } from '@typescript-eslint/types'
|
2 | 2 |
|
3 | 3 | import type { SortingNodeWithDependencies } from '../utils/sort-nodes-by-dependencies'
|
| 4 | +import type { Options } from './sort-objects/types' |
4 | 5 |
|
5 | 6 | import {
|
6 | 7 | buildUseConfigurationIfJsonSchema,
|
@@ -47,52 +48,13 @@ import { complete } from '../utils/complete'
|
47 | 48 | import { pairwise } from '../utils/pairwise'
|
48 | 49 | import { matches } from '../utils/matches'
|
49 | 50 |
|
50 |
| -type Options = Partial<{ |
51 |
| - partitionByComment: |
52 |
| - | { |
53 |
| - block?: string[] | boolean | string |
54 |
| - line?: string[] | boolean | string |
55 |
| - } |
56 |
| - | string[] |
57 |
| - | boolean |
58 |
| - | string |
59 |
| - useConfigurationIf: { |
60 |
| - callingFunctionNamePattern?: string |
61 |
| - allNamesMatchPattern?: string |
62 |
| - } |
63 |
| - groups: ( |
64 |
| - | { newlinesBetween: 'ignore' | 'always' | 'never' } |
65 |
| - | Group[] |
66 |
| - | Group |
67 |
| - )[] |
68 |
| - type: 'alphabetical' | 'line-length' | 'unsorted' | 'natural' | 'custom' |
69 |
| - destructuredObjects: { groups: boolean } | boolean |
70 |
| - customGroups: Record<string, string[] | string> |
71 |
| - newlinesBetween: 'ignore' | 'always' | 'never' |
72 |
| - specialCharacters: 'remove' | 'trim' | 'keep' |
73 |
| - locales: NonNullable<Intl.LocalesArgument> |
74 |
| - partitionByNewLine: boolean |
75 |
| - objectDeclarations: boolean |
76 |
| - styledComponents: boolean |
77 |
| - /** |
78 |
| - * @deprecated for {@link `destructuredObjects`} and {@link `objectDeclarations`} |
79 |
| - */ |
80 |
| - destructureOnly: boolean |
81 |
| - ignorePattern: string[] |
82 |
| - order: 'desc' | 'asc' |
83 |
| - ignoreCase: boolean |
84 |
| - alphabet: string |
85 |
| -}>[] |
86 |
| - |
87 | 51 | type MESSAGE_ID =
|
88 | 52 | | 'missedSpacingBetweenObjectMembers'
|
89 | 53 | | 'unexpectedObjectsDependencyOrder'
|
90 | 54 | | 'extraSpacingBetweenObjectMembers'
|
91 | 55 | | 'unexpectedObjectsGroupOrder'
|
92 | 56 | | 'unexpectedObjectsOrder'
|
93 | 57 |
|
94 |
| -type Group = 'multiline' | 'unknown' | 'method' | string |
95 |
| - |
96 | 58 | let defaultOptions: Required<Options[0]> = {
|
97 | 59 | partitionByNewLine: false,
|
98 | 60 | partitionByComment: false,
|
|
0 commit comments