@culur/prettier-plugin-tailwindcss-group 1.1.0

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 (67) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/LICENSE +21 -0
  3. package/README.md +558 -0
  4. package/dist/index.d.mts +673 -0
  5. package/dist/index.mjs +4194 -0
  6. package/dist/index.mjs.map +1 -0
  7. package/package.json +66 -0
  8. package/src/__tests__/comments.test.ts +171 -0
  9. package/src/__tests__/plugin-official.test.ts +32 -0
  10. package/src/__tests__/readme.test.ts +13 -0
  11. package/src/__tests__/utils/ast-estree.ts +22 -0
  12. package/src/__tests__/utils/ast-md.ts +101 -0
  13. package/src/__tests__/utils/test-format.ts +35 -0
  14. package/src/ast/ast-array-expression.test.ts +33 -0
  15. package/src/ast/ast-array-expression.ts +20 -0
  16. package/src/ast/ast-call-expression.test.ts +17 -0
  17. package/src/ast/ast-call-expression.ts +5 -0
  18. package/src/ast/ast-comment.test.ts +45 -0
  19. package/src/ast/ast-comment.ts +25 -0
  20. package/src/ast/ast-common.ts +29 -0
  21. package/src/ast/ast-jsx.test.ts +56 -0
  22. package/src/ast/ast-jsx.ts +53 -0
  23. package/src/ast/ast-literal.test.ts +47 -0
  24. package/src/ast/ast-literal.ts +17 -0
  25. package/src/ast/ast-property.test.ts +96 -0
  26. package/src/ast/ast-property.ts +32 -0
  27. package/src/ast/index.ts +8 -0
  28. package/src/ast/key.test.ts +21 -0
  29. package/src/ast/key.ts +4 -0
  30. package/src/group-classes/group-classes.bucket.ts +61 -0
  31. package/src/group-classes/group-classes.format.ts +39 -0
  32. package/src/group-classes/group-classes.test.ts +126 -0
  33. package/src/group-classes/group-classes.ts +34 -0
  34. package/src/group-classes/group-classes.types.ts +5 -0
  35. package/src/handle-node/handle-cva-class-value.test.ts +133 -0
  36. package/src/handle-node/handle-cva-class-value.ts +47 -0
  37. package/src/handle-node/handle-expressions.test.ts +140 -0
  38. package/src/handle-node/handle-expressions.ts +63 -0
  39. package/src/handle-node/handle-string-literal.test.ts +135 -0
  40. package/src/handle-node/handle-string-literal.ts +53 -0
  41. package/src/handle-targets/index.ts +3 -0
  42. package/src/handle-targets/target-cva-base.test.ts +103 -0
  43. package/src/handle-targets/target-cva-base.ts +17 -0
  44. package/src/handle-targets/target-cva-compound-variants.test.ts +239 -0
  45. package/src/handle-targets/target-cva-compound-variants.ts +45 -0
  46. package/src/handle-targets/target-cva-variants.test.ts +178 -0
  47. package/src/handle-targets/target-cva-variants.ts +50 -0
  48. package/src/handle-targets/target-cva.test.ts +126 -0
  49. package/src/handle-targets/target-cva.ts +33 -0
  50. package/src/handle-targets/target-jsx.test.ts +242 -0
  51. package/src/handle-targets/target-jsx.ts +65 -0
  52. package/src/handle-targets/target-object-properties.test.ts +140 -0
  53. package/src/handle-targets/target-object-properties.ts +41 -0
  54. package/src/index.ts +13 -0
  55. package/src/options.test.ts +73 -0
  56. package/src/options.ts +94 -0
  57. package/src/orders/class-groups.test.ts +74 -0
  58. package/src/orders/class-groups.ts +178 -0
  59. package/src/orders/class-order.tailwind-merge.ts +26 -0
  60. package/src/orders/modifier-order.prettier-plugin-tailwindcss.test.ts +33 -0
  61. package/src/orders/modifier-order.prettier-plugin-tailwindcss.ts +23 -0
  62. package/src/prettier.d.ts +21 -0
  63. package/src/printers.test.ts +58 -0
  64. package/src/printers.ts +29 -0
  65. package/src/printers.walk-ast.test.ts +58 -0
  66. package/src/printers.walk-ast.ts +41 -0
  67. package/src/utils/split-classes.ts +3 -0
