prettier-plugin-embed 0.5.1 → 0.7.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 (108) hide show
  1. package/README.md +416 -393
  2. package/dist/embedded/astro/embedder.d.ts +7 -0
  3. package/dist/embedded/astro/index.d.ts +3 -0
  4. package/dist/embedded/astro/language.d.ts +6 -0
  5. package/dist/embedded/astro/options.d.ts +40 -0
  6. package/dist/embedded/create-embedder.d.ts +14 -0
  7. package/dist/embedded/css/embedder.d.ts +1 -6
  8. package/dist/embedded/dockerfile/embedder.d.ts +7 -0
  9. package/dist/embedded/dockerfile/index.d.ts +3 -0
  10. package/dist/embedded/dockerfile/language.d.ts +6 -0
  11. package/dist/embedded/dockerfile/options.d.ts +40 -0
  12. package/dist/embedded/es/embedder.d.ts +1 -6
  13. package/dist/embedded/es/options.d.ts +1 -1
  14. package/dist/embedded/gherkin/embedder.d.ts +7 -0
  15. package/dist/embedded/gherkin/index.d.ts +3 -0
  16. package/dist/embedded/gherkin/language.d.ts +6 -0
  17. package/dist/embedded/gherkin/options.d.ts +40 -0
  18. package/dist/embedded/glsl/embedder.d.ts +1 -6
  19. package/dist/embedded/go-template/embedder.d.ts +7 -0
  20. package/dist/embedded/go-template/index.d.ts +3 -0
  21. package/dist/embedded/go-template/language.d.ts +6 -0
  22. package/dist/embedded/go-template/options.d.ts +40 -0
  23. package/dist/embedded/graphql/embedder.d.ts +1 -6
  24. package/dist/embedded/handlebars/embedder.d.ts +7 -0
  25. package/dist/embedded/handlebars/index.d.ts +3 -0
  26. package/dist/embedded/handlebars/language.d.ts +6 -0
  27. package/dist/embedded/handlebars/options.d.ts +40 -0
  28. package/dist/embedded/html/embedder.d.ts +1 -6
  29. package/dist/embedded/html/options.d.ts +1 -1
  30. package/dist/embedded/hugo/embedder.d.ts +7 -0
  31. package/dist/embedded/hugo/index.d.ts +3 -0
  32. package/dist/embedded/hugo/language.d.ts +6 -0
  33. package/dist/embedded/hugo/options.d.ts +40 -0
  34. package/dist/embedded/ini/embedder.d.ts +1 -6
  35. package/dist/embedded/java/embedder.d.ts +1 -6
  36. package/dist/embedded/jinja/embedder.d.ts +7 -0
  37. package/dist/embedded/jinja/index.d.ts +3 -0
  38. package/dist/embedded/jinja/language.d.ts +6 -0
  39. package/dist/embedded/jinja/options.d.ts +40 -0
  40. package/dist/embedded/json/options.d.ts +1 -1
  41. package/dist/embedded/jsonata/embedder.d.ts +1 -6
  42. package/dist/embedded/jte/embedder.d.ts +7 -0
  43. package/dist/embedded/jte/index.d.ts +3 -0
  44. package/dist/embedded/jte/language.d.ts +6 -0
  45. package/dist/embedded/jte/options.d.ts +40 -0
  46. package/dist/embedded/latex/embedder.d.ts +1 -6
  47. package/dist/embedded/liquid/embedder.d.ts +7 -0
  48. package/dist/embedded/liquid/index.d.ts +3 -0
  49. package/dist/embedded/liquid/language.d.ts +6 -0
  50. package/dist/embedded/liquid/options.d.ts +40 -0
  51. package/dist/embedded/marko/embedder.d.ts +7 -0
  52. package/dist/embedded/marko/index.d.ts +3 -0
  53. package/dist/embedded/marko/language.d.ts +6 -0
  54. package/dist/embedded/marko/options.d.ts +40 -0
  55. package/dist/embedded/motoko/embedder.d.ts +7 -0
  56. package/dist/embedded/motoko/index.d.ts +3 -0
  57. package/dist/embedded/motoko/language.d.ts +6 -0
  58. package/dist/embedded/motoko/options.d.ts +40 -0
  59. package/dist/embedded/mustache/embedder.d.ts +7 -0
  60. package/dist/embedded/mustache/index.d.ts +3 -0
  61. package/dist/embedded/mustache/language.d.ts +6 -0
  62. package/dist/embedded/mustache/options.d.ts +40 -0
  63. package/dist/embedded/nginx/embedder.d.ts +1 -6
  64. package/dist/embedded/nunjucks/embedder.d.ts +7 -0
  65. package/dist/embedded/nunjucks/index.d.ts +3 -0
  66. package/dist/embedded/nunjucks/language.d.ts +6 -0
  67. package/dist/embedded/nunjucks/options.d.ts +40 -0
  68. package/dist/embedded/pegjs/embedder.d.ts +1 -6
  69. package/dist/embedded/php/embedder.d.ts +1 -6
  70. package/dist/embedded/powershell/embedder.d.ts +7 -0
  71. package/dist/embedded/powershell/index.d.ts +3 -0
  72. package/dist/embedded/powershell/language.d.ts +6 -0
  73. package/dist/embedded/powershell/options.d.ts +40 -0
  74. package/dist/embedded/prisma/embedder.d.ts +1 -6
  75. package/dist/embedded/properties/embedder.d.ts +1 -6
  76. package/dist/embedded/pug/embedder.d.ts +1 -6
  77. package/dist/embedded/register.d.ts +42 -25
  78. package/dist/embedded/ruby/embedder.d.ts +1 -6
  79. package/dist/embedded/ruby/options.d.ts +1 -1
  80. package/dist/embedded/sh/embedder.d.ts +1 -6
  81. package/dist/embedded/solidity/embedder.d.ts +7 -0
  82. package/dist/embedded/solidity/index.d.ts +3 -0
  83. package/dist/embedded/solidity/language.d.ts +6 -0
  84. package/dist/embedded/solidity/options.d.ts +58 -0
  85. package/dist/embedded/sql/options.d.ts +1 -1
  86. package/dist/embedded/svelte/embedder.d.ts +7 -0
  87. package/dist/embedded/svelte/index.d.ts +3 -0
  88. package/dist/embedded/svelte/language.d.ts +6 -0
  89. package/dist/embedded/svelte/options.d.ts +40 -0
  90. package/dist/embedded/toml/embedder.d.ts +1 -6
  91. package/dist/embedded/toml/plugin-toml-types.d.ts +2 -2
  92. package/dist/embedded/ts/embedder.d.ts +1 -6
  93. package/dist/embedded/ts/options.d.ts +1 -1
  94. package/dist/embedded/types.d.ts +1 -1
  95. package/dist/embedded/utils.d.ts +13 -4
  96. package/dist/embedded/xml/parser.d.ts +6 -4
  97. package/dist/embedded/xquery/embedder.d.ts +7 -0
  98. package/dist/embedded/xquery/index.d.ts +3 -0
  99. package/dist/embedded/xquery/language.d.ts +6 -0
  100. package/dist/embedded/xquery/options.d.ts +55 -0
  101. package/dist/import-module-worker.js +45 -0
  102. package/dist/index.js +2078 -3209
  103. package/dist/options.d.ts +341 -6
  104. package/dist/parsers.d.ts +6 -6
  105. package/dist/type-utils.d.ts +5 -0
  106. package/dist/types.d.ts +1 -1
  107. package/dist/utils.d.ts +3 -3
  108. package/package.json +55 -47
