prettier 3.0.0-alpha.1 → 3.0.0-alpha.3

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.
package/internal/cli.mjs CHANGED
@@ -415,148 +415,6 @@ var require_dashify = __commonJS({
415
415
  }
416
416
  });
417
417
 
418
- // node_modules/outdent/lib/index.js
419
- var require_lib = __commonJS({
420
- "node_modules/outdent/lib/index.js"(exports, module) {
421
- "use strict";
422
- Object.defineProperty(exports, "__esModule", { value: true });
423
- exports.outdent = void 0;
424
- function noop() {
425
- var args = [];
426
- for (var _i = 0; _i < arguments.length; _i++) {
427
- args[_i] = arguments[_i];
428
- }
429
- }
430
- function createWeakMap() {
431
- if (typeof WeakMap !== "undefined") {
432
- return /* @__PURE__ */ new WeakMap();
433
- } else {
434
- return fakeSetOrMap();
435
- }
436
- }
437
- function fakeSetOrMap() {
438
- return {
439
- add: noop,
440
- delete: noop,
441
- get: noop,
442
- set: noop,
443
- has: function(k) {
444
- return false;
445
- }
446
- };
447
- }
448
- var hop = Object.prototype.hasOwnProperty;
449
- var has = function(obj, prop) {
450
- return hop.call(obj, prop);
451
- };
452
- function extend(target, source) {
453
- for (var prop in source) {
454
- if (has(source, prop)) {
455
- target[prop] = source[prop];
456
- }
457
- }
458
- return target;
459
- }
460
- var reLeadingNewline = /^[ \t]*(?:\r\n|\r|\n)/;
461
- var reTrailingNewline = /(?:\r\n|\r|\n)[ \t]*$/;
462
- var reStartsWithNewlineOrIsEmpty = /^(?:[\r\n]|$)/;
463
- var reDetectIndentation = /(?:\r\n|\r|\n)([ \t]*)(?:[^ \t\r\n]|$)/;
464
- var reOnlyWhitespaceWithAtLeastOneNewline = /^[ \t]*[\r\n][ \t\r\n]*$/;
465
- function _outdentArray(strings, firstInterpolatedValueSetsIndentationLevel, options2) {
466
- var indentationLevel = 0;
467
- var match = strings[0].match(reDetectIndentation);
468
- if (match) {
469
- indentationLevel = match[1].length;
470
- }
471
- var reSource = "(\\r\\n|\\r|\\n).{0," + indentationLevel + "}";
472
- var reMatchIndent = new RegExp(reSource, "g");
473
- if (firstInterpolatedValueSetsIndentationLevel) {
474
- strings = strings.slice(1);
475
- }
476
- var newline = options2.newline, trimLeadingNewline = options2.trimLeadingNewline, trimTrailingNewline = options2.trimTrailingNewline;
477
- var normalizeNewlines = typeof newline === "string";
478
- var l = strings.length;
479
- var outdentedStrings = strings.map(function(v, i) {
480
- v = v.replace(reMatchIndent, "$1");
481
- if (i === 0 && trimLeadingNewline) {
482
- v = v.replace(reLeadingNewline, "");
483
- }
484
- if (i === l - 1 && trimTrailingNewline) {
485
- v = v.replace(reTrailingNewline, "");
486
- }
487
- if (normalizeNewlines) {
488
- v = v.replace(/\r\n|\n|\r/g, function(_) {
489
- return newline;
490
- });
491
- }
492
- return v;
493
- });
494
- return outdentedStrings;
495
- }
496
- function concatStringsAndValues(strings, values) {
497
- var ret = "";
498
- for (var i = 0, l = strings.length; i < l; i++) {
499
- ret += strings[i];
500
- if (i < l - 1) {
501
- ret += values[i];
502
- }
503
- }
504
- return ret;
505
- }
506
- function isTemplateStringsArray(v) {
507
- return has(v, "raw") && has(v, "length");
508
- }
509
- function createInstance(options2) {
510
- var arrayAutoIndentCache = createWeakMap();
511
- var arrayFirstInterpSetsIndentCache = createWeakMap();
512
- function outdent2(stringsOrOptions) {
513
- var values = [];
514
- for (var _i = 1; _i < arguments.length; _i++) {
515
- values[_i - 1] = arguments[_i];
516
- }
517
- if (isTemplateStringsArray(stringsOrOptions)) {
518
- var strings = stringsOrOptions;
519
- var firstInterpolatedValueSetsIndentationLevel = (values[0] === outdent2 || values[0] === defaultOutdent) && reOnlyWhitespaceWithAtLeastOneNewline.test(strings[0]) && reStartsWithNewlineOrIsEmpty.test(strings[1]);
520
- var cache = firstInterpolatedValueSetsIndentationLevel ? arrayFirstInterpSetsIndentCache : arrayAutoIndentCache;
521
- var renderedArray = cache.get(strings);
522
- if (!renderedArray) {
523
- renderedArray = _outdentArray(strings, firstInterpolatedValueSetsIndentationLevel, options2);
524
- cache.set(strings, renderedArray);
525
- }
526
- if (values.length === 0) {
527
- return renderedArray[0];
528
- }
529
- var rendered = concatStringsAndValues(renderedArray, firstInterpolatedValueSetsIndentationLevel ? values.slice(1) : values);
530
- return rendered;
531
- } else {
532
- return createInstance(extend(extend({}, options2), stringsOrOptions || {}));
533
- }
534
- }
535
- var fullOutdent = extend(outdent2, {
536
- string: function(str) {
537
- return _outdentArray([str], false, options2)[0];
538
- }
539
- });
540
- return fullOutdent;
541
- }
542
- var defaultOutdent = createInstance({
543
- trimLeadingNewline: true,
544
- trimTrailingNewline: true
545
- });
546
- exports.outdent = defaultOutdent;
547
- exports.default = defaultOutdent;
548
- if (typeof module !== "undefined") {
549
- try {
550
- module.exports = defaultOutdent;
551
- Object.defineProperty(defaultOutdent, "__esModule", { value: true });
552
- defaultOutdent.default = defaultOutdent;
553
- defaultOutdent.outdent = defaultOutdent;
554
- } catch (e) {
555
- }
556
- }
557
- }
558
- });
559
-
560
418
  // node_modules/minimist/index.js
