dorian 2.6.8 → 3.0.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 (66) hide show
  1. checksums.yaml +4 -4
  2. data/.node-version +1 -1
  3. data/.npm-version +1 -1
  4. data/.rubocop.yml +25 -21
  5. data/.ruby-version +1 -1
  6. data/.tool-versions +2 -3
  7. data/Gemfile +0 -4
  8. data/Gemfile.lock +63 -116
  9. data/VERSION +1 -1
  10. data/dorian.gemspec +19 -19
  11. data/lib/dorian/bin.rb +82 -75
  12. data/package-lock.json +8 -8
  13. data/package.json +5 -5
  14. data/vendor/prettier/LICENSE +0 -4372
  15. data/vendor/prettier/README.md +14 -19
  16. data/vendor/prettier/THIRD-PARTY-NOTICES.md +6059 -0
  17. data/vendor/prettier/bin/prettier.cjs +27 -18
  18. data/vendor/prettier/doc.d.ts +11 -0
  19. data/vendor/prettier/doc.js +742 -776
  20. data/vendor/prettier/doc.mjs +743 -766
  21. data/vendor/prettier/index.cjs +266 -371
  22. data/vendor/prettier/index.d.ts +43 -16
  23. data/vendor/prettier/index.mjs +9615 -16721
  24. data/vendor/prettier/internal/experimental-cli-worker.mjs +2841 -0
  25. data/vendor/prettier/internal/experimental-cli.mjs +12790 -0
  26. data/vendor/prettier/internal/legacy-cli.mjs +6229 -0
  27. data/vendor/prettier/package.json +113 -108
  28. data/vendor/prettier/plugins/acorn.js +16 -6618
  29. data/vendor/prettier/plugins/acorn.mjs +16 -6456
  30. data/vendor/prettier/plugins/angular.js +4 -2435
  31. data/vendor/prettier/plugins/angular.mjs +4 -2375
  32. data/vendor/prettier/plugins/babel.d.ts +7 -7
  33. data/vendor/prettier/plugins/babel.js +15 -14271
  34. data/vendor/prettier/plugins/babel.mjs +15 -13986
  35. data/vendor/prettier/plugins/estree.d.ts +6 -1
  36. data/vendor/prettier/plugins/estree.js +43 -9486
  37. data/vendor/prettier/plugins/estree.mjs +43 -9278
  38. data/vendor/prettier/plugins/flow.js +19 -51476
  39. data/vendor/prettier/plugins/flow.mjs +19 -51218
  40. data/vendor/prettier/plugins/glimmer.d.ts +5 -1
  41. data/vendor/prettier/plugins/glimmer.js +30 -8527
  42. data/vendor/prettier/plugins/glimmer.mjs +30 -8414
  43. data/vendor/prettier/plugins/graphql.d.ts +5 -1
  44. data/vendor/prettier/plugins/graphql.js +15 -2408
  45. data/vendor/prettier/plugins/graphql.mjs +15 -2334
  46. data/vendor/prettier/plugins/html.d.ts +6 -1
  47. data/vendor/prettier/plugins/html.js +25 -8182
  48. data/vendor/prettier/plugins/html.mjs +25 -8077
  49. data/vendor/prettier/plugins/markdown.d.ts +5 -1
  50. data/vendor/prettier/plugins/markdown.js +57 -9063
  51. data/vendor/prettier/plugins/markdown.mjs +57 -8972
  52. data/vendor/prettier/plugins/meriyah.js +5 -5953
  53. data/vendor/prettier/plugins/meriyah.mjs +5 -5800
  54. data/vendor/prettier/plugins/postcss.d.ts +5 -1
  55. data/vendor/prettier/plugins/postcss.js +61 -9244
  56. data/vendor/prettier/plugins/postcss.mjs +61 -9046
  57. data/vendor/prettier/plugins/typescript.js +15 -38052
  58. data/vendor/prettier/plugins/typescript.mjs +15 -37726
  59. data/vendor/prettier/plugins/yaml.d.ts +5 -1
  60. data/vendor/prettier/plugins/yaml.js +157 -7423
  61. data/vendor/prettier/plugins/yaml.mjs +157 -7327
  62. data/vendor/prettier/standalone.d.ts +1 -1
  63. data/vendor/prettier/standalone.js +29 -3984
  64. data/vendor/prettier/standalone.mjs +29 -3938
  65. metadata +145 -40
  66. data/vendor/prettier/internal/cli.mjs +0 -4366
@@ -296,6 +296,7 @@ export type BuiltInParserName =
296
296
  | "markdown"
297
297
  | "mdx"
298
298
  | "meriyah"
299
+ | "mjml"
299
300
  | "scss"
300
301
  | "typescript"
301
302
  | "vue"