package/dist/options.d.ts CHANGED
@@ -85,6 +85,24 @@ export declare const options: {
85
85
  }];
86
86
  readonly description: "Tags that prevent their subsequent template literals from being identified as embedded languages and thus from being formatted.";
87
87
  };
88
+ readonly embeddedAstroComments: {
89
+ readonly category: "Embed";
90
+ readonly type: "string";
91
+ readonly array: true;
92
+ readonly default: [{
93
+ readonly value: ["astro"];
94
+ }];
95
+ readonly description: "Block comments that identify embedded Astro in template literals. Requires the `prettier-plugin-astro` plugin.";
96
+ };
97
+ readonly embeddedAstroTags: {
98
+ readonly category: "Embed";
99
+ readonly type: "string";
100
+ readonly array: true;
101
+ readonly default: [{
102
+ readonly value: ["astro"];
103
+ }];
104
+ readonly description: "Tags that identify embedded Astro in template literals. Requires the `prettier-plugin-astro` plugin.";
105
+ };
88
106
  readonly embeddedCssIdentifiers: {
89
107
  readonly category: "Embed";
90
108
  readonly type: "string";
@@ -123,6 +141,24 @@ export declare const options: {
123
141
  description: string;
124
142
  }[];
125
143
  };
144
+ readonly embeddedDockerfileComments: {
145
+ readonly category: "Embed";
146
+ readonly type: "string";
147
+ readonly array: true;
148
+ readonly default: [{
149
+ readonly value: ["dockerfile", "containerfile"];
150
+ }];
151
+ readonly description: "Block comments that identify embedded Dockerfile in template literals. Requires the `prettier-plugin-sh` plugin.";
152
+ };
153
+ readonly embeddedDockerfileTags: {
154
+ readonly category: "Embed";
155
+ readonly type: "string";
156
+ readonly array: true;
157
+ readonly default: [{
158
+ readonly value: ["dockerfile", "containerfile"];
159
+ }];
160
+ readonly description: "Tags that identify embedded Dockerfile in template literals. Requires the `prettier-plugin-sh` plugin.";
161
+ };
126
162
  readonly embeddedEsIdentifiers: {
127
163
  readonly category: "Embed";
128
164
  readonly type: "string";
@@ -157,10 +193,28 @@ export declare const options: {
157
193
  default: "babel";
158
194
  description: string;
159
195
  choices: {
160
- value: "babel" | "babel-flow" | "acorn" | "espree" | "flow" | "meriyah";
196
+ value: "acorn" | "babel" | "babel-flow" | "espree" | "flow" | "meriyah";
161
197
  description: string;
162
198
  }[];
163
199
  };
200
+ readonly embeddedGherkinComments: {
201
+ readonly category: "Embed";
202
+ readonly type: "string";
203
+ readonly array: true;
204
+ readonly default: [{
205
+ readonly value: ["gherkin", "feature"];
206
+ }];
207
+ readonly description: "Block comments that identify embedded Gherkin in template literals. Requires the `prettier-plugin-gherkin` plugin.";
208
+ };
209
+ readonly embeddedGherkinTags: {
210
+ readonly category: "Embed";
211
+ readonly type: "string";
212
+ readonly array: true;
213
+ readonly default: [{
214
+ readonly value: ["gherkin", "feature"];
215
+ }];
216
+ readonly description: "Tags that identify embedded Gherkin in template literals. Requires the `prettier-plugin-gherkin` plugin.";
217
+ };
164
218
  readonly embeddedGlslIdentifiers: {
165
219
  readonly category: "Embed";
166
220
  readonly type: "string";
@@ -189,6 +243,24 @@ export declare const options: {
189
243
  }];
190
244
  readonly description: "Tags that make their subsequent template literals be identified as embedded GLSL language. This option requires the `prettier-plugin-glsl` plugin.";
191
245
  };