561
419
  var require_minimist = __commonJS({
562
420
  "node_modules/minimist/index.js"(exports, module) {
@@ -4714,8 +4572,8 @@ var require_queue = __commonJS({
4714
4572
  var errorHandler = null;
4715
4573
  var self = {
4716
4574
  push,
4717
- drain: noop,
4718
- saturated: noop,
4575
+ drain: noop2,
4576
+ saturated: noop2,
4719
4577
  pause,
4720
4578
  paused: false,
4721
4579
  concurrency,
@@ -4725,7 +4583,7 @@ var require_queue = __commonJS({
4725
4583
  length,
4726
4584
  getQueue,
4727
4585
  unshift,
4728
- empty: noop,
4586
+ empty: noop2,
4729
4587
  kill,
4730
4588
  killAndDrain,
4731
4589
  error
@@ -4772,7 +4630,7 @@ var require_queue = __commonJS({
4772
4630
  current.context = context;
4773
4631
  current.release = release;
4774
4632
  current.value = value;
4775
- current.callback = done || noop;
4633
+ current.callback = done || noop2;
4776
4634
  current.errorHandler = errorHandler;
4777
4635
  if (_running === self.concurrency || self.paused) {
4778
4636
  if (queueTail) {
@@ -4793,7 +4651,7 @@ var require_queue = __commonJS({
4793
4651
  current.context = context;
4794
4652
  current.release = release;
4795
4653
  current.value = value;
4796
- current.callback = done || noop;
4654
+ current.callback = done || noop2;
4797
4655
  if (_running === self.concurrency || self.paused) {
4798
4656
  if (queueHead) {
4799
4657
  current.next = queueHead;
@@ -4834,25 +4692,25 @@ var require_queue = __commonJS({
4834
4692
  function kill() {
4835
4693
  queueHead = null;
4836
4694
  queueTail = null;
4837
- self.drain = noop;
4695
+ self.drain = noop2;
4838
4696
  }
4839
4697
  function killAndDrain() {
4840
4698
  queueHead = null;
4841
4699
  queueTail = null;
4842
4700
  self.drain();
4843
- self.drain = noop;
4701
+ self.drain = noop2;
4844
4702
  }
4845
4703
  function error(handler) {
4846
4704
  errorHandler = handler;
4847
4705
  }
4848
4706
  }
4849
- function noop() {
4707
+ function noop2() {
4850
4708
  }
4851
4709
  function Task() {
4852
4710
  this.value = null;
4853
- this.callback = noop;
4711
+ this.callback = noop2;
4854
4712
  this.next = null;
4855
- this.release = noop;
4713
+ this.release = noop2;
4856
4714
  this.context = null;
4857
4715
  this.errorHandler = null;
4858
4716
  var self = this;
@@ -4861,7 +4719,7 @@ var require_queue = __commonJS({
4861
4719
  var errorHandler = self.errorHandler;
4862
4720
  var val = self.value;
4863
4721
  self.value = null;
4864
- self.callback = noop;
4722
+ self.callback = noop2;
4865
4723
  if (self.errorHandler) {
4866
4724
  errorHandler(err, val);
4867
4725
  }
@@ -4897,7 +4755,7 @@ var require_queue = __commonJS({
4897
4755
  resolve(result);
4898
4756
  });
4899
4757
  });
4900
- p.catch(noop);
4758
+ p.catch(noop2);
4901
4759
  return p;
4902
4760
  }
4903
4761
  function unshift(value) {
@@ -4910,7 +4768,7 @@ var require_queue = __commonJS({
4910
4768
  resolve(result);
4911
4769
  });
4912
4770
  });
4913
- p.catch(noop);
4771
+ p.catch(noop2);
4914
4772
  return p;
4915
4773
  }
4916
4774
  function drained() {
@@ -7670,7 +7528,7 @@ var require_cjs = __commonJS({
7670
7528
  var primitive = "string";
7671
7529
  var ignore = {};
7672
7530
  var object = "object";
7673
- var noop = (_, value) => value;
7531
+ var noop2 = (_, value) => value;
7674
7532
  var primitives = (value) => value instanceof Primitive ? Primitive(value) : value;
7675
7533
  var Primitives = (_, value) => typeof value === primitive ? new Primitive(value) : value;
7676
7534
  var revive = (input, parsed, output, $) => {
@@ -7703,13 +7561,13 @@ var require_cjs = __commonJS({
7703
7561
  var parse = (text, reviver) => {
7704
7562
  const input = $parse(text, Primitives).map(primitives);
7705
7563
  const value = input[0];
7706
- const $ = reviver || noop;
7564
+ const $ = reviver || noop2;
7707
7565
  const tmp = typeof value === object && value ? revive(input, /* @__PURE__ */ new Set(), value, $) : value;
7708
7566
  return $.call({ "": tmp }, "", tmp);
7709
7567
  };
7710
7568
  exports.parse = parse;
7711
7569
  var stringify4 = (value, replacer, space) => {
7712
- const $ = replacer && typeof replacer === object ? (k, v) => k === "" || -1 < replacer.indexOf(k) ? v : void 0 : replacer || noop;
7570
+ const $ = replacer && typeof replacer === object ? (k, v) => k === "" || -1 < replacer.indexOf(k) ? v : void 0 : replacer || noop2;
7713
7571
  const known = /* @__PURE__ */ new Map();
7714
7572
  const input = [];
7715
7573
  const output = [];
@@ -9635,7 +9493,7 @@ var require_glob = __commonJS({
9635
9493
  glob.sync = globSync;
9636
9494
  var GlobSync = glob.GlobSync = globSync.GlobSync;
9637
9495
  glob.glob = glob;
9638
- function extend(origin, add) {
9496
+ function extend2(origin, add) {
9639
9497
  if (add === null || typeof add !== "object") {
9640
9498
  return origin;
9641
9499
  }
@@ -9647,7 +9505,7 @@ var require_glob = __commonJS({
9647
9505
  return origin;
9648
9506
  }
9649
9507
  glob.hasMagic = function(pattern, options_) {
9650
- var options2 = extend({}, options_);
9508
+ var options2 = extend2({}, options_);
9651
9509
  options2.noprocess = true;
9652
9510
  var g = new Glob(pattern, options2);
9653
9511
  var set = g.minimatch.set;
@@ -11271,90 +11129,94 @@ var ANSI_BACKGROUND_OFFSET = 10;
11271
11129
  var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
11272
11130
  var wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
11273
11131
  var wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
11132
+ var styles = {
11133
+ modifier: {
11134
+ reset: [0, 0],
11135
+ bold: [1, 22],
11136
+ dim: [2, 22],
11137
+ italic: [3, 23],
11138
+ underline: [4, 24],
11139
+ overline: [53, 55],
11140
+ inverse: [7, 27],
11141
+ hidden: [8, 28],
11142
+ strikethrough: [9, 29]
11143
+ },
11144
+ color: {
11145
+ black: [30, 39],
11146
+ red: [31, 39],
11147
+ green: [32, 39],
11148
+ yellow: [33, 39],
11149
+ blue: [34, 39],
11150
+ magenta: [35, 39],
11151
+ cyan: [36, 39],
11152
+ white: [37, 39],
11153
+ blackBright: [90, 39],
11154
+ gray: [90, 39],
11155
+ grey: [90, 39],
11156
+ redBright: [91, 39],
11157
+ greenBright: [92, 39],
11158
+ yellowBright: [93, 39],
11159
+ blueBright: [94, 39],
11160
+ magentaBright: [95, 39],
11161
+ cyanBright: [96, 39],
11162
+ whiteBright: [97, 39]
11163
+ },
11164
+ bgColor: {
11165
+ bgBlack: [40, 49],
11166
+ bgRed: [41, 49],
11167
+ bgGreen: [42, 49],
11168
+ bgYellow: [43, 49],
11169
+ bgBlue: [44, 49],
11170
+ bgMagenta: [45, 49],
11171
+ bgCyan: [46, 49],
11172
+ bgWhite: [47, 49],
11173
+ bgBlackBright: [100, 49],
11174
+ bgGray: [100, 49],
11175
+ bgGrey: [100, 49],
11176
+ bgRedBright: [101, 49],
11177
+ bgGreenBright: [102, 49],
11178
+ bgYellowBright: [103, 49],
11179
+ bgBlueBright: [104, 49],
11180
+ bgMagentaBright: [105, 49],
11181
+ bgCyanBright: [106, 49],
11182
+ bgWhiteBright: [107, 49]
11183
+ }
11184
+ };
11185
+ var modifierNames = Object.keys(styles.modifier);
11186
+ var foregroundColorNames = Object.keys(styles.color);
11187
+ var backgroundColorNames = Object.keys(styles.bgColor);
11188
+ var colorNames = [...foregroundColorNames, ...backgroundColorNames];
11274
11189
  function assembleStyles() {
11275
11190
  const codes = /* @__PURE__ */ new Map();
11276
- const styles2 = {
11277
- modifier: {
11278
- reset: [0, 0],
11279
- bold: [1, 22],
11280
- dim: [2, 22],
11281
- italic: [3, 23],
11282
- underline: [4, 24],
11283
- overline: [53, 55],
11284
- inverse: [7, 27],
11285
- hidden: [8, 28],
11286
- strikethrough: [9, 29]
11287
- },
11288
- color: {
11289
- black: [30, 39],
11290
- red: [31, 39],
11291
- green: [32, 39],
11292
- yellow: [33, 39],
11293
- blue: [34, 39],
11294
- magenta: [35, 39],
11295
- cyan: [36, 39],
11296
- white: [37, 39],
11297
- blackBright: [90, 39],
11298
- redBright: [91, 39],
11299
- greenBright: [92, 39],
11300
- yellowBright: [93, 39],
11301
- blueBright: [94, 39],
11302
- magentaBright: [95, 39],
11303
- cyanBright: [96, 39],
11304
- whiteBright: [97, 39]
11305
- },
11306
- bgColor: {
11307
- bgBlack: [40, 49],
11308
- bgRed: [41, 49],
11309
- bgGreen: [42, 49],
11310
- bgYellow: [43, 49],
11311
- bgBlue: [44, 49],
11312
- bgMagenta: [45, 49],
11313
- bgCyan: [46, 49],
11314
- bgWhite: [47, 49],
11315
- bgBlackBright: [100, 49],
11316
- bgRedBright: [101, 49],
11317
- bgGreenBright: [102, 49],
11318
- bgYellowBright: [103, 49],
11319
- bgBlueBright: [104, 49],
11320
- bgMagentaBright: [105, 49],
11321
- bgCyanBright: [106, 49],
11322
- bgWhiteBright: [107, 49]
11323
- }
11324
- };
11325
- styles2.color.gray = styles2.color.blackBright;
11326
- styles2.bgColor.bgGray = styles2.bgColor.bgBlackBright;
11327
- styles2.color.grey = styles2.color.blackBright;
11328
- styles2.bgColor.bgGrey = styles2.bgColor.bgBlackBright;
11329
- for (const [groupName, group] of Object.entries(styles2)) {
11191
+ for (const [groupName, group] of Object.entries(styles)) {
11330
11192
  for (const [styleName, style] of Object.entries(group)) {
11331
- styles2[styleName] = {
11193
+ styles[styleName] = {
11332
11194
  open: `\x1B[${style[0]}m`,
11333
11195
  close: `\x1B[${style[1]}m`
11334
11196
  };
11335
- group[styleName] = styles2[styleName];
11197
+ group[styleName] = styles[styleName];
11336
11198
  codes.set(style[0], style[1]);
11337
11199
  }
11338
- Object.defineProperty(styles2, groupName, {
11200
+ Object.defineProperty(styles, groupName, {
11339
11201
  value: group,
11340
11202
  enumerable: false
11341
11203
  });
11342
11204
  }
11343
- Object.defineProperty(styles2, "codes", {
11205
+ Object.defineProperty(styles, "codes", {
11344
11206
  value: codes,
11345
11207
  enumerable: false
11346
11208
  });
11347
- styles2.color.close = "\x1B[39m";
11348
- styles2.bgColor.close = "\x1B[49m";
11349
- styles2.color.ansi = wrapAnsi16();
11350
- styles2.color.ansi256 = wrapAnsi256();
11351
- styles2.color.ansi16m = wrapAnsi16m();
11352
- styles2.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
11353
- styles2.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
11354
- styles2.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
11355
- Object.defineProperties(styles2, {
11209
+ styles.color.close = "\x1B[39m";
11210
+ styles.bgColor.close = "\x1B[49m";
11211
+ styles.color.ansi = wrapAnsi16();
11212
+ styles.color.ansi256 = wrapAnsi256();
11213
+ styles.color.ansi16m = wrapAnsi16m();
11214
+ styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
11215
+ styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
11216
+ styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
11217
+ Object.defineProperties(styles, {
11356
11218
  rgbToAnsi256: {
11357
- value: (red, green, blue) => {
11219
+ value(red, green, blue) {
11358
11220
  if (red === green && green === blue) {
11359
11221
  if (red < 8) {
11360
11222
  return 16;
@@ -11369,12 +11231,12 @@ function assembleStyles() {
11369
11231
  enumerable: false
11370
11232
  },
11371
11233
  hexToRgb: {
11372
- value: (hex) => {
11373
- const matches = /(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(hex.toString(16));
11234
+ value(hex) {
11235
+ const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
11374
11236
  if (!matches) {
11375
11237
  return [0, 0, 0];
11376
11238
  }
11377
- let { colorString } = matches.groups;
11239
+ let [colorString] = matches;
11378
11240
  if (colorString.length === 3) {
11379
11241
  colorString = [...colorString].map((character) => character + character).join("");
11380
11242
  }
@@ -11388,11 +11250,11 @@ function assembleStyles() {
11388
11250
  enumerable: false
11389
11251
  },
11390
11252
  hexToAnsi256: {
11391
- value: (hex) => styles2.rgbToAnsi256(...styles2.hexToRgb(hex)),
11253
+ value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
11392
11254
  enumerable: false
11393
11255
  },
11394
11256
  ansi256ToAnsi: {
11395
- value: (code) => {
11257
+ value(code) {
11396
11258
  if (code < 8) {
11397
11259
  return 30 + code;
11398
11260
  }
@@ -11426,15 +11288,15 @@ function assembleStyles() {
11426
11288
  enumerable: false
11427
11289
  },
11428
11290
  rgbToAnsi: {
11429
- value: (red, green, blue) => styles2.ansi256ToAnsi(styles2.rgbToAnsi256(red, green, blue)),
11291
+ value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),
11430
11292
  enumerable: false
11431
11293
  },
11432
11294
  hexToAnsi: {
11433
- value: (hex) => styles2.ansi256ToAnsi(styles2.hexToAnsi256(hex)),
11295
+ value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),
11434
11296
  enumerable: false
11435
11297
  }
11436
11298
  });
11437
- return styles2;
11299
+ return styles;
11438
11300
  }
11439
11301
  var ansiStyles = assembleStyles();
11440
11302
  var ansi_styles_default = ansiStyles;
@@ -11567,7 +11429,7 @@ function stringReplaceAll(string, substring, replacer) {
11567
11429
  let endIndex = 0;
11568
11430
  let returnValue = "";
11569
11431
  do {
11570
- returnValue += string.substr(endIndex, index - endIndex) + substring + replacer;
11432
+ returnValue += string.slice(endIndex, index) + substring + replacer;
11571
11433
  endIndex = index + substringLength;
11572
11434
  index = string.indexOf(substring, endIndex);
11573
11435
  } while (index !== -1);
@@ -11579,7 +11441,7 @@ function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {
11579
11441
  let returnValue = "";
11580
11442
  do {
11581
11443
  const gotCR = string[index - 1] === "\r";
11582
- returnValue += string.substr(endIndex, (gotCR ? index - 1 : index) - endIndex) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
11444
+ returnValue += string.slice(endIndex, gotCR ? index - 1 : index) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
11583
11445
  endIndex = index + 1;
11584
11446
  index = string.indexOf("\n", endIndex);
11585
11447
  } while (index !== -1);
@@ -11598,7 +11460,7 @@ var levelMapping = [
11598
11460
  "ansi256",
11599
11461
  "ansi16m"
11600
11462
  ];
11601
- var styles = /* @__PURE__ */ Object.create(null);
11463
+ var styles2 = /* @__PURE__ */ Object.create(null);
11602
11464
  var applyOptions = (object, options2 = {}) => {
11603
11465
  if (options2.level && !(Number.isInteger(options2.level) && options2.level >= 0 && options2.level <= 3)) {
11604
11466
  throw new Error("The `level` option should be an integer from 0 to 3");
@@ -11617,7 +11479,7 @@ function createChalk(options2) {
11617
11479
  }
11618
11480
  Object.setPrototypeOf(createChalk.prototype, Function.prototype);
11619
11481
  for (const [styleName, style] of Object.entries(ansi_styles_default)) {
11620
- styles[styleName] = {
11482
+ styles2[styleName] = {
11621
11483
  get() {
11622
11484
  const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
11623
11485
  Object.defineProperty(this, styleName, { value: builder });
@@ -11625,7 +11487,7 @@ for (const [styleName, style] of Object.entries(ansi_styles_default)) {
11625
11487
  }
11626
11488
  };
11627
11489
  }
11628
- styles.visible = {
11490
+ styles2.visible = {
11629
11491
  get() {
11630
11492
  const builder = createBuilder(this, this[STYLER], true);
11631
11493
  Object.defineProperty(this, "visible", { value: builder });
@@ -11649,7 +11511,7 @@ var getModelAnsi = (model, level, type, ...arguments_) => {
11649
11511
  };
11650
11512
  var usedModels = ["rgb", "hex", "ansi256"];
11651
11513
  for (const model of usedModels) {
11652
- styles[model] = {
11514
+ styles2[model] = {
11653
11515
  get() {
11654
11516
  const { level } = this;
11655
11517
  return function(...arguments_) {
@@ -11659,7 +11521,7 @@ for (const model of usedModels) {
11659
11521
  }
11660
11522
  };
11661
11523
  const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
11662
- styles[bgModel] = {
11524
+ styles2[bgModel] = {
11663
11525
  get() {
11664
11526
  const { level } = this;
11665
11527
  return function(...arguments_) {
@@ -11671,7 +11533,7 @@ for (const model of usedModels) {
11671
11533
  }
11672
11534
  var proto = Object.defineProperties(() => {
11673
11535
  }, {
11674
- ...styles,
11536
+ ...styles2,
11675
11537
  level: {
11676
11538
  enumerable: true,
11677
11539
  get() {
@@ -11729,7 +11591,7 @@ var applyStyle = (self, string) => {
11729
11591
  }
11730
11592
  return openAll + string + closeAll;
11731
11593
  };
11732
- Object.defineProperties(createChalk.prototype, styles);
11594
+ Object.defineProperties(createChalk.prototype, styles2);
11733
11595
  var chalk = createChalk();
11734
11596
  var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
11735
11597
  var source_default = chalk;
@@ -11846,13 +11708,136 @@ var {
11846
11708
  coreOptions,
11847
11709
  createIgnorer,
11848
11710
  optionsHiddenDefaults,
11849
- normalizeApiOptions,
11850
- normalizeCliOptions,
11851
- getSupportInfoWithoutPlugins
11711
+ normalizeOptions,
11712
+ getSupportInfoWithoutPlugins,
11713
+ vnopts
11852
11714
  } = sharedWithCli;
11853
11715
 
11716
+ // node_modules/outdent/lib-module/index.js
11717
+ function noop() {
11718
+ var args = [];
11719
+ for (var _i = 0; _i < arguments.length; _i++) {
11720
+ args[_i] = arguments[_i];
11721
+ }
11722
+ }
11723
+ function createWeakMap() {
11724
+ if (typeof WeakMap !== "undefined") {
11725
+ return /* @__PURE__ */ new WeakMap();
11726
+ } else {
11727
+ return fakeSetOrMap();
11728
+ }
11729
+ }
11730
+ function fakeSetOrMap() {
11731
+ return {
11732
+ add: noop,
11733
+ delete: noop,
11734
+ get: noop,
11735
+ set: noop,
11736
+ has: function(k) {
11737
+ return false;
11738
+ }
11739
+ };
11740
+ }
11741
+ var hop = Object.prototype.hasOwnProperty;
11742
+ var has = function(obj, prop) {
11743
+ return hop.call(obj, prop);
11744
+ };
11745
+ function extend(target, source) {
11746
+ for (var prop in source) {
11747
+ if (has(source, prop)) {
11748
+ target[prop] = source[prop];
11749
+ }
11750
+ }
11751
+ return target;
11752
+ }
11753
+ var reLeadingNewline = /^[ \t]*(?:\r\n|\r|\n)/;
11754
+ var reTrailingNewline = /(?:\r\n|\r|\n)[ \t]*$/;
11755
+ var reStartsWithNewlineOrIsEmpty = /^(?:[\r\n]|$)/;
11756
+ var reDetectIndentation = /(?:\r\n|\r|\n)([ \t]*)(?:[^ \t\r\n]|$)/;
11757
+ var reOnlyWhitespaceWithAtLeastOneNewline = /^[ \t]*[\r\n][ \t\r\n]*$/;
11758
+ function _outdentArray(strings, firstInterpolatedValueSetsIndentationLevel, options2) {
11759
+ var indentationLevel = 0;
11760
+ var match = strings[0].match(reDetectIndentation);
11761
+ if (match) {
11762
+ indentationLevel = match[1].length;
11763
+ }
11764
+ var reSource = "(\\r\\n|\\r|\\n).{0," + indentationLevel + "}";
11765
+ var reMatchIndent = new RegExp(reSource, "g");
11766
+ if (firstInterpolatedValueSetsIndentationLevel) {
11767
+ strings = strings.slice(1);
11768
+ }
11769
+ var newline = options2.newline, trimLeadingNewline = options2.trimLeadingNewline, trimTrailingNewline = options2.trimTrailingNewline;
11770
+ var normalizeNewlines = typeof newline === "string";
11771
+ var l = strings.length;
11772
+ var outdentedStrings = strings.map(function(v, i) {
11773
+ v = v.replace(reMatchIndent, "$1");
11774
+ if (i === 0 && trimLeadingNewline) {
11775
+ v = v.replace(reLeadingNewline, "");
11776
+ }
11777
+ if (i === l - 1 && trimTrailingNewline) {
11778
+ v = v.replace(reTrailingNewline, "");
11779
+ }
11780
+ if (normalizeNewlines) {
11781
+ v = v.replace(/\r\n|\n|\r/g, function(_) {
11782
+ return newline;
11783
+ });
11784
+ }
11785
+ return v;
11786
+ });
11787
+ return outdentedStrings;
11788
+ }
11789
+ function concatStringsAndValues(strings, values) {
11790
+ var ret = "";
11791
+ for (var i = 0, l = strings.length; i < l; i++) {
11792
+ ret += strings[i];
11793
+ if (i < l - 1) {
11794
+ ret += values[i];
11795
+ }
11796
+ }
11797
+ return ret;
11798
+ }
11799
+ function isTemplateStringsArray(v) {
11800
+ return has(v, "raw") && has(v, "length");
11801
+ }
11802
+ function createInstance(options2) {
11803
+ var arrayAutoIndentCache = createWeakMap();
11804
+ var arrayFirstInterpSetsIndentCache = createWeakMap();
11805
+ function outdent(stringsOrOptions) {
11806
+ var values = [];
11807
+ for (var _i = 1; _i < arguments.length; _i++) {
11808
+ values[_i - 1] = arguments[_i];
11809
+ }
11810
+ if (isTemplateStringsArray(stringsOrOptions)) {
11811
+ var strings = stringsOrOptions;
11812
+ var firstInterpolatedValueSetsIndentationLevel = (values[0] === outdent || values[0] === defaultOutdent) && reOnlyWhitespaceWithAtLeastOneNewline.test(strings[0]) && reStartsWithNewlineOrIsEmpty.test(strings[1]);
11813
+ var cache = firstInterpolatedValueSetsIndentationLevel ? arrayFirstInterpSetsIndentCache : arrayAutoIndentCache;
11814
+ var renderedArray = cache.get(strings);
11815
+ if (!renderedArray) {
11816
+ renderedArray = _outdentArray(strings, firstInterpolatedValueSetsIndentationLevel, options2);
11817
+ cache.set(strings, renderedArray);
11818
+ }
11819
+ if (values.length === 0) {
11820
+ return renderedArray[0];
11821
+ }
11822
+ var rendered = concatStringsAndValues(renderedArray, firstInterpolatedValueSetsIndentationLevel ? values.slice(1) : values);
11823
+ return rendered;
11824
+ } else {
11825
+ return createInstance(extend(extend({}, options2), stringsOrOptions || {}));
11826
+ }
11827
+ }
11828
+ var fullOutdent = extend(outdent, {
11829
+ string: function(str) {
11830
+ return _outdentArray([str], false, options2)[0];
11831
+ }
11832
+ });
11833
+ return fullOutdent;
11834
+ }
11835
+ var defaultOutdent = createInstance({
11836
+ trimLeadingNewline: true,
11837
+ trimTrailingNewline: true
11838
+ });
11839
+
11854
11840
  // src/cli/constant.js
11855
- var import_outdent = __toESM(require_lib(), 1);
11856
11841
  var categoryOrder = [
11857
11842
  coreOptions.CATEGORY_OUTPUT,
11858
11843
  coreOptions.CATEGORY_FORMAT,
@@ -11887,7 +11872,7 @@ var options = {
11887
11872
  check: {
11888
11873
  alias: "c",
11889
11874
  category: coreOptions.CATEGORY_OUTPUT,
11890
- description: import_outdent.outdent`
11875
+ description: defaultOutdent`
11891
11876
  Check if the given files are formatted, print a human-friendly summary
11892
11877
  message and paths to unformatted files (see also --list-different).
11893
11878
  `,
@@ -11918,7 +11903,7 @@ var options = {
11918
11903
  value: "file-override"
11919
11904
  },
11920
11905
  {
11921
- description: import_outdent.outdent`
11906
+ description: defaultOutdent`
11922
11907
  If a config file is found will evaluate it and ignore other CLI options.
11923
11908
  If no config file is found CLI options will evaluate as normal.
11924
11909
  `,
@@ -11960,7 +11945,7 @@ var options = {
11960
11945
  type: "boolean"
11961
11946
  },
11962
11947
  "file-info": {
11963
- description: import_outdent.outdent`
11948
+ description: defaultOutdent`
11964
11949
  Extract the following info (as JSON) for a given file path. Reported fields:
11965
11950
  * ignored (boolean) - true if file path is filtered by --ignore-path
11966
11951
  * inferredParser (string | null) - name of parser inferred from file path
@@ -11974,7 +11959,7 @@ var options = {
11974
11959
  },
11975
11960
  help: {
11976
11961
  alias: "h",
11977
- description: import_outdent.outdent`
11962
+ description: defaultOutdent`
11978
11963
  Show CLI usage, or details about the given flag.
11979
11964
  Example: --help write
11980
11965
  `,
@@ -12029,7 +12014,7 @@ var options = {
12029
12014
  type: "boolean"
12030
12015
  }
12031
12016
  };
12032
- var usageSummary = import_outdent.outdent`
12017
+ var usageSummary = defaultOutdent`
12033
12018
  Usage: prettier [options] [file/dir/glob ...]
12034
12019
 
12035
12020
  By default, output is written to stdout.
@@ -12327,14 +12312,47 @@ function leven(first, second) {
12327
12312
  }
12328
12313
 
12329
12314
  // src/cli/options/normalize-cli-options.js
12330
- function normalizeCliOptions2(options2, optionInfos, opts) {
12331
- return normalizeCliOptions(options2, optionInfos, {
12332
- colorsModule: source_default,
12333
- levenshteinDistance: leven,
12334
- ...opts
12315
+ var descriptor = {
12316
+ key: (key) => key.length === 1 ? `-${key}` : `--${key}`,
12317
+ value: (value) => vnopts.apiDescriptor.value(value),
12318
+ pair: ({ key, value }) => value === false ? `--no-${key}` : value === true ? descriptor.key(key) : value === "" ? `${descriptor.key(key)} without an argument` : `${descriptor.key(key)}=${value}`
12319
+ };
12320
+ var _flags;
12321
+ var FlagSchema = class extends vnopts.ChoiceSchema {
12322
+ constructor({ name, flags }) {
12323
+ super({ name, choices: flags });
12324
+ __privateAdd(this, _flags, []);
12325
+ __privateSet(this, _flags, [...flags].sort());
12326
+ }
12327
+ preprocess(value, utils) {
12328
+ if (typeof value === "string" && value.length > 0 && !__privateGet(this, _flags).includes(value)) {
12329
+ const suggestion = __privateGet(this, _flags).find((flag) => leven(flag, value) < 3);
12330
+ if (suggestion) {
12331
+ utils.logger.warn(
12332
+ [
12333
+ `Unknown flag ${source_default.yellow(utils.descriptor.value(value))},`,
12334
+ `did you mean ${source_default.blue(utils.descriptor.value(suggestion))}?`
12335
+ ].join(" ")
12336
+ );
12337
+ return suggestion;
12338
+ }
12339
+ }
12340
+ return value;
12341
+ }
12342
+ expected() {
12343
+ return "a flag";
12344
+ }
12345
+ };
12346
+ _flags = new WeakMap();
12347
+ function normalizeCliOptions(options2, optionInfos, opts) {
12348
+ return normalizeOptions(options2, optionInfos, {
12349
+ ...opts,
12350
+ isCLI: true,
12351
+ FlagSchema,
12352
+ descriptor
12335
12353
  });
12336
12354
  }
12337
- var normalize_cli_options_default = normalizeCliOptions2;
12355
+ var normalize_cli_options_default = normalizeCliOptions;
12338
12356
 
12339
12357
  // src/cli/options/parse-cli-arguments.js
12340
12358
  function parseArgv(rawArguments, detailedOptions, logger, keys) {
@@ -12812,7 +12830,7 @@ async function getOptionsForFile(context, filepath) {
12812
12830
  filepath,
12813
12831
  ...applyConfigPrecedence(
12814
12832
  context,
12815
- options2 && normalizeApiOptions(options2, context.supportOptions, {
12833
+ options2 && normalizeOptions(options2, context.supportOptions, {
12816
12834
  logger: context.logger
12817
12835
  })
12818
12836
  )
@@ -13028,10 +13046,10 @@ async function format2(context, input, opt) {
13028
13046
  } else {
13029
13047
  const stringify4 = (obj) => JSON.stringify(obj, null, 2);
13030
13048
  const ast = stringify4(
13031
- (await prettier.__debug.parse(input, opt, true)).ast
13049
+ (await prettier.__debug.parse(input, opt, { massage: true })).ast
13032
13050
  );
13033
13051
  const past = stringify4(
13034
- (await prettier.__debug.parse(pp, opt, true)).ast
13052
+ (await prettier.__debug.parse(pp, opt, { massage: true })).ast
13035
13053
  );
13036
13054
  if (ast !== past) {
13037
13055
  const MAX_AST_SIZE = 2097152;