@@ -303,7 +304,7 @@ export type BuiltInParserName =
303
304
  export type BuiltInParsers = Record<BuiltInParserName, BuiltInParser>;
304
305
 
305
306
  /**
306
- * For use in `.prettierrc.js`, `.prettierrc.cjs`, `prettierrc.mjs`, `prettier.config.js`, `prettier.config.cjs`, `prettier.config.mjs`
307
+ * For use in `.prettierrc.js`, `.prettierrc.ts`, `.prettierrc.cjs`, `.prettierrc.cts`, `prettierrc.mjs`, `prettierrc.mts`, `prettier.config.js`, `prettier.config.ts`, `prettier.config.cjs`, `prettier.config.cts`, `prettier.config.mjs`, `prettier.config.mts`
307
308
  */
308
309
  export interface Config extends Options {
309
310
  overrides?: Array<{
@@ -341,6 +342,11 @@ export interface RequiredOptions extends doc.printer.Options {
341
342
  * @default true
342
343
  */
343
344
  bracketSpacing: boolean;
345
+ /**
346
+ * How to wrap object literals.
347
+ * @default "preserve"
348
+ */
349
+ objectWrap: "preserve" | "collapse";
344
350
  /**
345
351
  * Put the `>` of a multi-line HTML (HTML, JSX, Vue, Angular) element at the end of the last line instead of being
346
352
  * alone on the next line (does not apply to self closing elements).
@@ -379,6 +385,11 @@ export interface RequiredOptions extends doc.printer.Options {
379
385
  * @default false
380
386
  */
381
387
  insertPragma: boolean;
388
+ /**
389
+ * Prettier can allow individual files to opt out of formatting if they contain a special comment, called a pragma, at the top of the file.
390
+ * @default false
391
+ */
392
+ checkIgnorePragma: boolean;
382
393
  /**
383
394
  * By default, Prettier will wrap markdown text as-is since some services use a linebreak-sensitive renderer.
384
395
  * In some cases you may want to rely on editor/viewer soft wrapping instead, so this option allows you to opt out.
@@ -393,7 +404,7 @@ export interface RequiredOptions extends doc.printer.Options {
393
404
  /**
394
405
  * Provide ability to support new languages to prettier.
395
406
  */
396
- plugins: Array<string | Plugin>;
407
+ plugins: Array<string | URL | Plugin>;
397
408
  /**
398
409
  * How to handle whitespaces in HTML.
399
410
  * @default "css"
@@ -424,6 +435,11 @@ export interface RequiredOptions extends doc.printer.Options {
424
435
  * @default false
425
436
  */
426
437
  singleAttributePerLine: boolean;
438
+ /**
439
+ * Where to print operators when binary expressions wrap lines.
440
+ * @default "end"
441
+ */
442
+ experimentalOperatorPosition: "start" | "end";
427
443
  /**
428
444
  * Use curious ternaries, with the question mark after the condition, instead
429
445
  * of on the same line as the consequent.
@@ -460,10 +476,11 @@ export interface Parser<T = any> {
460
476
  parse: (text: string, options: ParserOptions<T>) => T | Promise<T>;
461
477
  astFormat: string;
462
478
  hasPragma?: ((text: string) => boolean) | undefined;
479
+ hasIgnorePragma?: ((text: string) => boolean) | undefined;
463
480
  locStart: (node: T) => number;
464
481
  locEnd: (node: T) => number;
465
482
  preprocess?:
466
- | ((text: string, options: ParserOptions<T>) => string)
483
+ | ((text: string, options: ParserOptions<T>) => string | Promise<string>)
467
484
  | undefined;
468
485
  }
469
486
 
@@ -474,6 +491,12 @@ export interface Printer<T = any> {
474
491
  print: (path: AstPath<T>) => Doc,
475
492
  args?: unknown,
476
493
  ): Doc;
494
+ printPrettierIgnored?(
495
+ path: AstPath<T>,
496
+ options: ParserOptions<T>,
497
+ print: (path: AstPath<T>) => Doc,
498
+ args?: unknown,
499
+ ): Doc;
477
500
  embed?:
478
501
  | ((
479
502
  path: AstPath,
@@ -503,7 +526,7 @@ export interface Printer<T = any> {
503
526
  | ((original: any, cloned: any, parent: any) => any)
504
527
  | undefined;
505
528
  hasPrettierIgnore?: ((path: AstPath<T>) => boolean) | undefined;
506
- canAttachComment?: ((node: T) => boolean) | undefined;
529
+ canAttachComment?: ((node: T, ancestors: T[]) => boolean) | undefined;
507
530
  isBlockComment?: ((node: T) => boolean) | undefined;
508
531
  willPrintOwnComments?: ((path: AstPath<T>) => boolean) | undefined;
509
532
  printComment?:
@@ -568,7 +591,7 @@ export interface CursorResult {
568
591
  }
569
592
 
570
593
  /**
571
- * `format` is used to format text using Prettier. [Options](https://prettier.io/docs/en/options.html) may be provided to override the defaults.
594
+ * `format` is used to format text using Prettier. [Options](https://prettier.io/docs/options) may be provided to override the defaults.
572
595
  */
573
596
  export function format(source: string, options?: Options): Promise<string>;
574
597
 
@@ -597,7 +620,7 @@ export interface ResolveConfigOptions {
597
620
  /**
598
621
  * Pass directly the path of the config file if you don't wish to search for it.
599
622
  */
600
- config?: string | undefined;
623
+ config?: string | URL | undefined;
601
624
  /**
602
625
  * If set to `true` and an `.editorconfig` file is in your project,
603
626
  * Prettier will parse it and convert its properties to the corresponding prettier configuration.
@@ -617,7 +640,7 @@ export interface ResolveConfigOptions {
617
640
  *
618
641
  * A promise is returned which will resolve to:
619
642
  *
620
- * - An options object, providing a [config file](https://prettier.io/docs/en/configuration.html) was found.
643
+ * - An options object, providing a [config file](https://prettier.io/docs/configuration) was found.
621
644
  * - `null`, if no file was found.
622
645
  *
623
646
  * The promise will be rejected if there was an error parsing the configuration file.
@@ -650,7 +673,6 @@ export function clearConfigCache(): Promise<void>;
650
673
 
651
674
  export interface SupportLanguage {
652
675
  name: string;
653
- since?: string | undefined;
654
676
  parsers: BuiltInParserName[] | string[];
655
677
  group?: string | undefined;
656
678
  tmScope?: string | undefined;
@@ -663,6 +685,7 @@ export interface SupportLanguage {
663
685
  linguistLanguageId?: number | undefined;
664
686
  vscodeLanguageIds?: string[] | undefined;
665
687
  interpreters?: string[] | undefined;
688
+ isSupported?: ((options: { filepath: string }) => boolean) | undefined;
666
689
  }
667
690
 
668
691
  export interface SupportOptionRange {
@@ -743,18 +766,17 @@ export interface BooleanSupportOption extends BaseSupportOption<"boolean"> {
743
766
  oppositeDescription?: string | undefined;
744
767
  }
745
768
 
746
- export interface BooleanArraySupportOption
747
- extends BaseSupportOption<"boolean"> {
769
+ export interface BooleanArraySupportOption extends BaseSupportOption<"boolean"> {
748
770
  default?: Array<{ value: boolean[] }> | undefined;
749
771
  array: true;
750
772
  }
751
773
 
752
- export interface ChoiceSupportOption<Value = any>
753
- extends BaseSupportOption<"choice"> {
774
+ export interface ChoiceSupportOption<
775
+ Value = any,
776
+ > extends BaseSupportOption<"choice"> {
754
777
  default?: Value | Array<{ value: Value }> | undefined;
755
778
  description: string;
756
779
  choices: Array<{
757
- since?: string | undefined;
758
780
  value: Value;
759
781
  description: string;
760
782
  }>;
@@ -791,7 +813,7 @@ export interface SupportInfo {
791
813
  export interface FileInfoOptions {
792
814
  ignorePath?: string | URL | (string | URL)[] | undefined;
793
815
  withNodeModules?: boolean | undefined;
794
- plugins?: Array<string | Plugin> | undefined;
816
+ plugins?: Array<string | URL | Plugin> | undefined;
795
817
  resolveConfig?: boolean | undefined;
796
818
  }
797
819
 
@@ -806,7 +828,7 @@ export function getFileInfo(
806
828
  ): Promise<FileInfoResult>;
807
829
 
808
830
  export interface SupportInfoOptions {
809
- plugins?: Array<string | Plugin> | undefined;
831
+ plugins?: Array<string | URL | Plugin> | undefined;
810
832
  showDeprecated?: boolean | undefined;
811
833
  }
812
834
 
@@ -822,7 +844,7 @@ export function getSupportInfo(
822
844
  */
823
845
  export const version: string;
824
846
 
825
- // https://github.com/prettier/prettier/blob/next/src/utils/public.js
847
+ // https://github.com/prettier/prettier/blob/main/src/utilities/public.js
826
848
  export namespace util {
827
849
  interface SkipOptions {
828
850
  backwards?: boolean | undefined;
@@ -938,4 +960,9 @@ export namespace util {
938
960
  function addDanglingComment(node: any, comment: any, marker: any): void;
939
961
 
940
962
  function addTrailingComment(node: any, comment: any): void;
963
+
964
+ function getPreferredQuote(
965
+ text: string,
966
+ preferredQuoteOrPreferSingleQuote: Quote | boolean,
967
+ ): Quote;
941
968
  }