246
+ readonly embeddedGoTemplateComments: {
247
+ readonly category: "Embed";
248
+ readonly type: "string";
249
+ readonly array: true;
250
+ readonly default: [{
251
+ readonly value: ["goTemplate", "gotmpl"];
252
+ }];
253
+ readonly description: "Block comments that identify embedded Go Template in template literals. Requires the `@htnabe/prettier-plugin-go-template` plugin.";
254
+ };
255
+ readonly embeddedGoTemplateTags: {
256
+ readonly category: "Embed";
257
+ readonly type: "string";
258
+ readonly array: true;
259
+ readonly default: [{
260
+ readonly value: ["goTemplate", "gotmpl"];
261
+ }];
262
+ readonly description: "Tags that identify embedded Go Template in template literals. Requires the `@htnabe/prettier-plugin-go-template` plugin.";
263
+ };
192
264
  readonly embeddedGraphqlIdentifiers: {
193
265
  readonly category: "Embed";
194
266
  readonly type: "string";
@@ -217,6 +289,24 @@ export declare const options: {
217
289
  }];
218
290
  readonly description: "Tags that make their subsequent template literals be identified as embedded GraphQL language.";
219
291
  };
292
+ readonly embeddedHandlebarsComments: {
293
+ readonly category: "Embed";
294
+ readonly type: "string";
295
+ readonly array: true;
296
+ readonly default: [{
297
+ readonly value: ["handlebars", "hbs"];
298
+ }];
299
+ readonly description: "Block comments that identify embedded Handlebars in template literals. Requires the `@poliklot/prettier-plugin-handlebars` plugin.";
300
+ };
301
+ readonly embeddedHandlebarsTags: {
302
+ readonly category: "Embed";
303
+ readonly type: "string";
304
+ readonly array: true;
305
+ readonly default: [{
306
+ readonly value: ["handlebars", "hbs"];
307
+ }];
308
+ readonly description: "Tags that identify embedded Handlebars in template literals. Requires the `@poliklot/prettier-plugin-handlebars` plugin.";
309
+ };
220
310
  readonly embeddedHtmlIdentifiers: {
221
311
  readonly category: "Embed";
222
312
  readonly type: "string";
@@ -251,10 +341,28 @@ export declare const options: {
251
341
  default: "html";
252
342
  description: string;
253
343
  choices: {
254
- value: "html" | "vue" | "angular" | "lwc";
344
+ value: "angular" | "html" | "lwc" | "vue";
255
345
  description: string;
256
346
  }[];
257
347
  };
348
+ readonly embeddedHugoComments: {
349
+ readonly category: "Embed";
350
+ readonly type: "string";
351
+ readonly array: true;
352
+ readonly default: [{
353
+ readonly value: ["hugo", "hugoPost"];
354
+ }];
355
+ readonly description: "Block comments that identify embedded Hugo in template literals. Requires the `@htnabe/prettier-plugin-hugo-post` plugin.";
356
+ };
357
+ readonly embeddedHugoTags: {
358
+ readonly category: "Embed";
359
+ readonly type: "string";
360
+ readonly array: true;
361
+ readonly default: [{
362
+ readonly value: ["hugo", "hugoPost"];
363
+ }];
364
+ readonly description: "Tags that identify embedded Hugo in template literals. Requires the `@htnabe/prettier-plugin-hugo-post` plugin.";
365
+ };
258
366
  readonly embeddedIniIdentifiers: {
259
367
  readonly category: "Embed";
260
368
  readonly type: "string";
@@ -311,6 +419,24 @@ export declare const options: {
311
419
  }];
312
420
  readonly description: "Tags that make their subsequent template literals be identified as embedded Java language. This option requires the `prettier-plugin-java` plugin.";
313
421
  };
