eslint-plugin-perfectionist 3.9.1 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/dist/index.d.ts +31 -684
  2. package/dist/index.js +10 -13
  3. package/dist/rules/sort-array-includes.js +145 -169
  4. package/dist/rules/sort-classes-utils.js +12 -120
  5. package/dist/rules/sort-classes.js +595 -559
  6. package/dist/rules/sort-classes.types.js +20 -19
  7. package/dist/rules/sort-decorators.js +231 -0
  8. package/dist/rules/sort-enums.js +219 -250
  9. package/dist/rules/sort-exports.js +118 -146
  10. package/dist/rules/sort-heritage-clauses.js +157 -0
  11. package/dist/rules/sort-imports.js +335 -341
  12. package/dist/rules/sort-interfaces.js +248 -286
  13. package/dist/rules/sort-intersection-types.js +165 -167
  14. package/dist/rules/sort-jsx-props.js +144 -177
  15. package/dist/rules/sort-maps.js +151 -172
  16. package/dist/rules/sort-modules-utils.js +72 -0
  17. package/dist/rules/sort-modules.js +554 -0
  18. package/dist/rules/{sort-classes.types.mjs → sort-modules.types.js} +33 -46
  19. package/dist/rules/sort-named-exports.js +145 -167
  20. package/dist/rules/sort-named-imports.js +156 -180
  21. package/dist/rules/sort-object-types.js +240 -273
  22. package/dist/rules/sort-objects.js +352 -355
  23. package/dist/rules/sort-sets.js +16 -23
  24. package/dist/rules/sort-switch-case.js +253 -235
  25. package/dist/rules/sort-union-types.js +165 -167
  26. package/dist/rules/sort-variable-declarations.js +222 -232
  27. package/dist/rules/validate-generated-groups-configuration.js +45 -0
  28. package/dist/utils/common-json-schemas.js +108 -0
  29. package/dist/utils/compare.js +25 -22
  30. package/dist/utils/complete.js +5 -2
  31. package/dist/utils/generate-predefined-groups.js +50 -0
  32. package/dist/utils/get-array-combinations.js +19 -0
  33. package/dist/utils/get-comment-after.js +1 -1
  34. package/dist/utils/get-comments-before.js +14 -1
  35. package/dist/utils/get-decorator-name.js +23 -0
  36. package/dist/utils/get-eslint-disabled-lines.js +54 -0
  37. package/dist/utils/get-eslint-disabled-rules.js +39 -0
  38. package/dist/utils/get-newlines-errors.js +35 -0
  39. package/dist/utils/get-node-range.js +11 -22
  40. package/dist/utils/get-options-with-clean-groups.js +2 -2
  41. package/dist/utils/get-settings.js +5 -5
  42. package/dist/utils/get-typescript-import.js +30 -0
  43. package/dist/utils/is-member-optional.js +1 -1
  44. package/dist/utils/is-node-eslint-disabled.js +5 -0
  45. package/dist/utils/is-partition-comment.js +16 -11
  46. package/dist/utils/{is-positive.js → is-sortable.js} +2 -2
  47. package/dist/utils/make-comment-after-fixes.js +26 -0
  48. package/dist/utils/make-fixes.js +45 -34
  49. package/dist/utils/make-newlines-fixes.js +88 -0
  50. package/dist/utils/matches.js +1 -12
  51. package/dist/utils/pairwise.js +9 -7
  52. package/dist/utils/range-to-diff.js +6 -3
  53. package/dist/utils/read-closest-ts-config-by-path.js +110 -0
  54. package/dist/utils/sort-nodes-by-dependencies.js +18 -11
  55. package/dist/utils/sort-nodes-by-groups.js +10 -6
  56. package/dist/utils/sort-nodes.js +21 -2
  57. package/dist/utils/to-single-line.js +1 -1
  58. package/dist/utils/use-groups.js +6 -11
  59. package/dist/utils/validate-groups-configuration.js +2 -2
  60. package/dist/utils/validate-newlines-and-partition-configuration.js +14 -0
  61. package/package.json +20 -42
  62. package/readme.md +26 -26
  63. package/dist/index.mjs +0 -96
  64. package/dist/rules/sort-array-includes.mjs +0 -211
  65. package/dist/rules/sort-astro-attributes.js +0 -209
  66. package/dist/rules/sort-astro-attributes.mjs +0 -199
  67. package/dist/rules/sort-classes-utils.mjs +0 -218
  68. package/dist/rules/sort-classes.mjs +0 -614
  69. package/dist/rules/sort-enums.mjs +0 -278
  70. package/dist/rules/sort-exports.mjs +0 -190
  71. package/dist/rules/sort-imports.mjs +0 -589
  72. package/dist/rules/sort-interfaces.mjs +0 -309
  73. package/dist/rules/sort-intersection-types.mjs +0 -269
  74. package/dist/rules/sort-jsx-props.mjs +0 -206
  75. package/dist/rules/sort-maps.mjs +0 -198
  76. package/dist/rules/sort-named-exports.mjs +0 -188
  77. package/dist/rules/sort-named-imports.mjs +0 -203
  78. package/dist/rules/sort-object-types.mjs +0 -298
  79. package/dist/rules/sort-objects.mjs +0 -417
  80. package/dist/rules/sort-sets.mjs +0 -49
  81. package/dist/rules/sort-svelte-attributes.js +0 -214
  82. package/dist/rules/sort-svelte-attributes.mjs +0 -204
  83. package/dist/rules/sort-switch-case.mjs +0 -246
  84. package/dist/rules/sort-union-types.mjs +0 -269
  85. package/dist/rules/sort-variable-declarations.mjs +0 -253
  86. package/dist/rules/sort-vue-attributes.js +0 -214
  87. package/dist/rules/sort-vue-attributes.mjs +0 -204
  88. package/dist/utils/compare.mjs +0 -68
  89. package/dist/utils/complete.mjs +0 -3
  90. package/dist/utils/create-eslint-rule.mjs +0 -5
  91. package/dist/utils/get-comment-after.mjs +0 -16
  92. package/dist/utils/get-comments-before.mjs +0 -10
  93. package/dist/utils/get-group-number.mjs +0 -15
  94. package/dist/utils/get-lines-between.mjs +0 -8
  95. package/dist/utils/get-node-parent.mjs +0 -12
  96. package/dist/utils/get-node-range.mjs +0 -67
  97. package/dist/utils/get-options-with-clean-groups.mjs +0 -11
  98. package/dist/utils/get-settings.mjs +0 -27
  99. package/dist/utils/get-source-code.mjs +0 -5
  100. package/dist/utils/is-member-optional.mjs +0 -10
  101. package/dist/utils/is-partition-comment.mjs +0 -14
  102. package/dist/utils/is-positive.mjs +0 -2
  103. package/dist/utils/make-fixes.mjs +0 -38
  104. package/dist/utils/matches.mjs +0 -13
  105. package/dist/utils/pairwise.mjs +0 -12
  106. package/dist/utils/range-to-diff.mjs +0 -5
  107. package/dist/utils/sort-nodes-by-dependencies.mjs +0 -43
  108. package/dist/utils/sort-nodes-by-groups.mjs +0 -46
  109. package/dist/utils/sort-nodes.mjs +0 -4
  110. package/dist/utils/to-single-line.mjs +0 -2
  111. package/dist/utils/use-groups.mjs +0 -31
  112. package/dist/utils/validate-groups-configuration.mjs +0 -27