@@ -0,0 +1,673 @@
1
+ import { Plugin } from "prettier";
2
+ //#region src/prettier.d.ts
3
+ /**
4
+ * Ambient type augmentation for Prettier Options.
5
+ *
6
+ * NOTE: These type definitions correspond directly to the runtime options defined in:
7
+ * @see {@link ./options.ts}
8
+ */
9
+ declare module 'prettier' {
10
+ interface Options {
11
+ classNameThreshold?: number;
12
+ modifierThreshold?: number;
13
+ tailwindFunctions?: string[];
14
+ }
15
+ }
16
+ //#endregion
17
+ //#region src/options.d.ts
18
+ /**
19
+ * Runtime Prettier plugin options configuration.
20
+ *
21
+ * NOTE: TypeScript type augmentation for Prettier's `Options` interface is declared in:
22
+ * @see {@link ./prettier.d.ts}
23
+ */
24
+ declare const options: {
25
+ classNameThreshold: {
26
+ type: "int";
27
+ category: string;
28
+ default: number;
29
+ description: string;
30
+ };
31
+ modifierThreshold: {
32
+ type: "int";
33
+ category: string;
34
+ default: number;
35
+ description: string;
36
+ };
37
+ tailwindFunctions: {
38
+ type: "string";
39
+ array: true;
40
+ category: string;
41
+ default: {
42
+ value: string[];
43
+ }[];
44
+ description: string;
45
+ };
46
+ };
47
+ //#endregion
48
+ //#region ../../node_modules/.pnpm/@types+estree@1.0.9/node_modules/@types/estree/index.d.ts
49
+ // This definition file follows a somewhat unusual format. ESTree allows
50
+ // runtime type checks based on the `type` parameter. In order to explain this
51
+ // to typescript we want to use discriminated union types:
52
+ // https://github.com/Microsoft/TypeScript/pull/9163
53
+ //
54
+ // For ESTree this is a bit tricky because the high level interfaces like
55
+ // Node or Function are pulling double duty. We want to pass common fields down
56
+ // to the interfaces that extend them (like Identifier or
57
+ // ArrowFunctionExpression), but you can't extend a type union or enforce
58
+ // common fields on them. So we've split the high level interfaces into two
59
+ // types, a base type which passes down inherited fields, and a type union of
60
+ // all types which extend the base type. Only the type union is exported, and
61
+ // the union is how other types refer to the collection of inheriting types.
62
+ //
63
+ // This makes the definitions file here somewhat more difficult to maintain,
64
+ // but it has the notable advantage of making ESTree much easier to use as
65
+ // an end user.
66
+ interface BaseNodeWithoutComments {
67
+ // Every leaf interface that extends BaseNode must specify a type property.
68
+ // The type property should be a string literal. For example, Identifier
69
+ // has: `type: "Identifier"`
70
+ type: string;
71
+ loc?: SourceLocation | null | undefined;
72
+ range?: [number, number] | undefined;
73
+ }
74
+ interface BaseNode extends BaseNodeWithoutComments {
75
+ leadingComments?: Comment[] | undefined;
76
+ trailingComments?: Comment[] | undefined;
77
+ }
78
+ interface NodeMap {
79
+ AssignmentProperty: AssignmentProperty;
80
+ CatchClause: CatchClause;
81
+ Class: Class;
82
+ ClassBody: ClassBody;
83
+ Expression: Expression;
84
+ Function: Function;
85
+ Identifier: Identifier;
86
+ Literal: Literal;
87
+ MethodDefinition: MethodDefinition;
88
+ ModuleDeclaration: ModuleDeclaration;
89
+ ModuleSpecifier: ModuleSpecifier;
90
+ Pattern: Pattern;
91
+ PrivateIdentifier: PrivateIdentifier;
92
+ Program: Program;
93
+ Property: Property;
94
+ PropertyDefinition: PropertyDefinition;
95
+ SpreadElement: SpreadElement;
96
+ Statement: Statement;
97
+ Super: Super;
98
+ SwitchCase: SwitchCase;
99
+ TemplateElement: TemplateElement;
100
+ VariableDeclarator: VariableDeclarator;
101
+ }
102
+ type Node = NodeMap[keyof NodeMap];
103
+ interface Comment extends BaseNodeWithoutComments {
104
+ type: "Line" | "Block";
105
+ value: string;
106
+ }
107
+ interface SourceLocation {
108
+ source?: string | null | undefined;
109
+ start: Position;
110
+ end: Position;
111
+ }
112
+ interface Position {
113
+ /** >= 1 */
114
+ line: number;
115
+ /** >= 0 */
116
+ column: number;
117
+ }
118
+ interface Program extends BaseNode {
119
+ type: "Program";
120
+ sourceType: "script" | "module";
121
+ body: Array<Directive | Statement | ModuleDeclaration>;
122
+ comments?: Comment[] | undefined;
123
+ }
124
+ interface Directive extends BaseNode {
125
+ type: "ExpressionStatement";
126
+ expression: Literal;
127
+ directive: string;
128
+ }
129
+ interface BaseFunction extends BaseNode {
130
+ params: Pattern[];
131
+ generator?: boolean | undefined;
132
+ async?: boolean | undefined;
133
+ // The body is either BlockStatement or Expression because arrow functions
134
+ // can have a body that's either. FunctionDeclarations and
135
+ // FunctionExpressions have only BlockStatement bodies.
136
+ body: BlockStatement | Expression;
137
+ }
138
+ type Function = FunctionDeclaration | FunctionExpression | ArrowFunctionExpression;
139
+ type Statement = ExpressionStatement | BlockStatement | StaticBlock | EmptyStatement | DebuggerStatement | WithStatement | ReturnStatement | LabeledStatement | BreakStatement | ContinueStatement | IfStatement | SwitchStatement | ThrowStatement | TryStatement | WhileStatement | DoWhileStatement | ForStatement | ForInStatement | ForOfStatement | Declaration;
140
+ interface BaseStatement extends BaseNode {}
141
+ interface EmptyStatement extends BaseStatement {
142
+ type: "EmptyStatement";
143
+ }
144
+ interface BlockStatement extends BaseStatement {
145
+ type: "BlockStatement";
146
+ body: Statement[];
147
+ innerComments?: Comment[] | undefined;
148
+ }
149
+ interface StaticBlock extends Omit<BlockStatement, "type"> {
150
+ type: "StaticBlock";
151
+ }
152
+ interface ExpressionStatement extends BaseStatement {
153
+ type: "ExpressionStatement";
154
+ expression: Expression;
155
+ }
156
+ interface IfStatement extends BaseStatement {
157
+ type: "IfStatement";
158
+ test: Expression;
159
+ consequent: Statement;
160
+ alternate?: Statement | null | undefined;
161
+ }
162
+ interface LabeledStatement extends BaseStatement {
163
+ type: "LabeledStatement";
164
+ label: Identifier;
165
+ body: Statement;
166
+ }
167
+ interface BreakStatement extends BaseStatement {
168
+ type: "BreakStatement";
169
+ label?: Identifier | null | undefined;
170
+ }
171
+ interface ContinueStatement extends BaseStatement {
172
+ type: "ContinueStatement";
173
+ label?: Identifier | null | undefined;
174
+ }
175
+ interface WithStatement extends BaseStatement {
176
+ type: "WithStatement";
177
+ object: Expression;
178
+ body: Statement;
179
+ }
180
+ interface SwitchStatement extends BaseStatement {
181
+ type: "SwitchStatement";
182
+ discriminant: Expression;
183
+ cases: SwitchCase[];
184
+ }
185
+ interface ReturnStatement extends BaseStatement {
186
+ type: "ReturnStatement";
187
+ argument?: Expression | null | undefined;
188
+ }
189
+ interface ThrowStatement extends BaseStatement {
190
+ type: "ThrowStatement";
191
+ argument: Expression;
192
+ }
193
+ interface TryStatement extends BaseStatement {
194
+ type: "TryStatement";
195
+ block: BlockStatement;
196
+ handler?: CatchClause | null | undefined;
197
+ finalizer?: BlockStatement | null | undefined;
198
+ }
199
+ interface WhileStatement extends BaseStatement {
200
+ type: "WhileStatement";
201
+ test: Expression;
202
+ body: Statement;
203
+ }
204
+ interface DoWhileStatement extends BaseStatement {
205
+ type: "DoWhileStatement";
206
+ body: Statement;
207
+ test: Expression;
208
+ }
209
+ interface ForStatement extends BaseStatement {
210
+ type: "ForStatement";
211
+ init?: VariableDeclaration | Expression | null | undefined;
212
+ test?: Expression | null | undefined;
213
+ update?: Expression | null | undefined;
214
+ body: Statement;
215
+ }
216
+ interface BaseForXStatement extends BaseStatement {
217
+ left: VariableDeclaration | Pattern;
218
+ right: Expression;
219
+ body: Statement;
220
+ }
221
+ interface ForInStatement extends BaseForXStatement {
222
+ type: "ForInStatement";
223
+ }
224
+ interface DebuggerStatement extends BaseStatement {
225
+ type: "DebuggerStatement";
226
+ }
227
+ type Declaration = FunctionDeclaration | VariableDeclaration | ClassDeclaration;
228
+ interface BaseDeclaration extends BaseStatement {}
229
+ interface MaybeNamedFunctionDeclaration extends BaseFunction, BaseDeclaration {
230
+ type: "FunctionDeclaration";
231
+ /** It is null when a function declaration is a part of the `export default function` statement */
232
+ id: Identifier | null;
233
+ body: BlockStatement;
234
+ }
235
+ interface FunctionDeclaration extends MaybeNamedFunctionDeclaration {
236
+ id: Identifier;
237
+ }
238
+ interface VariableDeclaration extends BaseDeclaration {
239
+ type: "VariableDeclaration";
240
+ declarations: VariableDeclarator[];
241
+ kind: "var" | "let" | "const" | "using" | "await using";
242
+ }
243
+ interface VariableDeclarator extends BaseNode {
244
+ type: "VariableDeclarator";
245
+ id: Pattern;
246
+ init?: Expression | null | undefined;
247
+ }
248
+ interface ExpressionMap {
249
+ ArrayExpression: ArrayExpression;
250
+ ArrowFunctionExpression: ArrowFunctionExpression;
251
+ AssignmentExpression: AssignmentExpression;
252
+ AwaitExpression: AwaitExpression;
253
+ BinaryExpression: BinaryExpression;
254
+ CallExpression: CallExpression;
255
+ ChainExpression: ChainExpression;
256
+ ClassExpression: ClassExpression;
257
+ ConditionalExpression: ConditionalExpression;
258
+ FunctionExpression: FunctionExpression;
259
+ Identifier: Identifier;
260
+ ImportExpression: ImportExpression;
261
+ Literal: Literal;
262
+ LogicalExpression: LogicalExpression;
263
+ MemberExpression: MemberExpression;
264
+ MetaProperty: MetaProperty;
265
+ NewExpression: NewExpression;
266
+ ObjectExpression: ObjectExpression;
267
+ SequenceExpression: SequenceExpression;
268
+ TaggedTemplateExpression: TaggedTemplateExpression;
269
+ TemplateLiteral: TemplateLiteral;
270
+ ThisExpression: ThisExpression;
271
+ UnaryExpression: UnaryExpression;
272
+ UpdateExpression: UpdateExpression;
273
+ YieldExpression: YieldExpression;
274
+ }
275
+ type Expression = ExpressionMap[keyof ExpressionMap];
276
+ interface BaseExpression extends BaseNode {}
277
+ type ChainElement = SimpleCallExpression | MemberExpression;
278
+ interface ChainExpression extends BaseExpression {
279
+ type: "ChainExpression";
280
+ expression: ChainElement;
281
+ }
282
+ interface ThisExpression extends BaseExpression {
283
+ type: "ThisExpression";
284
+ }
285
+ interface ArrayExpression extends BaseExpression {
286
+ type: "ArrayExpression";
287
+ elements: Array<Expression | SpreadElement | null>;
288
+ }
289
+ interface ObjectExpression extends BaseExpression {
290
+ type: "ObjectExpression";
291
+ properties: Array<Property | SpreadElement>;
292
+ }
293
+ interface PrivateIdentifier extends BaseNode {
294
+ type: "PrivateIdentifier";
295
+ name: string;
296
+ }
297
+ interface Property extends BaseNode {
298
+ type: "Property";
299
+ key: Expression;
300
+ value: Expression | Pattern; // Could be an AssignmentProperty
301
+ kind: "init" | "get" | "set";
302
+ method: boolean;
303
+ shorthand: boolean;
304
+ computed: boolean;
305
+ }
306
+ interface PropertyDefinition extends BaseNode {
307
+ type: "PropertyDefinition";
308
+ key: Expression | PrivateIdentifier;
309
+ value?: Expression | null | undefined;
310
+ computed: boolean;
311
+ static: boolean;
312
+ }
313
+ interface FunctionExpression extends BaseFunction, BaseExpression {
314
+ id?: Identifier | null | undefined;
315
+ type: "FunctionExpression";
316
+ body: BlockStatement;
317
+ }
318
+ interface SequenceExpression extends BaseExpression {
319
+ type: "SequenceExpression";
320
+ expressions: Expression[];
321
+ }
322
+ interface UnaryExpression extends BaseExpression {
323
+ type: "UnaryExpression";
324
+ operator: UnaryOperator;
325
+ prefix: true;
326
+ argument: Expression;
327
+ }
328
+ interface BinaryExpression extends BaseExpression {
329
+ type: "BinaryExpression";
330
+ operator: BinaryOperator;
331
+ left: Expression | PrivateIdentifier;
332
+ right: Expression;
333
+ }
334
+ interface AssignmentExpression extends BaseExpression {
335
+ type: "AssignmentExpression";
336
+ operator: AssignmentOperator;
337
+ left: Pattern | MemberExpression;
338
+ right: Expression;
339
+ }
340
+ interface UpdateExpression extends BaseExpression {
341
+ type: "UpdateExpression";
342
+ operator: UpdateOperator;
343
+ argument: Expression;
344
+ prefix: boolean;
345
+ }
346
+ interface LogicalExpression extends BaseExpression {
347
+ type: "LogicalExpression";
348
+ operator: LogicalOperator;
349
+ left: Expression;
350
+ right: Expression;
351
+ }
352
+ interface ConditionalExpression extends BaseExpression {
353
+ type: "ConditionalExpression";
354
+ test: Expression;
355
+ alternate: Expression;
356
+ consequent: Expression;
357
+ }
358
+ interface BaseCallExpression extends BaseExpression {
359
+ callee: Expression | Super;
360
+ arguments: Array<Expression | SpreadElement>;
361
+ }
362
+ type CallExpression = SimpleCallExpression | NewExpression;
363
+ interface SimpleCallExpression extends BaseCallExpression {
364
+ type: "CallExpression";
365
+ optional: boolean;
366
+ }
367
+ interface NewExpression extends BaseCallExpression {
368
+ type: "NewExpression";
369
+ }
370
+ interface MemberExpression extends BaseExpression, BasePattern {
371
+ type: "MemberExpression";
372
+ object: Expression | Super;
373
+ property: Expression | PrivateIdentifier;
374
+ computed: boolean;
375
+ optional: boolean;
376
+ }
377
+ type Pattern = Identifier | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern | MemberExpression;
378
+ interface BasePattern extends BaseNode {}
379
+ interface SwitchCase extends BaseNode {
380
+ type: "SwitchCase";
381
+ test?: Expression | null | undefined;
382
+ consequent: Statement[];
383
+ }
384
+ interface CatchClause extends BaseNode {
385
+ type: "CatchClause";
386
+ param: Pattern | null;
387
+ body: BlockStatement;
388
+ }
389
+ interface Identifier extends BaseNode, BaseExpression, BasePattern {
390
+ type: "Identifier";
391
+ name: string;
392
+ }
393
+ type Literal = SimpleLiteral | RegExpLiteral | BigIntLiteral;
394
+ interface SimpleLiteral extends BaseNode, BaseExpression {
395
+ type: "Literal";
396
+ value: string | boolean | number | null;
397
+ raw?: string | undefined;
398
+ }
399
+ interface RegExpLiteral extends BaseNode, BaseExpression {
400
+ type: "Literal";
401
+ value?: RegExp | null | undefined;
402
+ regex: {
403
+ pattern: string;
404
+ flags: string;
405
+ };
406
+ raw?: string | undefined;
407
+ }
408
+ interface BigIntLiteral extends BaseNode, BaseExpression {
409
+ type: "Literal";
410
+ value?: bigint | null | undefined;
411
+ bigint: string;
412
+ raw?: string | undefined;
413
+ }
414
+ type UnaryOperator = "-" | "+" | "!" | "~" | "typeof" | "void" | "delete";
415
+ type BinaryOperator = "==" | "!=" | "===" | "!==" | "<" | "<=" | ">" | ">=" | "<<" | ">>" | ">>>" | "+" | "-" | "*" | "/" | "%" | "**" | "|" | "^" | "&" | "in" | "instanceof";
416
+ type LogicalOperator = "||" | "&&" | "??";
417
+ type AssignmentOperator = "=" | "+=" | "-=" | "*=" | "/=" | "%=" | "**=" | "<<=" | ">>=" | ">>>=" | "|=" | "^=" | "&=" | "||=" | "&&=" | "??=";
418
+ type UpdateOperator = "++" | "--";
419
+ interface ForOfStatement extends BaseForXStatement {
420
+ type: "ForOfStatement";
421
+ await: boolean;
422
+ }
423
+ interface Super extends BaseNode {
424
+ type: "Super";
425
+ }
426
+ interface SpreadElement extends BaseNode {
427
+ type: "SpreadElement";
428
+ argument: Expression;
429
+ }
430
+ interface ArrowFunctionExpression extends BaseExpression, BaseFunction {
431
+ type: "ArrowFunctionExpression";
432
+ expression: boolean;
433
+ body: BlockStatement | Expression;
434
+ }
435
+ interface YieldExpression extends BaseExpression {
436
+ type: "YieldExpression";
437
+ argument?: Expression | null | undefined;
438
+ delegate: boolean;
439
+ }
440
+ interface TemplateLiteral extends BaseExpression {
441
+ type: "TemplateLiteral";
442
+ quasis: TemplateElement[];
443
+ expressions: Expression[];
444
+ }
445
+ interface TaggedTemplateExpression extends BaseExpression {
446
+ type: "TaggedTemplateExpression";
447
+ tag: Expression;
448
+ quasi: TemplateLiteral;
449
+ }
450
+ interface TemplateElement extends BaseNode {
451
+ type: "TemplateElement";
452
+ tail: boolean;
453
+ value: {
454
+ /** It is null when the template literal is tagged and the text has an invalid escape (e.g. - tag`\unicode and \u{55}`) */
455
+ cooked?: string | null | undefined;
456
+ raw: string;
457
+ };
458
+ }
459
+ interface AssignmentProperty extends Property {
460
+ value: Pattern;
461
+ kind: "init";
462
+ method: boolean; // false
463
+ }
464
+ interface ObjectPattern extends BasePattern {
465
+ type: "ObjectPattern";
466
+ properties: Array<AssignmentProperty | RestElement>;
467
+ }
468
+ interface ArrayPattern extends BasePattern {
469
+ type: "ArrayPattern";
470
+ elements: Array<Pattern | null>;
471
+ }
472
+ interface RestElement extends BasePattern {
473
+ type: "RestElement";
474
+ argument: Pattern;
475
+ }
476
+ interface AssignmentPattern extends BasePattern {
477
+ type: "AssignmentPattern";
478
+ left: Pattern;
479
+ right: Expression;
480
+ }
481
+ type Class = ClassDeclaration | ClassExpression;
482
+ interface BaseClass extends BaseNode {
483
+ superClass?: Expression | null | undefined;
484
+ body: ClassBody;
485
+ }
486
+ interface ClassBody extends BaseNode {
487
+ type: "ClassBody";
488
+ body: Array<MethodDefinition | PropertyDefinition | StaticBlock>;
489
+ }
490
+ interface MethodDefinition extends BaseNode {
491
+ type: "MethodDefinition";
492
+ key: Expression | PrivateIdentifier;
493
+ value: FunctionExpression;
494
+ kind: "constructor" | "method" | "get" | "set";
495
+ computed: boolean;
496
+ static: boolean;
497
+ }
498
+ interface MaybeNamedClassDeclaration extends BaseClass, BaseDeclaration {
499
+ type: "ClassDeclaration";
500
+ /** It is null when a class declaration is a part of the `export default class` statement */
501
+ id: Identifier | null;
502
+ }
503
+ interface ClassDeclaration extends MaybeNamedClassDeclaration {
504
+ id: Identifier;
505
+ }
506
+ interface ClassExpression extends BaseClass, BaseExpression {
507
+ type: "ClassExpression";
508
+ id?: Identifier | null | undefined;
509
+ }
510
+ interface MetaProperty extends BaseExpression {
511
+ type: "MetaProperty";
512
+ meta: Identifier;
513
+ property: Identifier;
514
+ }
515
+ type ModuleDeclaration = ImportDeclaration | ExportNamedDeclaration | ExportDefaultDeclaration | ExportAllDeclaration;
516
+ interface BaseModuleDeclaration extends BaseNode {}
517
+ type ModuleSpecifier = ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ExportSpecifier;
518
+ interface BaseModuleSpecifier extends BaseNode {
519
+ local: Identifier;
520
+ }
521
+ interface ImportDeclaration extends BaseModuleDeclaration {
522
+ type: "ImportDeclaration";
523
+ specifiers: Array<ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier>;
524
+ attributes: ImportAttribute[];
525
+ source: Literal;
526
+ }
527
+ interface ImportSpecifier extends BaseModuleSpecifier {
528
+ type: "ImportSpecifier";
529
+ imported: Identifier | Literal;
530
+ }
531
+ interface ImportAttribute extends BaseNode {
532
+ type: "ImportAttribute";
533
+ key: Identifier | Literal;
534
+ value: Literal;
535
+ }
536
+ interface ImportExpression extends BaseExpression {
537
+ type: "ImportExpression";
538
+ source: Expression;
539
+ options?: Expression | null | undefined;
540
+ }
541
+ interface ImportDefaultSpecifier extends BaseModuleSpecifier {
542
+ type: "ImportDefaultSpecifier";
543
+ }
544
+ interface ImportNamespaceSpecifier extends BaseModuleSpecifier {
545
+ type: "ImportNamespaceSpecifier";
546
+ }
547
+ interface ExportNamedDeclaration extends BaseModuleDeclaration {
548
+ type: "ExportNamedDeclaration";
549
+ declaration?: Declaration | null | undefined;
550
+ specifiers: ExportSpecifier[];
551
+ attributes: ImportAttribute[];
552
+ source?: Literal | null | undefined;
553
+ }
554
+ interface ExportSpecifier extends Omit<BaseModuleSpecifier, "local"> {
555
+ type: "ExportSpecifier";
556
+ local: Identifier | Literal;
557
+ exported: Identifier | Literal;
558
+ }
559
+ interface ExportDefaultDeclaration extends BaseModuleDeclaration {
560
+ type: "ExportDefaultDeclaration";
561
+ declaration: MaybeNamedFunctionDeclaration | MaybeNamedClassDeclaration | Expression;
562
+ }
563
+ interface ExportAllDeclaration extends BaseModuleDeclaration {
564
+ type: "ExportAllDeclaration";
565
+ exported: Identifier | Literal | null;
566
+ attributes: ImportAttribute[];
567
+ source: Literal;
568
+ }
569
+ interface AwaitExpression extends BaseExpression {
570
+ type: "AwaitExpression";
571
+ argument: Expression;
572
+ }
573
+ //#endregion
574
+ //#region ../../node_modules/.pnpm/@types+estree-jsx@1.0.5/node_modules/@types/estree-jsx/index.d.ts
575
+ declare module "estree" {
576
+ interface ExpressionMap {
577
+ JSXElement: JSXElement;
578
+ JSXFragment: JSXFragment;
579
+ }
580
+ interface NodeMap {
581
+ JSXIdentifier: JSXIdentifier;
582
+ JSXNamespacedName: JSXNamespacedName;
583
+ JSXMemberExpression: JSXMemberExpression;
584
+ JSXEmptyExpression: JSXEmptyExpression;
585
+ JSXExpressionContainer: JSXExpressionContainer;
586
+ JSXSpreadAttribute: JSXSpreadAttribute;
587
+ JSXAttribute: JSXAttribute;
588
+ JSXOpeningElement: JSXOpeningElement;
589
+ JSXOpeningFragment: JSXOpeningFragment;
590
+ JSXClosingElement: JSXClosingElement;
591
+ JSXClosingFragment: JSXClosingFragment;
592
+ JSXElement: JSXElement;
593
+ JSXFragment: JSXFragment;
594
+ JSXText: JSXText;
595
+ }
596
+ }
597
+ interface JSXIdentifier extends BaseNode {
598
+ type: "JSXIdentifier";
599
+ name: string;
600
+ }
601
+ interface JSXMemberExpression extends BaseExpression {
602
+ type: "JSXMemberExpression";
603
+ object: JSXMemberExpression | JSXIdentifier;
604
+ property: JSXIdentifier;
605
+ }
606
+ interface JSXNamespacedName extends BaseExpression {
607
+ type: "JSXNamespacedName";
608
+ namespace: JSXIdentifier;
609
+ name: JSXIdentifier;
610
+ }
611
+ interface JSXEmptyExpression extends BaseNode {
612
+ type: "JSXEmptyExpression";
613
+ }
614
+ interface JSXExpressionContainer extends BaseNode {
615
+ type: "JSXExpressionContainer";
616
+ expression: Expression | JSXEmptyExpression;
617
+ }
618
+ interface JSXSpreadChild extends BaseNode {
619
+ type: "JSXSpreadChild";
620
+ expression: Expression;
621
+ }
622
+ interface JSXBoundaryElement extends BaseNode {
623
+ name: JSXIdentifier | JSXMemberExpression | JSXNamespacedName;
624
+ }
625
+ interface JSXOpeningElement extends JSXBoundaryElement {
626
+ type: "JSXOpeningElement";
627
+ attributes: Array<JSXAttribute | JSXSpreadAttribute>;
628
+ selfClosing: boolean;
629
+ }
630
+ interface JSXClosingElement extends JSXBoundaryElement {
631
+ type: "JSXClosingElement";
632
+ }
633
+ interface JSXAttribute extends BaseNode {
634
+ type: "JSXAttribute";
635
+ name: JSXIdentifier | JSXNamespacedName;
636
+ value: Literal | JSXExpressionContainer | JSXElement | JSXFragment | null;
637
+ }
638
+ interface JSXSpreadAttribute extends BaseNode {
639
+ type: "JSXSpreadAttribute";
640
+ argument: Expression;
641
+ }
642
+ interface JSXText extends BaseNode {
643
+ type: "JSXText";
644
+ value: string;
645
+ raw: string;
646
+ }
647
+ interface JSXElement extends BaseExpression {
648
+ type: "JSXElement";
649
+ openingElement: JSXOpeningElement;
650
+ children: Array<JSXText | JSXExpressionContainer | JSXSpreadChild | JSXElement | JSXFragment>;
651
+ closingElement: JSXClosingElement | null;
652
+ }
653
+ interface JSXFragment extends BaseExpression {
654
+ type: "JSXFragment";
655
+ openingFragment: JSXOpeningFragment;
656
+ children: Array<JSXText | JSXExpressionContainer | JSXSpreadChild | JSXElement | JSXFragment>;
657
+ closingFragment: JSXClosingFragment;
658
+ }
659
+ interface JSXOpeningFragment extends BaseNode {
660
+ type: "JSXOpeningFragment";
661
+ }
662
+ interface JSXClosingFragment extends BaseNode {
663
+ type: "JSXClosingFragment";
664
+ }
665
+ //#endregion
666
+ //#region src/printers.d.ts
667
+ declare const printers: Plugin<Node>['printers'];
668
+ //#endregion
669
+ //#region src/index.d.ts
670
+ declare const plugin: Plugin;
671
+ //#endregion
672
+ export { plugin as default, options, printers };
673
+ //# sourceMappingURL=index.d.mts.map