422
+ readonly embeddedJinjaComments: {
423
+ readonly category: "Embed";
424
+ readonly type: "string";
425
+ readonly array: true;
426
+ readonly default: [{
427
+ readonly value: ["jinja", "jinja2", "j2"];
428
+ }];
429
+ readonly description: "Block comments that identify embedded Jinja in template literals. Requires the `prettier-plugin-jinja-template` plugin.";
430
+ };
431
+ readonly embeddedJinjaTags: {
432
+ readonly category: "Embed";
433
+ readonly type: "string";
434
+ readonly array: true;
435
+ readonly default: [{
436
+ readonly value: ["jinja", "jinja2", "j2"];
437
+ }];
438
+ readonly description: "Tags that identify embedded Jinja in template literals. Requires the `prettier-plugin-jinja-template` plugin.";
439
+ };
314
440
  readonly embeddedJsonIdentifiers: {
315
441
  readonly category: "Embed";
316
442
  readonly type: "string";
@@ -345,7 +471,7 @@ export declare const options: {
345
471
  default: "json";
346
472
  description: string;
347
473
  choices: {
348
- value: "json" | "json5" | "jsonc" | "json-stringify";
474
+ value: "json" | "json-stringify" | "json5" | "jsonc";
349
475
  description: string;
350
476
  }[];
351
477
  };
@@ -377,6 +503,24 @@ export declare const options: {
377
503
  }];
378
504
  readonly description: "Tags that make their subsequent template literals be identified as embedded JSONata language. This option requires the `@stedi/prettier-plugin-jsonata` plugin.";
379
505
  };
506
+ readonly embeddedJteComments: {
507
+ readonly category: "Embed";
508
+ readonly type: "string";
509
+ readonly array: true;
510
+ readonly default: [{
511
+ readonly value: ["jte"];
512
+ }];
513
+ readonly description: "Block comments that identify embedded JTE in template literals. Requires the `prettier-plugin-jte` plugin.";
514
+ };
515
+ readonly embeddedJteTags: {
516
+ readonly category: "Embed";
517
+ readonly type: "string";
518
+ readonly array: true;
519
+ readonly default: [{
520
+ readonly value: ["jte"];
521
+ }];
522
+ readonly description: "Tags that identify embedded JTE in template literals. Requires the `prettier-plugin-jte` plugin.";
523
+ };
380
524
  readonly embeddedLatexIdentifiers: {
381
525
  readonly category: "Embed";
382
526
  readonly type: "string";
@@ -405,6 +549,24 @@ export declare const options: {
405
549
  }];