package/dist/index.d.ts CHANGED
@@ -1,694 +1,41 @@
1
- import { ClassicConfig } from '@typescript-eslint/utils/ts-eslint'
2
- import { FlatConfig } from '@typescript-eslint/utils/ts-eslint'
3
- import { RuleListener } from '@typescript-eslint/utils/ts-eslint'
4
- import { RuleModule } from '@typescript-eslint/utils/ts-eslint'
1
+ import { Linter } from 'eslint'
2
+ import { Rule } from 'eslint'
5
3
 
6
- declare type AbstractModifier = 'abstract'
4
+ declare const _default: PluginConfig
7
5
 
8
- declare type AccessorPropertyGroup =
9
- `${PublicOrProtectedOrPrivateModifierPrefix}${StaticOrAbstractModifierPrefix}${OverrideModifierPrefix}${DecoratedModifierPrefix}${AccessorPropertySelector}`
10
-
11
- declare type AccessorPropertySelector = 'accessor-property'
12
-
13
- declare type AdvancedSingleCustomGroup<T extends Selector> = {
14
- decoratorNamePattern?: string
15
- elementValuePattern?: string
16
- elementNamePattern?: string
17
- } & BaseSingleCustomGroup<T>
18
-
19
- /**
20
- * Only used in code as well
21
- */
22
- declare interface AllowedModifiersPerSelector {
23
- property:
24
- | PublicOrProtectedOrPrivateModifier
25
- | DecoratedModifier
26
- | AbstractModifier
27
- | OverrideModifier
28
- | ReadonlyModifier
29
- | OptionalModifier
30
- | DeclareModifier
31
- | StaticModifier
32
- method:
33
- | PublicOrProtectedOrPrivateModifier
34
- | DecoratedModifier
35
- | AbstractModifier
36
- | OverrideModifier
37
- | OptionalModifier
38
- | StaticModifier
39
- 'accessor-property':
40
- | PublicOrProtectedOrPrivateModifier
41
- | DecoratedModifier
42
- | AbstractModifier
43
- | OverrideModifier
44
- | StaticModifier
45
- 'function-property':
46
- | PublicOrProtectedOrPrivateModifier
47
- | DecoratedModifier
48
- | OverrideModifier
49
- | ReadonlyModifier
50
- | StaticModifier
51
- 'set-method':
52
- | PublicOrProtectedOrPrivateModifier
53
- | DecoratedModifier
54
- | AbstractModifier
55
- | OverrideModifier
56
- | StaticModifier
57
- 'get-method': AllowedModifiersPerSelector['set-method']
58
- 'index-signature': ReadonlyModifier | StaticModifier
59
- constructor: PublicOrProtectedOrPrivateModifier
60
- 'static-block': never
61
- }
62
-
63
- declare interface BaseSingleCustomGroup<T extends Selector> {
64
- modifiers?: AllowedModifiersPerSelector[T][]
65
- selector?: T
66
- }
67
-
68
- declare type ConstructorGroup =
69
- `${PublicOrProtectedOrPrivateModifierPrefix}${ConstructorSelector}`
70
-
71
- declare type ConstructorSelector = 'constructor'
72
-
73
- declare type CustomGroup = (
74
- | {
75
- order?: SortClassesOptions[0]['order']
76
- type?: SortClassesOptions[0]['type']
77
- }
78
- | {
79
- type?: 'unsorted'
80
- }
81
- ) &
82
- (SingleCustomGroup | CustomGroupBlock) & {
83
- groupName: string
6
+ declare interface PluginConfig {
7
+ rules: {
8
+ 'sort-variable-declarations': Rule.RuleModule
9
+ 'sort-intersection-types': Rule.RuleModule
10
+ 'sort-heritage-clauses': Rule.RuleModule
11
+ 'sort-array-includes': Rule.RuleModule
12
+ 'sort-named-imports': Rule.RuleModule
13
+ 'sort-named-exports': Rule.RuleModule
14
+ 'sort-object-types': Rule.RuleModule
15
+ 'sort-union-types': Rule.RuleModule
16
+ 'sort-switch-case': Rule.RuleModule
17
+ 'sort-interfaces': Rule.RuleModule
18
+ 'sort-decorators': Rule.RuleModule
19
+ 'sort-jsx-props': Rule.RuleModule
20
+ 'sort-modules': Rule.RuleModule
21
+ 'sort-classes': Rule.RuleModule
22
+ 'sort-imports': Rule.RuleModule
23
+ 'sort-exports': Rule.RuleModule
24
+ 'sort-objects': Rule.RuleModule
25
+ 'sort-enums': Rule.RuleModule
26
+ 'sort-sets': Rule.RuleModule
27
+ 'sort-maps': Rule.RuleModule
84
28
  }
85
-
86
- declare interface CustomGroupBlock {
87
- anyOf: SingleCustomGroup[]
88
- }
89
-
90
- declare type DeclareModifier = 'declare'
91
-
92
- declare type DeclareModifierPrefix = WithDashSuffixOrEmpty<DeclareModifier>
93
-
94
- declare type DeclarePropertyGroup =
95
- `${DeclareModifierPrefix}${PublicOrProtectedOrPrivateModifierPrefix}${StaticOrAbstractModifierPrefix}${ReadonlyModifierPrefix}${OptionalModifierPrefix}${PropertySelector}`
96
-
97
- declare type DecoratedModifier = 'decorated'
98
-
99
- declare type DecoratedModifierPrefix = WithDashSuffixOrEmpty<DecoratedModifier>
100
-
101
- declare const _default: {
102
29
  configs: {
103
- 'recommended-alphabetical-legacy': ClassicConfig.Config
104
- 'recommended-line-length-legacy': ClassicConfig.Config
105
- 'recommended-natural-legacy': ClassicConfig.Config
106
- 'recommended-alphabetical': FlatConfig.Config
107
- 'recommended-line-length': FlatConfig.Config
108
- 'recommended-natural': FlatConfig.Config
109
- }
110
- rules: {
111
- 'sort-variable-declarations': RuleModule<
112
- | 'unexpectedVariableDeclarationsDependencyOrder'
113
- | 'unexpectedVariableDeclarationsOrder',
114
- [
115
- Partial<{
116
- type: 'alphabetical' | 'line-length' | 'natural'
117
- partitionByComment: string[] | boolean | string
118
- specialCharacters: 'remove' | 'trim' | 'keep'
119
- matcher: 'minimatch' | 'regex'
120
- partitionByNewLine: boolean
121
- order: 'desc' | 'asc'
122
- ignoreCase: boolean
123
- }>,
124
- ],
125
- unknown,
126
- RuleListener
127
- >
128
- 'sort-intersection-types': RuleModule<
129
- | 'unexpectedIntersectionTypesGroupOrder'
130
- | 'unexpectedIntersectionTypesOrder',
131
- [
132
- Partial<{
133
- type: 'alphabetical' | 'line-length' | 'natural'
134
- partitionByComment: string[] | boolean | string
135
- specialCharacters: 'remove' | 'trim' | 'keep'
136
- matcher: 'minimatch' | 'regex'
137
- groups: (
138
- | (
139
- | 'object'
140
- | 'function'
141
- | 'operator'
142
- | 'unknown'
143
- | 'intersection'
144
- | 'conditional'
145
- | 'keyword'
146
- | 'literal'
147
- | 'nullish'
148
- | 'import'
149
- | 'named'
150
- | 'tuple'
151
- | 'union'
152
- )[]
153
- | (
154
- | 'object'
155
- | 'function'
156
- | 'operator'
157
- | 'unknown'
158
- | 'intersection'
159
- | 'conditional'
160
- | 'keyword'
161
- | 'literal'
162
- | 'nullish'
163
- | 'import'
164
- | 'named'
165
- | 'tuple'
166
- | 'union'
167
- )
168
- )[]
169
- partitionByNewLine: boolean
170
- order: 'desc' | 'asc'
171
- ignoreCase: boolean
172
- }>,
173
- ],
174
- unknown,
175
- RuleListener
176
- >
177
- 'sort-svelte-attributes': RuleModule<
178
- | 'unexpectedSvelteAttributesGroupOrder'
179
- | 'unexpectedSvelteAttributesOrder',
180
- [
181
- Partial<{
182
- customGroups: {
183
- [x: string]: string | string[]
184
- }
185
- type: 'alphabetical' | 'line-length' | 'natural'
186
- specialCharacters: 'remove' | 'trim' | 'keep'
187
- groups: (string | string[])[]
188
- matcher: 'minimatch' | 'regex'
189
- order: 'desc' | 'asc'
190
- ignoreCase: boolean
191
- }>,
192
- ],
193
- unknown,
194
- RuleListener
195
- >
196
- 'sort-astro-attributes': RuleModule<
197
- 'unexpectedAstroAttributesGroupOrder' | 'unexpectedAstroAttributesOrder',
198
- [
199
- Partial<{
200
- customGroups: {
201
- [x: string]: string | string[]
202
- }
203
- type: 'alphabetical' | 'line-length' | 'natural'
204
- specialCharacters: 'remove' | 'trim' | 'keep'
205
- groups: (string | string[])[]
206
- matcher: 'minimatch' | 'regex'
207
- order: 'desc' | 'asc'
208
- ignoreCase: boolean
209
- }>,
210
- ],
211
- unknown,
212
- RuleListener
213
- >
214
- 'sort-vue-attributes': RuleModule<
215
- 'unexpectedVueAttributesGroupOrder' | 'unexpectedVueAttributesOrder',
216
- [
217
- Partial<{
218
- customGroups: {
219
- [x: string]: string | string[]
220
- }
221
- type: 'alphabetical' | 'line-length' | 'natural'
222
- specialCharacters: 'remove' | 'trim' | 'keep'
223
- groups: (string | string[])[]
224
- matcher: 'minimatch' | 'regex'
225
- order: 'desc' | 'asc'
226
- ignoreCase: boolean
227
- }>,
228
- ],
229
- unknown,
230
- RuleListener
231
- >
232
- 'sort-array-includes': RuleModule<
233
- 'unexpectedArrayIncludesOrder',
234
- Options,
235
- unknown,
236
- RuleListener
237
- >
238
- 'sort-named-imports': RuleModule<
239
- 'unexpectedNamedImportsOrder',
240
- [
241
- Partial<{
242
- groupKind: 'values-first' | 'types-first' | 'mixed'
243
- type: 'alphabetical' | 'line-length' | 'natural'
244
- partitionByComment: string[] | boolean | string
245
- specialCharacters: 'remove' | 'trim' | 'keep'
246
- matcher: 'minimatch' | 'regex'
247
- partitionByNewLine: boolean
248
- order: 'desc' | 'asc'
249
- ignoreAlias: boolean
250
- ignoreCase: boolean
251
- }>,
252
- ],
253
- unknown,
254
- RuleListener
255
- >
256
- 'sort-named-exports': RuleModule<
257
- 'unexpectedNamedExportsOrder',
258
- [
259
- Partial<{
260
- groupKind: 'values-first' | 'types-first' | 'mixed'
261
- type: 'alphabetical' | 'line-length' | 'natural'
262
- partitionByComment: string[] | boolean | string
263
- specialCharacters: 'remove' | 'trim' | 'keep'
264
- matcher: 'minimatch' | 'regex'
265
- partitionByNewLine: boolean
266
- order: 'desc' | 'asc'
267
- ignoreCase: boolean
268
- }>,
269
- ],
270
- unknown,
271
- RuleListener
272
- >
273
- 'sort-object-types': RuleModule<
274
- 'unexpectedObjectTypesGroupOrder' | 'unexpectedObjectTypesOrder',
275
- [
276
- Partial<{
277
- groupKind: 'required-first' | 'optional-first' | 'mixed'
278
- customGroups: {
279
- [x: string]: string | string[]
280
- }
281
- type: 'alphabetical' | 'line-length' | 'natural'
282
- partitionByComment: string[] | boolean | string
283
- specialCharacters: 'remove' | 'trim' | 'keep'
284
- groups: (string | string[])[]
285
- matcher: 'minimatch' | 'regex'
286
- partitionByNewLine: boolean
287
- order: 'desc' | 'asc'
288
- ignoreCase: boolean
289
- }>,
290
- ],
291
- unknown,
292
- RuleListener
293
- >
294
- 'sort-union-types': RuleModule<
295
- 'unexpectedUnionTypesGroupOrder' | 'unexpectedUnionTypesOrder',
296
- [
297
- Partial<{
298
- type: 'alphabetical' | 'line-length' | 'natural'
299
- partitionByComment: string[] | boolean | string
300
- specialCharacters: 'remove' | 'trim' | 'keep'
301
- matcher: 'minimatch' | 'regex'
302
- groups: (
303
- | (
304
- | 'object'
305
- | 'function'
306
- | 'operator'
307
- | 'unknown'
308
- | 'intersection'
309
- | 'conditional'
310
- | 'keyword'
311
- | 'literal'
312
- | 'nullish'
313
- | 'import'
314
- | 'named'
315
- | 'tuple'
316
- | 'union'
317
- )[]
318
- | (
319
- | 'object'
320
- | 'function'
321
- | 'operator'
322
- | 'unknown'
323
- | 'intersection'
324
- | 'conditional'
325
- | 'keyword'
326
- | 'literal'
327
- | 'nullish'
328
- | 'import'
329
- | 'named'
330
- | 'tuple'
331
- | 'union'
332
- )
333
- )[]
334
- partitionByNewLine: boolean
335
- order: 'desc' | 'asc'
336
- ignoreCase: boolean
337
- }>,
338
- ],
339
- unknown,
340
- RuleListener
341
- >
342
- 'sort-switch-case': RuleModule<
343
- 'unexpectedSwitchCaseOrder',
344
- [
345
- Partial<{
346
- type: 'alphabetical' | 'line-length' | 'natural'
347
- specialCharacters: 'remove' | 'trim' | 'keep'
348
- order: 'desc' | 'asc'
349
- ignoreCase: boolean
350
- }>,
351
- ],
352
- unknown,
353
- RuleListener
354
- >
355
- 'sort-interfaces': RuleModule<
356
- | 'unexpectedInterfacePropertiesGroupOrder'
357
- | 'unexpectedInterfacePropertiesOrder',
358
- [
359
- Partial<{
360
- groupKind: 'optional-first' | 'required-first' | 'mixed'
361
- customGroups: {
362
- [key: string]: string[] | string
363
- }
364
- type: 'alphabetical' | 'line-length' | 'natural'
365
- partitionByComment: string[] | boolean | string
366
- specialCharacters: 'remove' | 'trim' | 'keep'
367
- groups: (string | string[])[]
368
- matcher: 'minimatch' | 'regex'
369
- partitionByNewLine: boolean
370
- ignorePattern: string[]
371
- order: 'desc' | 'asc'
372
- ignoreCase: boolean
373
- }>,
374
- ],
375
- unknown,
376
- RuleListener
377
- >
378
- 'sort-jsx-props': RuleModule<
379
- 'unexpectedJSXPropsGroupOrder' | 'unexpectedJSXPropsOrder',
380
- [
381
- Partial<{
382
- customGroups: {
383
- [x: string]: string | string[]
384
- }
385
- type: 'alphabetical' | 'line-length' | 'natural'
386
- specialCharacters: 'remove' | 'trim' | 'keep'
387
- groups: (string | string[])[]
388
- matcher: 'minimatch' | 'regex'
389
- ignorePattern: string[]
390
- order: 'desc' | 'asc'
391
- ignoreCase: boolean
392
- }>,
393
- ],
394
- unknown,
395
- RuleListener
396
- >
397
- 'sort-classes': RuleModule<
398
- | 'unexpectedClassesDependencyOrder'
399
- | 'unexpectedClassesGroupOrder'
400
- | 'unexpectedClassesOrder',
401
- SortClassesOptions,
402
- unknown,
403
- RuleListener
404
- >
405
- 'sort-imports': RuleModule<
406
- MESSAGE_ID,
407
- Options_2<string[]>,
408
- unknown,
409
- RuleListener
410
- >
411
- 'sort-exports': RuleModule<
412
- 'unexpectedExportsOrder',
413
- [
414
- Partial<{
415
- groupKind: 'values-first' | 'types-first' | 'mixed'
416
- type: 'alphabetical' | 'line-length' | 'natural'
417
- partitionByComment: string[] | boolean | string
418
- specialCharacters: 'remove' | 'trim' | 'keep'
419
- matcher: 'minimatch' | 'regex'
420
- partitionByNewLine: boolean
421
- order: 'desc' | 'asc'
422
- ignoreCase: boolean
423
- }>,
424
- ],
425
- unknown,
426
- RuleListener
427
- >
428
- 'sort-objects': RuleModule<
429
- | 'unexpectedObjectsDependencyOrder'
430
- | 'unexpectedObjectsGroupOrder'
431
- | 'unexpectedObjectsOrder',
432
- [
433
- Partial<{
434
- customGroups: {
435
- [key: string]: string[] | string
436
- }
437
- type: 'alphabetical' | 'line-length' | 'natural'
438
- partitionByComment: string[] | boolean | string
439
- specialCharacters: 'remove' | 'trim' | 'keep'
440
- matcher: 'minimatch' | 'regex'
441
- groups: (string[] | string)[]
442
- partitionByNewLine: boolean
443
- styledComponents: boolean
444
- destructureOnly: boolean
445
- ignorePattern: string[]
446
- order: 'desc' | 'asc'
447
- ignoreCase: boolean
448
- }>,
449
- ],
450
- unknown,
451
- RuleListener
452
- >
453
- 'sort-enums': RuleModule<
454
- 'unexpectedEnumsDependencyOrder' | 'unexpectedEnumsOrder',
455
- Options_3,
456
- unknown,
457
- RuleListener
458
- >
459
- 'sort-sets': RuleModule<
460
- 'unexpectedSetsOrder',
461
- Options,
462
- unknown,
463
- RuleListener
464
- >
465
- 'sort-maps': RuleModule<
466
- 'unexpectedMapElementsOrder',
467
- [
468
- Partial<{
469
- type: 'alphabetical' | 'line-length' | 'natural'
470
- partitionByComment: string[] | boolean | string
471
- specialCharacters: 'remove' | 'trim' | 'keep'
472
- matcher: 'minimatch' | 'regex'
473
- partitionByNewLine: boolean
474
- order: 'desc' | 'asc'
475
- ignoreCase: boolean
476
- }>,
477
- ],
478
- unknown,
479
- RuleListener
480
- >
30
+ 'recommended-alphabetical-legacy': Linter.LegacyConfig
31
+ 'recommended-line-length-legacy': Linter.LegacyConfig
32
+ 'recommended-natural-legacy': Linter.LegacyConfig
33
+ 'recommended-alphabetical': Linter.Config
34
+ 'recommended-line-length': Linter.Config
35
+ 'recommended-natural': Linter.Config
481
36
  }
482
37
  name: string
483
38
  }
484
39
 
485
- declare type FunctionPropertyGroup =
486
- `${PublicOrProtectedOrPrivateModifierPrefix}${StaticModifierPrefix}${OverrideModifierPrefix}${ReadonlyModifierPrefix}${DecoratedModifierPrefix}${FunctionPropertySelector}`
487
-
488
- declare type FunctionPropertySelector = 'function-property'
489
-
490
- declare type GetMethodOrSetMethodGroup =
491
- `${PublicOrProtectedOrPrivateModifierPrefix}${StaticOrAbstractModifierPrefix}${OverrideModifierPrefix}${DecoratedModifierPrefix}${GetMethodOrSetMethodSelector}`
492
-
493
- declare type GetMethodOrSetMethodSelector =
494
- | GetMethodSelector
495
- | SetMethodSelector
496
-
497
- declare type GetMethodSelector = 'get-method'
498
-
499
- /**
500
- * Some invalid combinations are still handled by this type, such as
501
- * - private abstract X
502
- * - abstract decorated X
503
- * Only used in code, so I don't know if it's worth maintaining this.
504
- */
505
- declare type Group =
506
- | GetMethodOrSetMethodGroup
507
- | NonDeclarePropertyGroup
508
- | AccessorPropertyGroup
509
- | FunctionPropertyGroup
510
- | DeclarePropertyGroup
511
- | IndexSignatureGroup
512
- | ConstructorGroup
513
- | StaticBlockGroup
514
- | MethodGroup
515
- | 'unknown'
516
- | string
517
-
518
- declare type Group_2<T extends string[]> =
519
- | 'side-effect-style'
520
- | 'external-type'
521
- | 'internal-type'
522
- | 'builtin-type'
523
- | 'sibling-type'
524
- | 'parent-type'
525
- | 'side-effect'
526
- | 'index-type'
527
- | 'internal'
528
- | 'external'
529
- | T[number]
530
- | 'sibling'
531
- | 'unknown'
532
- | 'builtin'
533
- | 'parent'
534
- | 'object'
535
- | 'index'
536
- | 'style'
537
- | 'type'
538
-
539
- declare type IndexSignatureGroup =
540
- `${StaticModifierPrefix}${ReadonlyModifierPrefix}${IndexSignatureSelector}`
541
-
542
- declare type IndexSignatureSelector = 'index-signature'
543
-
544
- declare type MESSAGE_ID =
545
- | 'missedSpacingBetweenImports'
546
- | 'unexpectedImportsGroupOrder'
547
- | 'extraSpacingBetweenImports'
548
- | 'unexpectedImportsOrder'
549
-
550
- declare type MethodGroup =
551
- `${PublicOrProtectedOrPrivateModifierPrefix}${StaticOrAbstractModifierPrefix}${OverrideModifierPrefix}${DecoratedModifierPrefix}${OptionalModifierPrefix}${MethodSelector}`
552
-
553
- declare type MethodSelector = 'method'
554
-
555
- declare type NonDeclarePropertyGroup =
556
- `${PublicOrProtectedOrPrivateModifierPrefix}${StaticOrAbstractModifierPrefix}${OverrideModifierPrefix}${ReadonlyModifierPrefix}${DecoratedModifierPrefix}${OptionalModifierPrefix}${PropertySelector}`
557
-
558
- declare type OptionalModifier = 'optional'
559
-
560
- declare type OptionalModifierPrefix = WithDashSuffixOrEmpty<OptionalModifier>
561
-
562
- declare type Options = [
563
- Partial<{
564
- groupKind: 'literals-first' | 'spreads-first' | 'mixed'
565
- type: 'alphabetical' | 'line-length' | 'natural'
566
- partitionByComment: string[] | boolean | string
567
- specialCharacters: 'remove' | 'trim' | 'keep'
568
- matcher: 'minimatch' | 'regex'
569
- partitionByNewLine: boolean
570
- order: 'desc' | 'asc'
571
- ignoreCase: boolean
572
- }>,
573
- ]
574
-
575
- declare type Options_2<T extends string[]> = [
576
- Partial<{
577
- customGroups: {
578
- value?: {
579
- [key in T[number]]: string[] | string
580
- }
581
- type?: {
582
- [key in T[number]]: string[] | string
583
- }
584
- }
585
- type: 'alphabetical' | 'line-length' | 'natural'
586
- newlinesBetween: 'ignore' | 'always' | 'never'
587
- specialCharacters: 'remove' | 'trim' | 'keep'
588
- groups: (Group_2<T>[] | Group_2<T>)[]
589
- matcher: 'minimatch' | 'regex'
590
- environment: 'node' | 'bun'
591
- internalPattern: string[]
592
- sortSideEffects: boolean
593
- maxLineLength?: number
594
- order: 'desc' | 'asc'
595
- ignoreCase: boolean
596
- }>,
597
- ]
598
-
599
- declare type Options_3 = [
600
- Partial<{
601
- type: 'alphabetical' | 'line-length' | 'natural'
602
- partitionByComment: string[] | boolean | string
603
- specialCharacters: 'remove' | 'trim' | 'keep'
604
- matcher: 'minimatch' | 'regex'
605
- partitionByNewLine: boolean
606
- forceNumericSort: boolean
607
- order: 'desc' | 'asc'
608
- sortByValue: boolean
609
- ignoreCase: boolean
610
- }>,
611
- ]
612
-
613
- declare type OverrideModifier = 'override'
614
-
615
- declare type OverrideModifierPrefix = WithDashSuffixOrEmpty<OverrideModifier>
616
-
617
- declare type PrivateModifier = 'private'
618
-
619
- declare type PropertySelector = 'property'
620
-
621
- declare type ProtectedModifier = 'protected'
622
-
623
- declare type PublicModifier = 'public'
624
-
625
- declare type PublicOrProtectedOrPrivateModifier =
626
- | ProtectedModifier
627
- | PrivateModifier
628
- | PublicModifier
629
-
630
- declare type PublicOrProtectedOrPrivateModifierPrefix = WithDashSuffixOrEmpty<
631
- ProtectedModifier | PrivateModifier | PublicModifier
632
- >
633
-
634
- declare type ReadonlyModifier = 'readonly'
635
-
636
- declare type ReadonlyModifierPrefix = WithDashSuffixOrEmpty<ReadonlyModifier>
637
-
638
- declare type Selector =
639
- | AccessorPropertySelector
640
- | FunctionPropertySelector
641
- | IndexSignatureSelector
642
- | ConstructorSelector
643
- | StaticBlockSelector
644
- | GetMethodSelector
645
- | SetMethodSelector
646
- | PropertySelector
647
- | MethodSelector
648
-
649
- declare type SetMethodSelector = 'set-method'
650
-
651
- declare type SingleCustomGroup =
652
- | AdvancedSingleCustomGroup<FunctionPropertySelector>
653
- | AdvancedSingleCustomGroup<AccessorPropertySelector>
654
- | BaseSingleCustomGroup<IndexSignatureSelector>
655
- | AdvancedSingleCustomGroup<GetMethodSelector>
656
- | AdvancedSingleCustomGroup<SetMethodSelector>
657
- | AdvancedSingleCustomGroup<PropertySelector>
658
- | BaseSingleCustomGroup<StaticBlockSelector>
659
- | BaseSingleCustomGroup<ConstructorSelector>
660
- | AdvancedSingleCustomGroup<MethodSelector>
661
-
662
- declare type SortClassesOptions = [
663
- Partial<{
664
- customGroups:
665
- | {
666
- [key: string]: string[] | string
667
- }
668
- | CustomGroup[]
669
- type: 'alphabetical' | 'line-length' | 'natural'
670
- partitionByComment: string[] | boolean | string
671
- specialCharacters: 'remove' | 'trim' | 'keep'
672
- matcher: 'minimatch' | 'regex'
673
- groups: (Group[] | Group)[]
674
- order: 'desc' | 'asc'
675
- ignoreCase: boolean
676
- }>,
677
- ]
678
-
679
- declare type StaticBlockGroup = `${StaticBlockSelector}`
680
-
681
- declare type StaticBlockSelector = 'static-block'
682
-
683
- declare type StaticModifier = 'static'
684
-
685
- declare type StaticModifierPrefix = WithDashSuffixOrEmpty<StaticModifier>
686
-
687
- declare type StaticOrAbstractModifierPrefix = WithDashSuffixOrEmpty<
688
- AbstractModifier | StaticModifier
689
- >
690
-
691
- declare type WithDashSuffixOrEmpty<T extends string> = `${T}-` | ''
692
-
693
40
  export {}
694
41
  export = _default