406
550
  readonly description: "Tags that make their subsequent template literals be identified as embedded LaTeX language. This option requires the `prettier-plugin-latex` plugin.";
407
551
  };
552
+ readonly embeddedLiquidComments: {
553
+ readonly category: "Embed";
554
+ readonly type: "string";
555
+ readonly array: true;
556
+ readonly default: [{
557
+ readonly value: ["liquid"];
558
+ }];
559
+ readonly description: "Block comments that identify embedded Liquid in template literals. Requires the `@shopify/prettier-plugin-liquid` plugin.";
560
+ };
561
+ readonly embeddedLiquidTags: {
562
+ readonly category: "Embed";
563
+ readonly type: "string";
564
+ readonly array: true;
565
+ readonly default: [{
566
+ readonly value: ["liquid"];
567
+ }];
568
+ readonly description: "Tags that identify embedded Liquid in template literals. Requires the `@shopify/prettier-plugin-liquid` plugin.";
569
+ };
408
570
  readonly embeddedMarkdownIdentifiers: {
409
571
  readonly category: "Embed";
410
572
  readonly type: "string";
@@ -443,6 +605,60 @@ export declare const options: {
443
605
  description: string;
444
606
  }[];
445
607
  };
608
+ readonly embeddedMarkoComments: {
609
+ readonly category: "Embed";
610
+ readonly type: "string";
611
+ readonly array: true;
612
+ readonly default: [{
613
+ readonly value: ["marko"];
614
+ }];
615
+ readonly description: "Block comments that identify embedded Marko in template literals. Requires the `prettier-plugin-marko` plugin.";
616
+ };
617
+ readonly embeddedMarkoTags: {
618
+ readonly category: "Embed";
619
+ readonly type: "string";
620
+ readonly array: true;
621
+ readonly default: [{
622
+ readonly value: ["marko"];
623
+ }];
624
+ readonly description: "Tags that identify embedded Marko in template literals. Requires the `prettier-plugin-marko` plugin.";
625
+ };
626
+ readonly embeddedMotokoComments: {
627
+ readonly category: "Embed";
628
+ readonly type: "string";
629
+ readonly array: true;
630
+ readonly default: [{
631
+ readonly value: ["motoko", "mo"];
632
+ }];
633
+ readonly description: "Block comments that identify embedded Motoko in template literals. Requires the `prettier-plugin-motoko` plugin.";
634
+ };
635
+ readonly embeddedMotokoTags: {
636
+ readonly category: "Embed";
637
+ readonly type: "string";
638
+ readonly array: true;
639
+ readonly default: [{
640
+ readonly value: ["motoko", "mo"];
641
+ }];
642
+ readonly description: "Tags that identify embedded Motoko in template literals. Requires the `prettier-plugin-motoko` plugin.";
643
+ };
644
+ readonly embeddedMustacheComments: {
645
+ readonly category: "Embed";
646
+ readonly type: "string";
647
+ readonly array: true;
648
+ readonly default: [{
649
+ readonly value: ["mustache"];
650
+ }];
651
+ readonly description: "Block comments that identify embedded Mustache in template literals. Requires the `prettier-plugin-mustache` plugin.";
652
+ };
653
+ readonly embeddedMustacheTags: {
654
+ readonly category: "Embed";
655
+ readonly type: "string";
656
+ readonly array: true;
657
+ readonly default: [{
658
+ readonly value: ["mustache"];
659
+ }];
660
+ readonly description: "Tags that identify embedded Mustache in template literals. Requires the `prettier-plugin-mustache` plugin.";
661
+ };
446
662
  readonly embeddedNginxIdentifiers: {
447
663
  readonly category: "Embed";
448
664
  readonly type: "string";
@@ -471,6 +687,24 @@ export declare const options: {
471
687
  }];
472
688
  readonly description: "Tags that make their subsequent template literals be identified as embedded NGINX language. This option requires the `prettier-plugin-nginx` plugin.";
473
689
  };
690
+ readonly embeddedNunjucksComments: {
691
+ readonly category: "Embed";
692
+ readonly type: "string";
693
+ readonly array: true;
694
+ readonly default: [{
695
+ readonly value: ["nunjucks", "njk"];
696
+ }];
697
+ readonly description: "Block comments that identify embedded Nunjucks in template literals. Requires the `prettier-plugin-nunjucks` plugin.";
698
+ };
699
+ readonly embeddedNunjucksTags: {
700
+ readonly category: "Embed";
701
+ readonly type: "string";
702
+ readonly array: true;
703
+ readonly default: [{
704
+ readonly value: ["nunjucks", "njk"];
705
+ }];
706
+ readonly description: "Tags that identify embedded Nunjucks in template literals. Requires the `prettier-plugin-nunjucks` plugin.";
707
+ };
474
708
  readonly embeddedPegjsIdentifiers: {
475
709
  readonly category: "Embed";
476
710
  readonly type: "string";
@@ -533,7 +767,7 @@ export declare const options: {
533
767
  default: "typescript";
534
768
  description: string;
535
769
  choices: {
536
- value: "typescript" | "babel-ts";
770
+ value: "babel-ts" | "typescript";
537
771
  description: string;
538
772
  }[];
539
773
  };
@@ -565,6 +799,24 @@ export declare const options: {
565
799
  }];
566
800
  readonly description: "Tags that make their subsequent template literals be identified as embedded PHP language. This option requires the `@prettier/plugin-php` plugin.";
567
801
  };
802
+ readonly embeddedPowerShellComments: {
803
+ readonly category: "Embed";
804
+ readonly type: "string";
805
+ readonly array: true;
806
+ readonly default: [{
807
+ readonly value: ["powershell", "ps1"];
808
+ }];
809
+ readonly description: "Block comments that identify embedded PowerShell in template literals. Requires the `prettier-plugin-powershell` plugin.";
810
+ };
811
+ readonly embeddedPowerShellTags: {
812
+ readonly category: "Embed";
813
+ readonly type: "string";
814
+ readonly array: true;
815
+ readonly default: [{
816
+ readonly value: ["powershell", "ps1"];
817
+ }];
818
+ readonly description: "Tags that identify embedded PowerShell in template literals. Requires the `prettier-plugin-powershell` plugin.";
819
+ };
568
820
  readonly embeddedPrismaIdentifiers: {
569
821
  readonly category: "Embed";
570
822
  readonly type: "string";
@@ -683,7 +935,7 @@ export declare const options: {
683
935
  default: "ruby";
684
936
  description: string;
685
937
  choices: {
686
- value: "ruby" | "rbs" | "haml";
938
+ value: "haml" | "rbs" | "ruby";
687
939
  description: string;
688
940
  }[];
689
941
  };
@@ -715,6 +967,40 @@ export declare const options: {
715
967
  }];
716
968
  readonly description: "Tags that make their subsequent template literals be identified as embedded Shell language. This option requires the `prettier-plugin-sh` plugin.";
717
969
  };
970
+ readonly embeddedSolidityComments: {
971
+ readonly category: "Embed";
972
+ readonly type: "string";
973
+ readonly array: true;
974
+ readonly default: [{
975
+ readonly value: ["solidity", "sol"];
976
+ }];
977
+ readonly description: "Block comments that identify embedded Solidity in template literals. Requires the `prettier-plugin-solidity` plugin.";
978
+ };
979
+ readonly embeddedSolidityTags: {
980
+ readonly category: "Embed";
981
+ readonly type: "string";
982
+ readonly array: true;
983
+ readonly default: [{
984
+ readonly value: ["solidity", "sol"];
985
+ }];
986
+ readonly description: "Tags that identify embedded Solidity in template literals. Requires the `prettier-plugin-solidity` plugin.";
987
+ };
988
+ readonly embeddedSolidityParser: {
989
+ readonly category: "Embed";
990
+ readonly type: "choice";
991
+ readonly default: "slang";
992
+ readonly description: "The parser used to format embedded Solidity.";
993
+ readonly choices: [{
994
+ readonly value: "slang";
995
+ readonly description: "Use the `slang` parser.";
996
+ }, {
997
+ readonly value: "antlr";
998
+ readonly description: "Use the `antlr` parser.";
999
+ }, {
1000
+ readonly value: "solidity-parse";
1001
+ readonly description: "Use the `solidity-parse` parser.";
1002
+ }];
1003
+ };
718
1004
  readonly embeddedSqlIdentifiers: {
719
1005
  readonly category: "Embed";
720
1006
  readonly type: "string";
@@ -759,10 +1045,28 @@ export declare const options: {
759
1045
  default: "sqlite";
760
1046
  description: string;
761
1047
  choices: {
762
- value: "sqlite" | "bigquery" | "mysql" | "mariadb" | "postgresql";
1048
+ value: "bigquery" | "mariadb" | "mysql" | "postgresql" | "sqlite";
763
1049
  description: string;
764
1050
  }[];
765
1051
  };
1052
+ readonly embeddedSvelteComments: {
1053
+ readonly category: "Embed";
1054
+ readonly type: "string";
1055
+ readonly array: true;
1056
+ readonly default: [{
1057
+ readonly value: ["svelte"];
1058
+ }];
1059
+ readonly description: "Block comments that identify embedded Svelte in template literals. Requires the `prettier-plugin-svelte` plugin.";
1060
+ };
1061
+ readonly embeddedSvelteTags: {
1062
+ readonly category: "Embed";
1063
+ readonly type: "string";
1064
+ readonly array: true;
1065
+ readonly default: [{
1066
+ readonly value: ["svelte"];
1067
+ }];
1068
+ readonly description: "Tags that identify embedded Svelte in template literals. Requires the `prettier-plugin-svelte` plugin.";
1069
+ };
766
1070
  readonly embeddedTomlIdentifiers: {
767
1071
  readonly category: "Embed";
768
1072
  readonly type: "string";
@@ -828,6 +1132,37 @@ export declare const options: {
828
1132
  }];
829
1133
  readonly description: "This option is read only and is used internally as a workaround to support xml fragments";
830
1134
  };
1135
+ readonly embeddedXQueryComments: {
1136
+ readonly category: "Embed";
1137
+ readonly type: "string";
1138
+ readonly array: true;
1139
+ readonly default: [{
1140
+ readonly value: ["xquery", "xq"];
1141
+ }];
1142
+ readonly description: "Block comments that identify embedded XQuery in template literals. Requires the `prettier-plugin-xquery` plugin.";
1143
+ };
1144
+ readonly embeddedXQueryTags: {
1145
+ readonly category: "Embed";
1146
+ readonly type: "string";
1147
+ readonly array: true;
1148
+ readonly default: [{
1149
+ readonly value: ["xquery", "xq"];
1150
+ }];
1151
+ readonly description: "Tags that identify embedded XQuery in template literals. Requires the `prettier-plugin-xquery` plugin.";
1152
+ };
1153
+ readonly embeddedXQueryParser: {
1154
+ readonly category: "Embed";
1155
+ readonly type: "choice";
1156
+ readonly default: "xquery";
1157
+ readonly description: "The parser used to format embedded XQuery.";
1158
+ readonly choices: [{
1159
+ readonly value: "xquery";
1160
+ readonly description: "Use the `xquery` parser.";
1161
+ }, {
1162
+ readonly value: "xquery4";
1163
+ readonly description: "Use the `xquery4` parser.";
1164
+ }];
1165
+ };
831
1166
  readonly embeddedYamlIdentifiers: {
832
1167
  readonly category: "Embed";
833
1168
  readonly type: "string";
package/dist/parsers.d.ts CHANGED
@@ -1,10 +1,4 @@
1
1
  export declare const parsers: {
2
- embeddedXml: import("prettier").Parser;
3
- meriyah: import("prettier").Parser;
4
- typescript: import("prettier").Parser;
5
- flow: import("prettier").Parser;
6
- acorn: import("prettier").Parser;
7
- espree: import("prettier").Parser;
8
2
  __babel_estree: import("prettier").Parser;
9
3
  __js_expression: import("prettier").Parser;
10
4
  __ts_expression: import("prettier").Parser;
@@ -19,4 +13,10 @@ export declare const parsers: {
19
13
  "json-stringify": import("prettier").Parser;
20
14
  json5: import("prettier").Parser;
21
15
  jsonc: import("prettier").Parser;
16
+ acorn: import("prettier").Parser;
17
+ espree: import("prettier").Parser;
18
+ flow: import("prettier").Parser;
19
+ meriyah: import("prettier").Parser;
20
+ typescript: import("prettier").Parser;
21
+ embeddedXml: import("prettier").Parser;
22
22
  };
@@ -0,0 +1,5 @@
1
+ export type LiteralUnion<LiteralType, BaseType extends string> = LiteralType | (BaseType & Record<never, never>);
2
+ export type OmitIndexSignature<T> = {
3
+ [K in keyof T as Record<never, never> extends Record<K, unknown> ? never : K]: T[K];
4
+ };
5
+ export type UnionToIntersection<T> = (T extends unknown ? (value: T) => void : never) extends (value: infer Intersection) => void ? Intersection & T : never;
package/dist/types.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import type { TemplateLiteral } from "estree";
2
2
  import type { AstPath, Doc, Options } from "prettier";
3
3
  import type { printer } from "prettier/doc";
4
- import type { OmitIndexSignature } from "type-fest";
5
4
  import type { AutocompleteStringList, EmbeddedDefaultComment, EmbeddedDefaultTag, EmbeddedLanguage, makeCommentsOptionName, makeIdentifiersOptionName, makeTagsOptionName, PluginEmbedOptions } from "./embedded/index.js";
6
5
  import type { PluginEmbedLanguageAgnosticOptions } from "./options.js";
6
+ import type { OmitIndexSignature } from "./type-utils.js";
7
7
  export type InternalPrintFun = (selector?: string | number | (string | number)[] | AstPath<TemplateLiteral>) => Doc;
8
8
  export interface EmbedderPayload {
9
9
  commentOrTag: string;
package/dist/utils.d.ts CHANGED
@@ -2,18 +2,18 @@ import type { Expression, Node, TemplateLiteral } from "estree";
2
2
  import { type AstPath, type Options, type Printer } from "prettier";
3
3
  import { type EmbeddedComment, type EmbeddedLanguage, type EmbeddedTag } from "./embedded/index.js";
4
4
  import type { EmbeddedOverride } from "./types.js";
5
- export declare function resolveEmbeddedOverrideOptions(embeddedOverridesString: string | undefined, { commentOrTag, kind, filepath, }: {
5
+ export declare function resolveEmbeddedOverrideOptions(options: Options, { commentOrTag, kind, }: {
6
6
  commentOrTag: EmbeddedComment | EmbeddedTag;
7
7
  kind: "comment" | "tag";
8
- filepath?: string;
9
8
  }): Promise<EmbeddedOverride["options"] | undefined>;
9
+ export declare function matchTagExpressionPattern(tagExpression: Expression, pattern: string): boolean;
10
10
  export declare const compareTagExpressionToTagString: (tagExpression: Expression, tagString: string, parse: (text: string) => Node | Promise<Node>) => boolean;
11
11
  export declare function parseCommentFromTemplateLiteralAstPath({ node, parent, }: AstPath<Node> & {
12
12
  node: TemplateLiteral;
13
13
  }): string | undefined;
14
14
  export declare function parseTagFromTemplateLiteralAstPath({ parent, }: AstPath<Node> & {
15
15
  node: TemplateLiteral;
16
- }): string | TemplateLiteral | import("estree").ArrayExpression | import("estree").ArrowFunctionExpression | import("estree").AssignmentExpression | import("estree").AwaitExpression | import("estree").BinaryExpression | import("estree").CallExpression | import("estree").ChainExpression | import("estree").ClassExpression | import("estree").ConditionalExpression | import("estree").FunctionExpression | import("estree").ImportExpression | import("estree").Literal | import("estree").LogicalExpression | import("estree").MemberExpression | import("estree").MetaProperty | import("estree").ObjectExpression | import("estree").SequenceExpression | import("estree").TaggedTemplateExpression | import("estree").ThisExpression | import("estree").UnaryExpression | import("estree").UpdateExpression | import("estree").YieldExpression | undefined;
16
+ }): string | import("estree").ArrayExpression | import("estree").ArrowFunctionExpression | import("estree").AssignmentExpression | import("estree").AwaitExpression | import("estree").BinaryExpression | import("estree").ChainExpression | import("estree").ClassExpression | import("estree").ConditionalExpression | import("estree").FunctionExpression | import("estree").ImportExpression | import("estree").LogicalExpression | import("estree").MemberExpression | import("estree").MetaProperty | import("estree").ObjectExpression | import("estree").SequenceExpression | import("estree").TaggedTemplateExpression | TemplateLiteral | import("estree").ThisExpression | import("estree").UnaryExpression | import("estree").UpdateExpression | import("estree").YieldExpression | import("estree").CallExpression | import("estree").Literal | undefined;
17
17
  export declare function createCommentsInOptionsGenerator(options: Options, comment: string): (_: EmbeddedLanguage) => Generator<string, void, undefined>;
18
18
  export declare function createTagsInOptionsGenerator(options: Options, tag?: string): (_: EmbeddedLanguage) => Generator<string, void, undefined>;
19
19
  export declare function createEmbeddedDoc(node: TemplateLiteral, embeddedLanguage: EmbeddedLanguage, commentOrTag: EmbeddedComment | EmbeddedTag, kind: "comment" | "tag", options: Options): ReturnType<Exclude<Printer["embed"], undefined>>;