prettier 3.1.0 → 4.0.0-alpha.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.
package/index.mjs CHANGED
@@ -141,7 +141,7 @@ var require_path = __commonJS({
141
141
  Object.defineProperty(exports, "__esModule", { value: true });
142
142
  exports.convertPosixPathToPattern = exports.convertWindowsPathToPattern = exports.convertPathToPattern = exports.escapePosixPath = exports.escapeWindowsPath = exports.escape = exports.removeLeadingDotSegment = exports.makeAbsolute = exports.unixify = void 0;
143
143
  var os2 = __require("os");
144
- var path9 = __require("path");
144
+ var path10 = __require("path");
145
145
  var IS_WINDOWS_PLATFORM = os2.platform() === "win32";
146
146
  var LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2;
147
147
  var POSIX_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g;
@@ -153,7 +153,7 @@ var require_path = __commonJS({
153
153
  }
154
154
  exports.unixify = unixify;
155
155
  function makeAbsolute(cwd, filepath) {
156
- return path9.resolve(cwd, filepath);
156
+ return path10.resolve(cwd, filepath);
157
157
  }
158
158
  exports.makeAbsolute = makeAbsolute;
159
159
  function removeLeadingDotSegment(entry) {
@@ -1197,7 +1197,7 @@ var require_parse = __commonJS({
1197
1197
  CHAR_NO_BREAK_SPACE,
1198
1198
  CHAR_ZERO_WIDTH_NOBREAK_SPACE
1199
1199
  } = require_constants();
1200
- var parse3 = (input, options8 = {}) => {
1200
+ var parse4 = (input, options8 = {}) => {
1201
1201
  if (typeof input !== "string") {
1202
1202
  throw new TypeError("Expected a string");
1203
1203
  }
@@ -1403,7 +1403,7 @@ var require_parse = __commonJS({
1403
1403
  push({ type: "eos" });
1404
1404
  return ast;
1405
1405
  };
1406
- module.exports = parse3;
1406
+ module.exports = parse4;
1407
1407
  }
1408
1408
  });
1409
1409
 
@@ -1414,7 +1414,7 @@ var require_braces = __commonJS({
1414
1414
  var stringify = require_stringify();
1415
1415
  var compile = require_compile();
1416
1416
  var expand = require_expand();
1417
- var parse3 = require_parse();
1417
+ var parse4 = require_parse();
1418
1418
  var braces = (input, options8 = {}) => {
1419
1419
  let output = [];
1420
1420
  if (Array.isArray(input)) {
@@ -1434,7 +1434,7 @@ var require_braces = __commonJS({
1434
1434
  }
1435
1435
  return output;
1436
1436
  };
1437
- braces.parse = (input, options8 = {}) => parse3(input, options8);
1437
+ braces.parse = (input, options8 = {}) => parse4(input, options8);
1438
1438
  braces.stringify = (input, options8 = {}) => {
1439
1439
  if (typeof input === "string") {
1440
1440
  return stringify(braces.parse(input, options8), options8);
@@ -1474,7 +1474,7 @@ var require_braces = __commonJS({
1474
1474
  var require_constants2 = __commonJS({
1475
1475
  "node_modules/picomatch/lib/constants.js"(exports, module) {
1476
1476
  "use strict";
1477
- var path9 = __require("path");
1477
+ var path10 = __require("path");
1478
1478
  var WIN_SLASH = "\\\\/";
1479
1479
  var WIN_NO_SLASH = `[^${WIN_SLASH}]`;
1480
1480
  var DOT_LITERAL = "\\.";
@@ -1644,7 +1644,7 @@ var require_constants2 = __commonJS({
1644
1644
  /* | */
1645
1645
  CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
1646
1646
  /* \uFEFF */
1647
- SEP: path9.sep,
1647
+ SEP: path10.sep,
1648
1648
  /**
1649
1649
  * Create EXTGLOB_CHARS
1650
1650
  */
@@ -1671,7 +1671,7 @@ var require_constants2 = __commonJS({
1671
1671
  var require_utils2 = __commonJS({
1672
1672
  "node_modules/picomatch/lib/utils.js"(exports) {
1673
1673
  "use strict";
1674
- var path9 = __require("path");
1674
+ var path10 = __require("path");
1675
1675
  var win32 = process.platform === "win32";
1676
1676
  var {
1677
1677
  REGEX_BACKSLASH,
@@ -1700,7 +1700,7 @@ var require_utils2 = __commonJS({
1700
1700
  if (options8 && typeof options8.windows === "boolean") {
1701
1701
  return options8.windows;
1702
1702
  }
1703
- return win32 === true || path9.sep === "\\";
1703
+ return win32 === true || path10.sep === "\\";
1704
1704
  };
1705
1705
  exports.escapeLast = (input, char, lastIdx) => {
1706
1706
  const idx = input.lastIndexOf(char, lastIdx);
@@ -2092,7 +2092,7 @@ var require_parse2 = __commonJS({
2092
2092
  var syntaxError = (type, char) => {
2093
2093
  return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
2094
2094
  };
2095
- var parse3 = (input, options8) => {
2095
+ var parse4 = (input, options8) => {
2096
2096
  if (typeof input !== "string") {
2097
2097
  throw new TypeError("Expected a string");
2098
2098
  }
@@ -2242,7 +2242,7 @@ var require_parse2 = __commonJS({
2242
2242
  output = token.close = `)$))${extglobStar}`;
2243
2243
  }
2244
2244
  if (token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
2245
- const expression = parse3(rest, { ...options8, fastpaths: false }).output;
2245
+ const expression = parse4(rest, { ...options8, fastpaths: false }).output;
2246
2246
  output = token.close = `)${expression})${extglobStar})`;
2247
2247
  }
2248
2248
  if (token.prev.type === "bos") {
@@ -2771,7 +2771,7 @@ var require_parse2 = __commonJS({
2771
2771
  }
2772
2772
  return state;
2773
2773
  };
2774
- parse3.fastpaths = (input, options8) => {
2774
+ parse4.fastpaths = (input, options8) => {
2775
2775
  const opts = { ...options8 };
2776
2776
  const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
2777
2777
  const len = input.length;
@@ -2840,7 +2840,7 @@ var require_parse2 = __commonJS({
2840
2840
  }
2841
2841
  return source;
2842
2842
  };
2843
- module.exports = parse3;
2843
+ module.exports = parse4;
2844
2844
  }
2845
2845
  });
2846
2846
 
@@ -2848,9 +2848,9 @@ var require_parse2 = __commonJS({
2848
2848
  var require_picomatch = __commonJS({
2849
2849
  "node_modules/picomatch/lib/picomatch.js"(exports, module) {
2850
2850
  "use strict";
2851
- var path9 = __require("path");
2851
+ var path10 = __require("path");
2852
2852
  var scan = require_scan();
2853
- var parse3 = require_parse2();
2853
+ var parse4 = require_parse2();
2854
2854
  var utils = require_utils2();
2855
2855
  var constants = require_constants2();
2856
2856
  var isObject2 = (val) => val && typeof val === "object" && !Array.isArray(val);
@@ -2934,13 +2934,13 @@ var require_picomatch = __commonJS({
2934
2934
  };
2935
2935
  picomatch.matchBase = (input, glob, options8, posix = utils.isWindows(options8)) => {
2936
2936
  const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options8);
2937
- return regex.test(path9.basename(input));
2937
+ return regex.test(path10.basename(input));
2938
2938
  };
2939
2939
  picomatch.isMatch = (str, patterns, options8) => picomatch(patterns, options8)(str);
2940
2940
  picomatch.parse = (pattern, options8) => {
2941
2941
  if (Array.isArray(pattern))
2942
2942
  return pattern.map((p) => picomatch.parse(p, options8));
2943
- return parse3(pattern, { ...options8, fastpaths: false });
2943
+ return parse4(pattern, { ...options8, fastpaths: false });
2944
2944
  };
2945
2945
  picomatch.scan = (input, options8) => scan(input, options8);
2946
2946
  picomatch.compileRe = (state, options8, returnOutput = false, returnState = false) => {
@@ -2966,10 +2966,10 @@ var require_picomatch = __commonJS({
2966
2966
  }
2967
2967
  let parsed = { negated: false, fastpaths: true };
2968
2968
  if (options8.fastpaths !== false && (input[0] === "." || input[0] === "*")) {
2969
- parsed.output = parse3.fastpaths(input, options8);
2969
+ parsed.output = parse4.fastpaths(input, options8);
2970
2970
  }
2971
2971
  if (!parsed.output) {
2972
- parsed = parse3(input, options8);
2972
+ parsed = parse4(input, options8);
2973
2973
  }
2974
2974
  return picomatch.compileRe(parsed, options8, returnOutput, returnState);
2975
2975
  };
@@ -3164,7 +3164,7 @@ var require_pattern = __commonJS({
3164
3164
  "use strict";
3165
3165
  Object.defineProperty(exports, "__esModule", { value: true });
3166
3166
  exports.removeDuplicateSlashes = exports.matchAny = exports.convertPatternsToRe = exports.makeRe = exports.getPatternParts = exports.expandBraceExpansion = exports.expandPatternsWithBraceExpansion = exports.isAffectDepthOfReadingPattern = exports.endsWithSlashGlobStar = exports.hasGlobStar = exports.getBaseDirectory = exports.isPatternRelatedToParentDirectory = exports.getPatternsOutsideCurrentDirectory = exports.getPatternsInsideCurrentDirectory = exports.getPositivePatterns = exports.getNegativePatterns = exports.isPositivePattern = exports.isNegativePattern = exports.convertToNegativePattern = exports.convertToPositivePattern = exports.isDynamicPattern = exports.isStaticPattern = void 0;
3167
- var path9 = __require("path");
3167
+ var path10 = __require("path");
3168
3168
  var globParent = require_glob_parent();
3169
3169
  var micromatch2 = require_micromatch();
3170
3170
  var GLOBSTAR = "**";
@@ -3259,7 +3259,7 @@ var require_pattern = __commonJS({
3259
3259
  }
3260
3260
  exports.endsWithSlashGlobStar = endsWithSlashGlobStar;
3261
3261
  function isAffectDepthOfReadingPattern(pattern) {
3262
- const basename = path9.basename(pattern);
3262
+ const basename = path10.basename(pattern);
3263
3263
  return endsWithSlashGlobStar(pattern) || isStaticPattern(basename);
3264
3264
  }
3265
3265
  exports.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern;
@@ -3477,8 +3477,8 @@ var require_utils3 = __commonJS({
3477
3477
  exports.errno = errno;
3478
3478
  var fs5 = require_fs();
3479
3479
  exports.fs = fs5;
3480
- var path9 = require_path();
3481
- exports.path = path9;
3480
+ var path10 = require_path();
3481
+ exports.path = path10;
3482
3482
  var pattern = require_pattern();
3483
3483
  exports.pattern = pattern;
3484
3484
  var stream = require_stream();
@@ -3590,8 +3590,8 @@ var require_async = __commonJS({
3590
3590
  "use strict";
3591
3591
  Object.defineProperty(exports, "__esModule", { value: true });
3592
3592
  exports.read = void 0;
3593
- function read2(path9, settings, callback) {
3594
- settings.fs.lstat(path9, (lstatError, lstat) => {
3593
+ function read2(path10, settings, callback) {
3594
+ settings.fs.lstat(path10, (lstatError, lstat) => {
3595
3595
  if (lstatError !== null) {
3596
3596
  callFailureCallback(callback, lstatError);
3597
3597
  return;
@@ -3600,7 +3600,7 @@ var require_async = __commonJS({
3600
3600
  callSuccessCallback(callback, lstat);
3601
3601
  return;
3602
3602
  }
3603
- settings.fs.stat(path9, (statError, stat) => {
3603
+ settings.fs.stat(path10, (statError, stat) => {
3604
3604
  if (statError !== null) {
3605
3605
  if (settings.throwErrorOnBrokenSymbolicLink) {
3606
3606
  callFailureCallback(callback, statError);
@@ -3632,13 +3632,13 @@ var require_sync = __commonJS({
3632
3632
  "use strict";
3633
3633
  Object.defineProperty(exports, "__esModule", { value: true });
3634
3634
  exports.read = void 0;
3635
- function read2(path9, settings) {
3636
- const lstat = settings.fs.lstatSync(path9);
3635
+ function read2(path10, settings) {
3636
+ const lstat = settings.fs.lstatSync(path10);
3637
3637
  if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
3638
3638
  return lstat;
3639
3639
  }
3640
3640
  try {
3641
- const stat = settings.fs.statSync(path9);
3641
+ const stat = settings.fs.statSync(path10);
3642
3642
  if (settings.markSymbolicLink) {
3643
3643
  stat.isSymbolicLink = () => true;
3644
3644
  }
@@ -3709,17 +3709,17 @@ var require_out = __commonJS({
3709
3709
  var sync = require_sync();
3710
3710
  var settings_1 = require_settings();
3711
3711
  exports.Settings = settings_1.default;
3712
- function stat(path9, optionsOrSettingsOrCallback, callback) {
3712
+ function stat(path10, optionsOrSettingsOrCallback, callback) {
3713
3713
  if (typeof optionsOrSettingsOrCallback === "function") {
3714
- async.read(path9, getSettings(), optionsOrSettingsOrCallback);
3714
+ async.read(path10, getSettings(), optionsOrSettingsOrCallback);
3715
3715
  return;
3716
3716
  }
3717
- async.read(path9, getSettings(optionsOrSettingsOrCallback), callback);
3717
+ async.read(path10, getSettings(optionsOrSettingsOrCallback), callback);
3718
3718
  }
3719
3719
  exports.stat = stat;
3720
- function statSync2(path9, optionsOrSettings) {
3720
+ function statSync2(path10, optionsOrSettings) {
3721
3721
  const settings = getSettings(optionsOrSettings);
3722
- return sync.read(path9, settings);
3722
+ return sync.read(path10, settings);
3723
3723
  }
3724
3724
  exports.statSync = statSync2;
3725
3725
  function getSettings(settingsOrOptions = {}) {
@@ -3938,16 +3938,16 @@ var require_async2 = __commonJS({
3938
3938
  return;
3939
3939
  }
3940
3940
  const tasks = names.map((name) => {
3941
- const path9 = common.joinPathSegments(directory, name, settings.pathSegmentSeparator);
3941
+ const path10 = common.joinPathSegments(directory, name, settings.pathSegmentSeparator);
3942
3942
  return (done) => {
3943
- fsStat.stat(path9, settings.fsStatSettings, (error, stats) => {
3943
+ fsStat.stat(path10, settings.fsStatSettings, (error, stats) => {
3944
3944
  if (error !== null) {
3945
3945
  done(error);
3946
3946
  return;
3947
3947
  }
3948
3948
  const entry = {
3949
3949
  name,
3950
- path: path9,
3950
+ path: path10,
3951
3951
  dirent: utils.fs.createDirentFromStats(name, stats)
3952
3952
  };
3953
3953
  if (settings.stats) {
@@ -4065,7 +4065,7 @@ var require_settings2 = __commonJS({
4065
4065
  "node_modules/@nodelib/fs.scandir/out/settings.js"(exports) {
4066
4066
  "use strict";
4067
4067
  Object.defineProperty(exports, "__esModule", { value: true });
4068
- var path9 = __require("path");
4068
+ var path10 = __require("path");
4069
4069
  var fsStat = require_out();
4070
4070
  var fs5 = require_fs4();
4071
4071
  var Settings = class {
@@ -4073,7 +4073,7 @@ var require_settings2 = __commonJS({
4073
4073
  this._options = _options;
4074
4074
  this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false);
4075
4075
  this.fs = fs5.createFileSystemAdapter(this._options.fs);
4076
- this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path9.sep);
4076
+ this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path10.sep);
4077
4077
  this.stats = this._getValue(this._options.stats, false);
4078
4078
  this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
4079
4079
  this.fsStatSettings = new fsStat.Settings({
@@ -4100,17 +4100,17 @@ var require_out2 = __commonJS({
4100
4100
  var sync = require_sync2();
4101
4101
  var settings_1 = require_settings2();
4102
4102
  exports.Settings = settings_1.default;
4103
- function scandir(path9, optionsOrSettingsOrCallback, callback) {
4103
+ function scandir(path10, optionsOrSettingsOrCallback, callback) {
4104
4104
  if (typeof optionsOrSettingsOrCallback === "function") {
4105
- async.read(path9, getSettings(), optionsOrSettingsOrCallback);
4105
+ async.read(path10, getSettings(), optionsOrSettingsOrCallback);
4106
4106
  return;
4107
4107
  }
4108
- async.read(path9, getSettings(optionsOrSettingsOrCallback), callback);
4108
+ async.read(path10, getSettings(optionsOrSettingsOrCallback), callback);
4109
4109
  }
4110
4110
  exports.scandir = scandir;
4111
- function scandirSync(path9, optionsOrSettings) {
4111
+ function scandirSync(path10, optionsOrSettings) {
4112
4112
  const settings = getSettings(optionsOrSettings);
4113
- return sync.read(path9, settings);
4113
+ return sync.read(path10, settings);
4114
4114
  }
4115
4115
  exports.scandirSync = scandirSync;
4116
4116
  function getSettings(settingsOrOptions = {}) {
@@ -4348,26 +4348,26 @@ var require_queue = __commonJS({
4348
4348
  queue.drained = drained;
4349
4349
  return queue;
4350
4350
  function push(value) {
4351
- var p = new Promise(function(resolve2, reject) {
4351
+ var p = new Promise(function(resolve3, reject) {
4352
4352
  pushCb(value, function(err, result) {
4353
4353
  if (err) {
4354
4354
  reject(err);
4355
4355
  return;
4356
4356
  }
4357
- resolve2(result);
4357
+ resolve3(result);
4358
4358
  });
4359
4359
  });
4360
4360
  p.catch(noop2);
4361
4361
  return p;
4362
4362
  }
4363
4363
  function unshift(value) {
4364
- var p = new Promise(function(resolve2, reject) {
4364
+ var p = new Promise(function(resolve3, reject) {
4365
4365
  unshiftCb(value, function(err, result) {
4366
4366
  if (err) {
4367
4367
  reject(err);
4368
4368
  return;
4369
4369
  }
4370
- resolve2(result);
4370
+ resolve3(result);
4371
4371
  });
4372
4372
  });
4373
4373
  p.catch(noop2);
@@ -4375,15 +4375,15 @@ var require_queue = __commonJS({
4375
4375
  }
4376
4376
  function drained() {
4377
4377
  if (queue.idle()) {
4378
- return new Promise(function(resolve2) {
4379
- resolve2();
4378
+ return new Promise(function(resolve3) {
4379
+ resolve3();
4380
4380
  });
4381
4381
  }
4382
4382
  var previousDrain = queue.drain;
4383
- var p = new Promise(function(resolve2) {
4383
+ var p = new Promise(function(resolve3) {
4384
4384
  queue.drain = function() {
4385
4385
  previousDrain();
4386
- resolve2();
4386
+ resolve3();
4387
4387
  };
4388
4388
  });
4389
4389
  return p;
@@ -4714,7 +4714,7 @@ var require_settings3 = __commonJS({
4714
4714
  "node_modules/@nodelib/fs.walk/out/settings.js"(exports) {
4715
4715
  "use strict";
4716
4716
  Object.defineProperty(exports, "__esModule", { value: true });
4717
- var path9 = __require("path");
4717
+ var path10 = __require("path");
4718
4718
  var fsScandir = require_out2();
4719
4719
  var Settings = class {
4720
4720
  constructor(_options = {}) {
@@ -4724,7 +4724,7 @@ var require_settings3 = __commonJS({
4724
4724
  this.deepFilter = this._getValue(this._options.deepFilter, null);
4725
4725
  this.entryFilter = this._getValue(this._options.entryFilter, null);
4726
4726
  this.errorFilter = this._getValue(this._options.errorFilter, null);
4727
- this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path9.sep);
4727
+ this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path10.sep);
4728
4728
  this.fsScandirSettings = new fsScandir.Settings({
4729
4729
  followSymbolicLinks: this._options.followSymbolicLinks,
4730
4730
  fs: this._options.fs,
@@ -4786,7 +4786,7 @@ var require_reader2 = __commonJS({
4786
4786
  "node_modules/fast-glob/out/readers/reader.js"(exports) {
4787
4787
  "use strict";
4788
4788
  Object.defineProperty(exports, "__esModule", { value: true });
4789
- var path9 = __require("path");
4789
+ var path10 = __require("path");
4790
4790
  var fsStat = require_out();
4791
4791
  var utils = require_utils3();
4792
4792
  var Reader = class {
@@ -4799,7 +4799,7 @@ var require_reader2 = __commonJS({
4799
4799
  });
4800
4800
  }
4801
4801
  _getFullEntryPath(filepath) {
4802
- return path9.resolve(this._settings.cwd, filepath);
4802
+ return path10.resolve(this._settings.cwd, filepath);
4803
4803
  }
4804
4804
  _makeEntry(stats, pattern) {
4805
4805
  const entry = {
@@ -4866,9 +4866,9 @@ var require_stream3 = __commonJS({
4866
4866
  });
4867
4867
  }
4868
4868
  _getStat(filepath) {
4869
- return new Promise((resolve2, reject) => {
4869
+ return new Promise((resolve3, reject) => {
4870
4870
  this._stat(filepath, this._fsStatSettings, (error, stats) => {
4871
- return error === null ? resolve2(stats) : reject(error);
4871
+ return error === null ? resolve3(stats) : reject(error);
4872
4872
  });
4873
4873
  });
4874
4874
  }
@@ -4892,10 +4892,10 @@ var require_async5 = __commonJS({
4892
4892
  this._readerStream = new stream_1.default(this._settings);
4893
4893
  }
4894
4894
  dynamic(root, options8) {
4895
- return new Promise((resolve2, reject) => {
4895
+ return new Promise((resolve3, reject) => {
4896
4896
  this._walkAsync(root, options8, (error, entries) => {
4897
4897
  if (error === null) {
4898
- resolve2(entries);
4898
+ resolve3(entries);
4899
4899
  } else {
4900
4900
  reject(error);
4901
4901
  }
@@ -4905,10 +4905,10 @@ var require_async5 = __commonJS({
4905
4905
  async static(patterns, options8) {
4906
4906
  const entries = [];
4907
4907
  const stream = this._readerStream.static(patterns, options8);
4908
- return new Promise((resolve2, reject) => {
4908
+ return new Promise((resolve3, reject) => {
4909
4909
  stream.once("error", reject);
4910
4910
  stream.on("data", (entry) => entries.push(entry));
4911
- stream.once("end", () => resolve2(entries));
4911
+ stream.once("end", () => resolve3(entries));
4912
4912
  });
4913
4913
  }
4914
4914
  };
@@ -5097,8 +5097,8 @@ var require_entry = __commonJS({
5097
5097
  if (this._isSkippedByAbsoluteNegativePatterns(filepath, negativeRe)) {
5098
5098
  return false;
5099
5099
  }
5100
- const isDirectory = entry.dirent.isDirectory();
5101
- const isMatched = this._isMatchToPatterns(filepath, positiveRe, isDirectory) && !this._isMatchToPatterns(filepath, negativeRe, isDirectory);
5100
+ const isDirectory2 = entry.dirent.isDirectory();
5101
+ const isMatched = this._isMatchToPatterns(filepath, positiveRe, isDirectory2) && !this._isMatchToPatterns(filepath, negativeRe, isDirectory2);
5102
5102
  if (this._settings.unique && isMatched) {
5103
5103
  this._createIndexRecord(filepath);
5104
5104
  }
@@ -5123,9 +5123,9 @@ var require_entry = __commonJS({
5123
5123
  const fullpath = utils.path.makeAbsolute(this._settings.cwd, entryPath);
5124
5124
  return utils.pattern.matchAny(fullpath, patternsRe);
5125
5125
  }
5126
- _isMatchToPatterns(filepath, patternsRe, isDirectory) {
5126
+ _isMatchToPatterns(filepath, patternsRe, isDirectory2) {
5127
5127
  const isMatched = utils.pattern.matchAny(filepath, patternsRe);
5128
- if (!isMatched && isDirectory) {
5128
+ if (!isMatched && isDirectory2) {
5129
5129
  return utils.pattern.matchAny(filepath + "/", patternsRe);
5130
5130
  }
5131
5131
  return isMatched;
@@ -5193,7 +5193,7 @@ var require_provider = __commonJS({
5193
5193
  "node_modules/fast-glob/out/providers/provider.js"(exports) {
5194
5194
  "use strict";
5195
5195
  Object.defineProperty(exports, "__esModule", { value: true });
5196
- var path9 = __require("path");
5196
+ var path10 = __require("path");
5197
5197
  var deep_1 = require_deep();
5198
5198
  var entry_1 = require_entry();
5199
5199
  var error_1 = require_error();
@@ -5207,7 +5207,7 @@ var require_provider = __commonJS({
5207
5207
  this.entryTransformer = new entry_2.default(this._settings);
5208
5208
  }
5209
5209
  _getRootDirectory(task) {
5210
- return path9.resolve(this._settings.cwd, task.base);
5210
+ return path10.resolve(this._settings.cwd, task.base);
5211
5211
  }
5212
5212
  _getReaderOptions(task) {
5213
5213
  const basePath = task.base === "." ? "" : task.base;
@@ -5755,10 +5755,10 @@ var require_base = __commonJS({
5755
5755
  }
5756
5756
  return components;
5757
5757
  }
5758
- function clonePath(path9) {
5758
+ function clonePath(path10) {
5759
5759
  return {
5760
- newPos: path9.newPos,
5761
- components: path9.components.slice(0)
5760
+ newPos: path10.newPos,
5761
+ components: path10.components.slice(0)
5762
5762
  };
5763
5763
  }
5764
5764
  }
@@ -7058,15 +7058,15 @@ var require_route = __commonJS({
7058
7058
  };
7059
7059
  }
7060
7060
  function wrapConversion(toModel, graph) {
7061
- var path9 = [graph[toModel].parent, toModel];
7061
+ var path10 = [graph[toModel].parent, toModel];
7062
7062
  var fn = conversions[graph[toModel].parent][toModel];
7063
7063
  var cur = graph[toModel].parent;
7064
7064
  while (graph[cur].parent) {
7065
- path9.unshift(graph[cur].parent);
7065
+ path10.unshift(graph[cur].parent);
7066
7066
  fn = link(conversions[graph[cur].parent][cur], fn);
7067
7067
  cur = graph[cur].parent;
7068
7068
  }
7069
- fn.conversion = path9;
7069
+ fn.conversion = path10;
7070
7070
  return fn;
7071
7071
  }
7072
7072
  module.exports = function(fromModel) {
@@ -7687,43 +7687,29 @@ var require_lib2 = __commonJS({
7687
7687
  var _jsTokens = require_js_tokens();
7688
7688
  var _helperValidatorIdentifier = require_lib();
7689
7689
  var _chalk = _interopRequireWildcard(require_chalk(), true);
7690
- function _getRequireWildcardCache(nodeInterop) {
7691
- if (typeof WeakMap !== "function")
7690
+ function _getRequireWildcardCache(e) {
7691
+ if ("function" != typeof WeakMap)
7692
7692
  return null;
7693
- var cacheBabelInterop = /* @__PURE__ */ new WeakMap();
7694
- var cacheNodeInterop = /* @__PURE__ */ new WeakMap();
7695
- return (_getRequireWildcardCache = function(nodeInterop2) {
7696
- return nodeInterop2 ? cacheNodeInterop : cacheBabelInterop;
7697
- })(nodeInterop);
7698
- }
7699
- function _interopRequireWildcard(obj, nodeInterop) {
7700
- if (!nodeInterop && obj && obj.__esModule) {
7701
- return obj;
7702
- }
7703
- if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
7704
- return { default: obj };
7705
- }
7706
- var cache2 = _getRequireWildcardCache(nodeInterop);
7707
- if (cache2 && cache2.has(obj)) {
7708
- return cache2.get(obj);
7709
- }
7710
- var newObj = {};
7711
- var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
7712
- for (var key in obj) {
7713
- if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
7714
- var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
7715
- if (desc && (desc.get || desc.set)) {
7716
- Object.defineProperty(newObj, key, desc);
7717
- } else {
7718
- newObj[key] = obj[key];
7719
- }
7720
- }
7721
- }
7722
- newObj.default = obj;
7723
- if (cache2) {
7724
- cache2.set(obj, newObj);
7725
- }
7726
- return newObj;
7693
+ var r = /* @__PURE__ */ new WeakMap(), t = /* @__PURE__ */ new WeakMap();
7694
+ return (_getRequireWildcardCache = function(e2) {
7695
+ return e2 ? t : r;
7696
+ })(e);
7697
+ }
7698
+ function _interopRequireWildcard(e, r) {
7699
+ if (!r && e && e.__esModule)
7700
+ return e;
7701
+ if (null === e || "object" != typeof e && "function" != typeof e)
7702
+ return { default: e };
7703
+ var t = _getRequireWildcardCache(r);
7704
+ if (t && t.has(e))
7705
+ return t.get(e);
7706
+ var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor;
7707
+ for (var u in e)
7708
+ if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) {
7709
+ var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;
7710
+ i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u];
7711
+ }
7712
+ return n.default = e, t && t.set(e, n), n;
7727
7713
  }
7728
7714
  var sometimesKeywords = /* @__PURE__ */ new Set(["as", "async", "from", "get", "of", "set"]);
7729
7715
  function getDefs(chalk2) {
@@ -7806,9 +7792,7 @@ var require_lib2 = __commonJS({
7806
7792
  return _chalk.default;
7807
7793
  }
7808
7794
  {
7809
- {
7810
- exports.getChalk = (options8) => getChalk(options8.forceColor);
7811
- }
7795
+ exports.getChalk = (options8) => getChalk(options8.forceColor);
7812
7796
  }
7813
7797
  function highlight(code, options8 = {}) {
7814
7798
  if (code !== "" && shouldHighlight(options8)) {
@@ -8024,8 +8008,8 @@ var require_p_defer = __commonJS({
8024
8008
  "use strict";
8025
8009
  module.exports = () => {
8026
8010
  const ret = {};
8027
- ret.promise = new Promise((resolve2, reject) => {
8028
- ret.resolve = resolve2;
8011
+ ret.promise = new Promise((resolve3, reject) => {
8012
+ ret.resolve = resolve3;
8029
8013
  ret.reject = reject;
8030
8014
  });
8031
8015
  return ret;
@@ -8038,7 +8022,7 @@ var require_dist = __commonJS({
8038
8022
  "node_modules/map-age-cleaner/dist/index.js"(exports, module) {
8039
8023
  "use strict";
8040
8024
  var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
8041
- return new (P || (P = Promise))(function(resolve2, reject) {
8025
+ return new (P || (P = Promise))(function(resolve3, reject) {
8042
8026
  function fulfilled(value) {
8043
8027
  try {
8044
8028
  step(generator.next(value));
@@ -8054,8 +8038,8 @@ var require_dist = __commonJS({
8054
8038
  }
8055
8039
  }
8056
8040
  function step(result) {
8057
- result.done ? resolve2(result.value) : new P(function(resolve3) {
8058
- resolve3(result.value);
8041
+ result.done ? resolve3(result.value) : new P(function(resolve4) {
8042
+ resolve4(result.value);
8059
8043
  }).then(fulfilled, rejected);
8060
8044
  }
8061
8045
  step((generator = generator.apply(thisArg, _arguments || [])).next());
@@ -9437,7 +9421,7 @@ var require_fnmatch = __commonJS({
9437
9421
  var cache2 = minimatch.cache = new LRU({ max: 100 });
9438
9422
  var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {};
9439
9423
  var sigmund = require_sigmund();
9440
- var path9 = __require("path");
9424
+ var path10 = __require("path");
9441
9425
  var qmark = "[^/]";
9442
9426
  var star = qmark + "*?";
9443
9427
  var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";
@@ -9694,9 +9678,9 @@ var require_fnmatch = __commonJS({
9694
9678
  }
9695
9679
  return ret;
9696
9680
  }
9697
- Minimatch.prototype.parse = parse3;
9681
+ Minimatch.prototype.parse = parse4;
9698
9682
  var SUBPARSE = {};
9699
- function parse3(pattern, isSub) {
9683
+ function parse4(pattern, isSub) {
9700
9684
  var options8 = this.options;
9701
9685
  if (!options8.noglobstar && pattern === "**")
9702
9686
  return GLOBSTAR;
@@ -9957,7 +9941,7 @@ var require_fnmatch = __commonJS({
9957
9941
  );
9958
9942
  }
9959
9943
  if (options8.matchBase && pattern.length === 1) {
9960
- file = path9.basename(file.join("/")).split("/");
9944
+ file = path10.basename(file.join("/")).split("/");
9961
9945
  }
9962
9946
  if (options8.debug) {
9963
9947
  console.error("matchOne", file.length, pattern.length);
@@ -10062,7 +10046,7 @@ var require_ini = __commonJS({
10062
10046
  "node_modules/editorconfig/src/lib/ini.js"(exports) {
10063
10047
  "use strict";
10064
10048
  var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
10065
- return new (P || (P = Promise))(function(resolve2, reject) {
10049
+ return new (P || (P = Promise))(function(resolve3, reject) {
10066
10050
  function fulfilled(value) {
10067
10051
  try {
10068
10052
  step(generator.next(value));
@@ -10078,8 +10062,8 @@ var require_ini = __commonJS({
10078
10062
  }
10079
10063
  }
10080
10064
  function step(result) {
10081
- result.done ? resolve2(result.value) : new P(function(resolve3) {
10082
- resolve3(result.value);
10065
+ result.done ? resolve3(result.value) : new P(function(resolve4) {
10066
+ resolve4(result.value);
10083
10067
  }).then(fulfilled, rejected);
10084
10068
  }
10085
10069
  step((generator = generator.apply(thisArg, _arguments || [])).next());
@@ -10180,22 +10164,22 @@ var require_ini = __commonJS({
10180
10164
  param: /^\s*([\w\.\-\_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$/,
10181
10165
  comment: /^\s*[#;].*$/
10182
10166
  };
10183
- function parse3(file) {
10167
+ function parse4(file) {
10184
10168
  return __awaiter(this, void 0, void 0, function() {
10185
10169
  return __generator(this, function(_a) {
10186
- return [2, new Promise(function(resolve2, reject) {
10170
+ return [2, new Promise(function(resolve3, reject) {
10187
10171
  fs5.readFile(file, "utf8", function(err, data) {
10188
10172
  if (err) {
10189
10173
  reject(err);
10190
10174
  return;
10191
10175
  }
10192
- resolve2(parseString(data));
10176
+ resolve3(parseString(data));
10193
10177
  });
10194
10178
  })];
10195
10179
  });
10196
10180
  });
10197
10181
  }
10198
- exports.parse = parse3;
10182
+ exports.parse = parse4;
10199
10183
  function parseSync(file) {
10200
10184
  return parseString(fs5.readFileSync(file, "utf8"));
10201
10185
  }
@@ -10296,7 +10280,7 @@ var require_src = __commonJS({
10296
10280
  "node_modules/editorconfig/src/index.js"(exports) {
10297
10281
  "use strict";
10298
10282
  var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
10299
- return new (P || (P = Promise))(function(resolve2, reject) {
10283
+ return new (P || (P = Promise))(function(resolve3, reject) {
10300
10284
  function fulfilled(value) {
10301
10285
  try {
10302
10286
  step(generator.next(value));
@@ -10312,8 +10296,8 @@ var require_src = __commonJS({
10312
10296
  }
10313
10297
  }
10314
10298
  function step(result) {
10315
- result.done ? resolve2(result.value) : new P(function(resolve3) {
10316
- resolve3(result.value);
10299
+ result.done ? resolve3(result.value) : new P(function(resolve4) {
10300
+ resolve4(result.value);
10317
10301
  }).then(fulfilled, rejected);
10318
10302
  }
10319
10303
  step((generator = generator.apply(thisArg, _arguments || [])).next());
@@ -10412,7 +10396,7 @@ var require_src = __commonJS({
10412
10396
  };
10413
10397
  Object.defineProperty(exports, "__esModule", { value: true });
10414
10398
  var fs5 = __importStar(__require("fs"));
10415
- var path9 = __importStar(__require("path"));
10399
+ var path10 = __importStar(__require("path"));
10416
10400
  var semver = {
10417
10401
  gte: require_gte()
10418
10402
  };
@@ -10436,8 +10420,8 @@ var require_src = __commonJS({
10436
10420
  function getConfigFileNames(filepath, options8) {
10437
10421
  var paths = [];
10438
10422
  do {
10439
- filepath = path9.dirname(filepath);
10440
- paths.push(path9.join(filepath, options8.config));
10423
+ filepath = path10.dirname(filepath);
10424
+ paths.push(path10.join(filepath, options8.config));
10441
10425
  } while (filepath !== options8.root);
10442
10426
  return paths;
10443
10427
  }
@@ -10460,7 +10444,7 @@ var require_src = __commonJS({
10460
10444
  return {
10461
10445
  config: options8.config || ".editorconfig",
10462
10446
  version: options8.version || package_json_1.default.version,
10463
- root: path9.resolve(options8.root || path9.parse(filepath).root)
10447
+ root: path10.resolve(options8.root || path10.parse(filepath).root)
10464
10448
  };
10465
10449
  }
10466
10450
  function buildFullGlob(pathPrefix, glob) {
@@ -10474,7 +10458,7 @@ var require_src = __commonJS({
10474
10458
  default:
10475
10459
  break;
10476
10460
  }
10477
- return path9.join(pathPrefix, glob);
10461
+ return path10.join(pathPrefix, glob);
10478
10462
  }
10479
10463
  function extendProps(props, options8) {
10480
10464
  if (props === void 0) {
@@ -10505,7 +10489,7 @@ var require_src = __commonJS({
10505
10489
  }
10506
10490
  function parseFromConfigs(configs, filepath, options8) {
10507
10491
  return processMatches(configs.reverse().reduce(function(matches, file) {
10508
- var pathPrefix = path9.dirname(file.name);
10492
+ var pathPrefix = path10.dirname(file.name);
10509
10493
  file.contents.forEach(function(section) {
10510
10494
  var glob = section[0];
10511
10495
  var options22 = section[1];
@@ -10542,9 +10526,9 @@ var require_src = __commonJS({
10542
10526
  return __awaiter(this, void 0, void 0, function() {
10543
10527
  return __generator(this, function(_a) {
10544
10528
  return [2, Promise.all(filepaths.map(function(name) {
10545
- return new Promise(function(resolve2) {
10529
+ return new Promise(function(resolve3) {
10546
10530
  fs5.readFile(name, "utf8", function(err, data) {
10547
- resolve2({
10531
+ resolve3({
10548
10532
  name,
10549
10533
  contents: err ? "" : data
10550
10534
  });
@@ -10574,7 +10558,7 @@ var require_src = __commonJS({
10574
10558
  if (options8 === void 0) {
10575
10559
  options8 = {};
10576
10560
  }
10577
- var resolvedFilePath = path9.resolve(filepath);
10561
+ var resolvedFilePath = path10.resolve(filepath);
10578
10562
  return [
10579
10563
  resolvedFilePath,
10580
10564
  processOptions(options8, resolvedFilePath)
@@ -10603,7 +10587,7 @@ var require_src = __commonJS({
10603
10587
  return parseFromConfigs(getConfigsForFiles(files), resolvedFilePath, processedOptions);
10604
10588
  }
10605
10589
  exports.parseFromFilesSync = parseFromFilesSync;
10606
- function parse3(_filepath, _options) {
10590
+ function parse4(_filepath, _options) {
10607
10591
  if (_options === void 0) {
10608
10592
  _options = {};
10609
10593
  }
@@ -10618,7 +10602,7 @@ var require_src = __commonJS({
10618
10602
  });
10619
10603
  });
10620
10604
  }
10621
- exports.parse = parse3;
10605
+ exports.parse = parse4;
10622
10606
  function parseSync(_filepath, _options) {
10623
10607
  if (_options === void 0) {
10624
10608
  _options = {};
@@ -12252,20 +12236,20 @@ var require_parse_async = __commonJS({
12252
12236
  const index = 0;
12253
12237
  const blocksize = opts.blocksize || 40960;
12254
12238
  const parser = new TOMLParser();
12255
- return new Promise((resolve2, reject) => {
12256
- setImmediate(parseAsyncNext, index, blocksize, resolve2, reject);
12239
+ return new Promise((resolve3, reject) => {
12240
+ setImmediate(parseAsyncNext, index, blocksize, resolve3, reject);
12257
12241
  });
12258
- function parseAsyncNext(index2, blocksize2, resolve2, reject) {
12242
+ function parseAsyncNext(index2, blocksize2, resolve3, reject) {
12259
12243
  if (index2 >= str.length) {
12260
12244
  try {
12261
- return resolve2(parser.finish());
12245
+ return resolve3(parser.finish());
12262
12246
  } catch (err) {
12263
12247
  return reject(prettyError(err, str));
12264
12248
  }
12265
12249
  }
12266
12250
  try {
12267
12251
  parser.parse(str.slice(index2, index2 + blocksize2));
12268
- setImmediate(parseAsyncNext, index2 + blocksize2, blocksize2, resolve2, reject);
12252
+ setImmediate(parseAsyncNext, index2 + blocksize2, blocksize2, resolve3, reject);
12269
12253
  } catch (err) {
12270
12254
  reject(prettyError(err, str));
12271
12255
  }
@@ -12320,7 +12304,7 @@ var require_parse3 = __commonJS({
12320
12304
  var token;
12321
12305
  var key;
12322
12306
  var root;
12323
- module.exports = function parse3(text, reviver) {
12307
+ module.exports = function parse4(text, reviver) {
12324
12308
  source = String(text);
12325
12309
  parseState = "start";
12326
12310
  stack = [];
@@ -15338,99 +15322,6 @@ var require_loader = __commonJS({
15338
15322
  }
15339
15323
  });
15340
15324
 
15341
- // node_modules/json-parse-even-better-errors/lib/index.js
15342
- var require_lib4 = __commonJS({
15343
- "node_modules/json-parse-even-better-errors/lib/index.js"(exports, module) {
15344
- "use strict";
15345
- var hexify = (char) => {
15346
- const h = char.charCodeAt(0).toString(16).toUpperCase();
15347
- return "0x" + (h.length % 2 ? "0" : "") + h;
15348
- };
15349
- var parseError = (e, txt, context) => {
15350
- if (!txt) {
15351
- return {
15352
- message: e.message + " while parsing empty string",
15353
- position: 0
15354
- };
15355
- }
15356
- const badToken = e.message.match(/^Unexpected token (.) .*position\s+(\d+)/i);
15357
- const errIdx = badToken ? +badToken[2] : e.message.match(/^Unexpected end of JSON.*/i) ? txt.length - 1 : null;
15358
- const msg = badToken ? e.message.replace(/^Unexpected token ./, `Unexpected token ${JSON.stringify(badToken[1])} (${hexify(badToken[1])})`) : e.message;
15359
- if (errIdx !== null && errIdx !== void 0) {
15360
- const start = errIdx <= context ? 0 : errIdx - context;
15361
- const end = errIdx + context >= txt.length ? txt.length : errIdx + context;
15362
- const slice = (start === 0 ? "" : "...") + txt.slice(start, end) + (end === txt.length ? "" : "...");
15363
- const near = txt === slice ? "" : "near ";
15364
- return {
15365
- message: msg + ` while parsing ${near}${JSON.stringify(slice)}`,
15366
- position: errIdx
15367
- };
15368
- } else {
15369
- return {
15370
- message: msg + ` while parsing '${txt.slice(0, context * 2)}'`,
15371
- position: 0
15372
- };
15373
- }
15374
- };
15375
- var JSONParseError = class extends SyntaxError {
15376
- constructor(er, txt, context, caller) {
15377
- context = context || 20;
15378
- const metadata = parseError(er, txt, context);
15379
- super(metadata.message);
15380
- Object.assign(this, metadata);
15381
- this.code = "EJSONPARSE";
15382
- this.systemError = er;
15383
- Error.captureStackTrace(this, caller || this.constructor);
15384
- }
15385
- get name() {
15386
- return this.constructor.name;
15387
- }
15388
- set name(n) {
15389
- }
15390
- get [Symbol.toStringTag]() {
15391
- return this.constructor.name;
15392
- }
15393
- };
15394
- var kIndent = Symbol.for("indent");
15395
- var kNewline = Symbol.for("newline");
15396
- var formatRE = /^\s*[{[]((?:\r?\n)+)([\s\t]*)/;
15397
- var emptyRE = /^(?:\{\}|\[\])((?:\r?\n)+)?$/;
15398
- var parseJson2 = (txt, reviver, context) => {
15399
- const parseText = stripBOM(txt);
15400
- context = context || 20;
15401
- try {
15402
- const [, newline = "\n", indent2 = " "] = parseText.match(emptyRE) || parseText.match(formatRE) || [null, "", ""];
15403
- const result = JSON.parse(parseText, reviver);
15404
- if (result && typeof result === "object") {
15405
- result[kNewline] = newline;
15406
- result[kIndent] = indent2;
15407
- }
15408
- return result;
15409
- } catch (e) {
15410
- if (typeof txt !== "string" && !Buffer.isBuffer(txt)) {
15411
- const isEmptyArray = Array.isArray(txt) && txt.length === 0;
15412
- throw Object.assign(new TypeError(
15413
- `Cannot parse ${isEmptyArray ? "an empty array" : String(txt)}`
15414
- ), {
15415
- code: "EJSONPARSE",
15416
- systemError: e
15417
- });
15418
- }
15419
- throw new JSONParseError(e, parseText, context, parseJson2);
15420
- }
15421
- };
15422
- var stripBOM = (txt) => String(txt).replace(/^\uFEFF/, "");
15423
- module.exports = parseJson2;
15424
- parseJson2.JSONParseError = JSONParseError;
15425
- parseJson2.noExceptions = (txt, reviver) => {
15426
- try {
15427
- return JSON.parse(stripBOM(txt), reviver);
15428
- } catch (e) {
15429
- }
15430
- };
15431
- }
15432
- });
15433
-
15434
15325
  // node_modules/ignore/index.js
15435
15326
  var require_ignore = __commonJS({
15436
15327
  "node_modules/ignore/index.js"(exports, module) {
@@ -15647,17 +15538,17 @@ var require_ignore = __commonJS({
15647
15538
  var throwError = (message, Ctor) => {
15648
15539
  throw new Ctor(message);
15649
15540
  };
15650
- var checkPath = (path9, originalPath, doThrow) => {
15651
- if (!isString(path9)) {
15541
+ var checkPath = (path10, originalPath, doThrow) => {
15542
+ if (!isString(path10)) {
15652
15543
  return doThrow(
15653
15544
  `path must be a string, but got \`${originalPath}\``,
15654
15545
  TypeError
15655
15546
  );
15656
15547
  }
15657
- if (!path9) {
15548
+ if (!path10) {
15658
15549
  return doThrow(`path must not be empty`, TypeError);
15659
15550
  }
15660
- if (checkPath.isNotRelative(path9)) {
15551
+ if (checkPath.isNotRelative(path10)) {
15661
15552
  const r = "`path.relative()`d";
15662
15553
  return doThrow(
15663
15554
  `path should be a ${r} string, but got "${originalPath}"`,
@@ -15666,7 +15557,7 @@ var require_ignore = __commonJS({
15666
15557
  }
15667
15558
  return true;
15668
15559
  };
15669
- var isNotRelative = (path9) => REGEX_TEST_INVALID_PATH.test(path9);
15560
+ var isNotRelative = (path10) => REGEX_TEST_INVALID_PATH.test(path10);
15670
15561
  checkPath.isNotRelative = isNotRelative;
15671
15562
  checkPath.convert = (p) => p;
15672
15563
  var Ignore = class {
@@ -15725,7 +15616,7 @@ var require_ignore = __commonJS({
15725
15616
  // setting `checkUnignored` to `false` could reduce additional
15726
15617
  // path matching.
15727
15618
  // @returns {TestResult} true if a file is ignored
15728
- _testOne(path9, checkUnignored) {
15619
+ _testOne(path10, checkUnignored) {
15729
15620
  let ignored = false;
15730
15621
  let unignored = false;
15731
15622
  this._rules.forEach((rule) => {
@@ -15733,7 +15624,7 @@ var require_ignore = __commonJS({
15733
15624
  if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) {
15734
15625
  return;
15735
15626
  }
15736
- const matched = rule.regex.test(path9);
15627
+ const matched = rule.regex.test(path10);
15737
15628
  if (matched) {
15738
15629
  ignored = !negative;
15739
15630
  unignored = negative;
@@ -15746,24 +15637,24 @@ var require_ignore = __commonJS({
15746
15637
  }
15747
15638
  // @returns {TestResult}
15748
15639
  _test(originalPath, cache2, checkUnignored, slices) {
15749
- const path9 = originalPath && checkPath.convert(originalPath);
15640
+ const path10 = originalPath && checkPath.convert(originalPath);
15750
15641
  checkPath(
15751
- path9,
15642
+ path10,
15752
15643
  originalPath,
15753
15644
  this._allowRelativePaths ? RETURN_FALSE : throwError
15754
15645
  );
15755
- return this._t(path9, cache2, checkUnignored, slices);
15646
+ return this._t(path10, cache2, checkUnignored, slices);
15756
15647
  }
15757
- _t(path9, cache2, checkUnignored, slices) {
15758
- if (path9 in cache2) {
15759
- return cache2[path9];
15648
+ _t(path10, cache2, checkUnignored, slices) {
15649
+ if (path10 in cache2) {
15650
+ return cache2[path10];
15760
15651
  }
15761
15652
  if (!slices) {
15762
- slices = path9.split(SLASH);
15653
+ slices = path10.split(SLASH);
15763
15654
  }
15764
15655
  slices.pop();
15765
15656
  if (!slices.length) {
15766
- return cache2[path9] = this._testOne(path9, checkUnignored);
15657
+ return cache2[path10] = this._testOne(path10, checkUnignored);
15767
15658
  }
15768
15659
  const parent = this._t(
15769
15660
  slices.join(SLASH) + SLASH,
@@ -15771,24 +15662,24 @@ var require_ignore = __commonJS({
15771
15662
  checkUnignored,
15772
15663
  slices
15773
15664
  );
15774
- return cache2[path9] = parent.ignored ? parent : this._testOne(path9, checkUnignored);
15665
+ return cache2[path10] = parent.ignored ? parent : this._testOne(path10, checkUnignored);
15775
15666
  }
15776
- ignores(path9) {
15777
- return this._test(path9, this._ignoreCache, false).ignored;
15667
+ ignores(path10) {
15668
+ return this._test(path10, this._ignoreCache, false).ignored;
15778
15669
  }
15779
15670
  createFilter() {
15780
- return (path9) => !this.ignores(path9);
15671
+ return (path10) => !this.ignores(path10);
15781
15672
  }
15782
15673
  filter(paths) {
15783
15674
  return makeArray(paths).filter(this.createFilter());
15784
15675
  }
15785
15676
  // @returns {TestResult}
15786
- test(path9) {
15787
- return this._test(path9, this._testCache, true);
15677
+ test(path10) {
15678
+ return this._test(path10, this._testCache, true);
15788
15679
  }
15789
15680
  };
15790
15681
  var factory = (options8) => new Ignore(options8);
15791
- var isPathValid = (path9) => checkPath(path9 && checkPath.convert(path9), path9, RETURN_FALSE);
15682
+ var isPathValid = (path10) => checkPath(path10 && checkPath.convert(path10), path10, RETURN_FALSE);
15792
15683
  factory.isPathValid = isPathValid;
15793
15684
  factory.default = factory;
15794
15685
  module.exports = factory;
@@ -15799,7 +15690,7 @@ var require_ignore = __commonJS({
15799
15690
  const makePosix = (str) => /^\\\\\?\\/.test(str) || /["<>|\u0000-\u001F]+/u.test(str) ? str : str.replace(/\\/g, "/");
15800
15691
  checkPath.convert = makePosix;
15801
15692
  const REGIX_IS_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i;
15802
- checkPath.isNotRelative = (path9) => REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path9) || isNotRelative(path9);
15693
+ checkPath.isNotRelative = (path10) => REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path10) || isNotRelative(path10);
15803
15694
  }
15804
15695
  }
15805
15696
  });
@@ -19304,8 +19195,8 @@ var AstPath = class {
19304
19195
  // the end of the iteration.
19305
19196
  map(callback, ...names) {
19306
19197
  const result = [];
19307
- this.each((path9, index, value) => {
19308
- result[index] = callback(path9, index, value);
19198
+ this.each((path10, index, value) => {
19199
+ result[index] = callback(path10, index, value);
19309
19200
  }, ...names);
19310
19201
  return result;
19311
19202
  }
@@ -19828,15 +19719,15 @@ function isPreviousLineEmpty(text, startIndex) {
19828
19719
  var is_previous_line_empty_default = isPreviousLineEmpty;
19829
19720
 
19830
19721
  // src/main/comments/print.js
19831
- function printComment(path9, options8) {
19832
- const comment = path9.node;
19722
+ function printComment(path10, options8) {
19723
+ const comment = path10.node;
19833
19724
  comment.printed = true;
19834
- return options8.printer.printComment(path9, options8);
19725
+ return options8.printer.printComment(path10, options8);
19835
19726
  }
19836
- function printLeadingComment(path9, options8) {
19727
+ function printLeadingComment(path10, options8) {
19837
19728
  var _a;
19838
- const comment = path9.node;
19839
- const parts = [printComment(path9, options8)];
19729
+ const comment = path10.node;
19730
+ const parts = [printComment(path10, options8)];
19840
19731
  const { printer, originalText, locStart, locEnd } = options8;
19841
19732
  const isBlock = (_a = printer.isBlockComment) == null ? void 0 : _a.call(printer, comment);
19842
19733
  if (isBlock) {
@@ -19856,10 +19747,10 @@ function printLeadingComment(path9, options8) {
19856
19747
  }
19857
19748
  return parts;
19858
19749
  }
19859
- function printTrailingComment(path9, options8, previousComment) {
19750
+ function printTrailingComment(path10, options8, previousComment) {
19860
19751
  var _a;
19861
- const comment = path9.node;
19862
- const printed = printComment(path9, options8);
19752
+ const comment = path10.node;
19753
+ const printed = printComment(path10, options8);
19863
19754
  const { printer, originalText, locStart } = options8;
19864
19755
  const isBlock = (_a = printer.isBlockComment) == null ? void 0 : _a.call(printer, comment);
19865
19756
  if ((previousComment == null ? void 0 : previousComment.hasLineSuffix) && !(previousComment == null ? void 0 : previousComment.isBlock) || has_newline_default(originalText, locStart(comment), { backwards: true })) {
@@ -19882,8 +19773,8 @@ function printTrailingComment(path9, options8, previousComment) {
19882
19773
  }
19883
19774
  return { doc: [" ", printed], isBlock, hasLineSuffix: false };
19884
19775
  }
19885
- function printCommentsSeparately(path9, options8) {
19886
- const value = path9.node;
19776
+ function printCommentsSeparately(path10, options8) {
19777
+ const value = path10.node;
19887
19778
  if (!value) {
19888
19779
  return {};
19889
19780
  }
@@ -19897,17 +19788,17 @@ function printCommentsSeparately(path9, options8) {
19897
19788
  const leadingParts = [];
19898
19789
  const trailingParts = [];
19899
19790
  let printedTrailingComment;
19900
- path9.each(() => {
19901
- const comment = path9.node;
19791
+ path10.each(() => {
19792
+ const comment = path10.node;
19902
19793
  if (ignored == null ? void 0 : ignored.has(comment)) {
19903
19794
  return;
19904
19795
  }
19905
19796
  const { leading, trailing } = comment;
19906
19797
  if (leading) {
19907
- leadingParts.push(printLeadingComment(path9, options8));
19798
+ leadingParts.push(printLeadingComment(path10, options8));
19908
19799
  } else if (trailing) {
19909
19800
  printedTrailingComment = printTrailingComment(
19910
- path9,
19801
+ path10,
19911
19802
  options8,
19912
19803
  printedTrailingComment
19913
19804
  );
@@ -19916,8 +19807,8 @@ function printCommentsSeparately(path9, options8) {
19916
19807
  }, "comments");
19917
19808
  return { leading: leadingParts, trailing: trailingParts };
19918
19809
  }
19919
- function printComments(path9, doc2, options8) {
19920
- const { leading, trailing } = printCommentsSeparately(path9, options8);
19810
+ function printComments(path10, doc2, options8) {
19811
+ const { leading, trailing } = printCommentsSeparately(path10, options8);
19921
19812
  if (!leading && !trailing) {
19922
19813
  return doc2;
19923
19814
  }
@@ -19939,7 +19830,7 @@ function ensureAllCommentsPrinted(options8) {
19939
19830
  }
19940
19831
 
19941
19832
  // src/main/multiparser.js
19942
- async function printEmbeddedLanguages(path9, genericPrint, options8, printAstToDoc2, embeds) {
19833
+ async function printEmbeddedLanguages(path10, genericPrint, options8, printAstToDoc2, embeds) {
19943
19834
  const {
19944
19835
  embeddedLanguageFormatting,
19945
19836
  printer: {
@@ -19961,11 +19852,11 @@ async function printEmbeddedLanguages(path9, genericPrint, options8, printAstToD
19961
19852
  );
19962
19853
  const embedCallResults = [];
19963
19854
  recurse();
19964
- const originalPathStack = path9.stack;
19855
+ const originalPathStack = path10.stack;
19965
19856
  for (const { print, node, pathStack } of embedCallResults) {
19966
19857
  try {
19967
- path9.stack = pathStack;
19968
- const doc2 = await print(textToDocForEmbed, genericPrint, path9, options8);
19858
+ path10.stack = pathStack;
19859
+ const doc2 = await print(textToDocForEmbed, genericPrint, path10, options8);
19969
19860
  if (doc2) {
19970
19861
  embeds.set(node, doc2);
19971
19862
  }
@@ -19975,23 +19866,23 @@ async function printEmbeddedLanguages(path9, genericPrint, options8, printAstToD
19975
19866
  }
19976
19867
  }
19977
19868
  }
19978
- path9.stack = originalPathStack;
19869
+ path10.stack = originalPathStack;
19979
19870
  function textToDocForEmbed(text, partialNextOptions) {
19980
19871
  return textToDoc(text, partialNextOptions, options8, printAstToDoc2);
19981
19872
  }
19982
19873
  function recurse() {
19983
- const { node } = path9;
19984
- if (node === null || typeof node !== "object" || hasPrettierIgnore(path9)) {
19874
+ const { node } = path10;
19875
+ if (node === null || typeof node !== "object" || hasPrettierIgnore(path10)) {
19985
19876
  return;
19986
19877
  }
19987
19878
  for (const key of getVisitorKeys(node)) {
19988
19879
  if (Array.isArray(node[key])) {
19989
- path9.each(recurse, key);
19880
+ path10.each(recurse, key);
19990
19881
  } else {
19991
- path9.call(recurse, key);
19882
+ path10.call(recurse, key);
19992
19883
  }
19993
19884
  }
19994
- const result = embed(path9, options8);
19885
+ const result = embed(path10, options8);
19995
19886
  if (!result) {
19996
19887
  return;
19997
19888
  }
@@ -19999,7 +19890,7 @@ async function printEmbeddedLanguages(path9, genericPrint, options8, printAstToD
19999
19890
  embedCallResults.push({
20000
19891
  print: result,
20001
19892
  node,
20002
- pathStack: [...path9.stack]
19893
+ pathStack: [...path10.stack]
20003
19894
  });
20004
19895
  return;
20005
19896
  }
@@ -20035,11 +19926,11 @@ function createPrintPreCheckFunction(options8) {
20035
19926
  const getVisitorKeys = create_get_visitor_keys_function_default(
20036
19927
  options8.printer.getVisitorKeys
20037
19928
  );
20038
- return function(path9) {
20039
- if (path9.isRoot) {
19929
+ return function(path10) {
19930
+ if (path10.isRoot) {
20040
19931
  return;
20041
19932
  }
20042
- const { key, parent } = path9;
19933
+ const { key, parent } = path10;
20043
19934
  const visitorKeys = getVisitorKeys(parent);
20044
19935
  if (visitorKeys.includes(key)) {
20045
19936
  return;
@@ -20048,15 +19939,15 @@ function createPrintPreCheckFunction(options8) {
20048
19939
  parentNode: parent,
20049
19940
  allowedProperties: visitorKeys,
20050
19941
  printingProperty: key,
20051
- printingValue: path9.node,
20052
- pathStack: path9.stack.length > 5 ? ["...", ...path9.stack.slice(-5)] : [...path9.stack]
19942
+ printingValue: path10.node,
19943
+ pathStack: path10.stack.length > 5 ? ["...", ...path10.stack.slice(-5)] : [...path10.stack]
20053
19944
  });
20054
19945
  };
20055
19946
  }
20056
19947
  var create_print_pre_check_function_default = createPrintPreCheckFunction;
20057
19948
 
20058
19949
  // src/main/print-ignored.js
20059
- function printIgnored(path9, options8) {
19950
+ function printIgnored(path10, options8) {
20060
19951
  const {
20061
19952
  originalText,
20062
19953
  [Symbol.for("comments")]: comments,
@@ -20064,7 +19955,7 @@ function printIgnored(path9, options8) {
20064
19955
  locEnd,
20065
19956
  [Symbol.for("printedComments")]: printedComments
20066
19957
  } = options8;
20067
- const { node } = path9;
19958
+ const { node } = path10;
20068
19959
  const start = locStart(node);
20069
19960
  const end = locEnd(node);
20070
19961
  for (const comment of comments) {
@@ -20080,12 +19971,12 @@ var print_ignored_default = printIgnored;
20080
19971
  async function printAstToDoc(ast, options8) {
20081
19972
  ({ ast } = await prepareToPrint(ast, options8));
20082
19973
  const cache2 = /* @__PURE__ */ new Map();
20083
- const path9 = new ast_path_default(ast);
19974
+ const path10 = new ast_path_default(ast);
20084
19975
  const ensurePrintingNode = create_print_pre_check_function_default(options8);
20085
19976
  const embeds = /* @__PURE__ */ new Map();
20086
- await printEmbeddedLanguages(path9, mainPrint, options8, printAstToDoc, embeds);
19977
+ await printEmbeddedLanguages(path10, mainPrint, options8, printAstToDoc, embeds);
20087
19978
  const doc2 = await callPluginPrintFunction(
20088
- path9,
19979
+ path10,
20089
19980
  options8,
20090
19981
  mainPrint,
20091
19982
  void 0,
@@ -20094,17 +19985,17 @@ async function printAstToDoc(ast, options8) {
20094
19985
  ensureAllCommentsPrinted(options8);
20095
19986
  return doc2;
20096
19987
  function mainPrint(selector, args) {
20097
- if (selector === void 0 || selector === path9) {
19988
+ if (selector === void 0 || selector === path10) {
20098
19989
  return mainPrintInternal(args);
20099
19990
  }
20100
19991
  if (Array.isArray(selector)) {
20101
- return path9.call(() => mainPrintInternal(args), ...selector);
19992
+ return path10.call(() => mainPrintInternal(args), ...selector);
20102
19993
  }
20103
- return path9.call(() => mainPrintInternal(args), selector);
19994
+ return path10.call(() => mainPrintInternal(args), selector);
20104
19995
  }
20105
19996
  function mainPrintInternal(args) {
20106
- ensurePrintingNode(path9);
20107
- const value = path9.node;
19997
+ ensurePrintingNode(path10);
19998
+ const value = path10.node;
20108
19999
  if (value === void 0 || value === null) {
20109
20000
  return "";
20110
20001
  }
@@ -20112,30 +20003,30 @@ async function printAstToDoc(ast, options8) {
20112
20003
  if (shouldCache && cache2.has(value)) {
20113
20004
  return cache2.get(value);
20114
20005
  }
20115
- const doc3 = callPluginPrintFunction(path9, options8, mainPrint, args, embeds);
20006
+ const doc3 = callPluginPrintFunction(path10, options8, mainPrint, args, embeds);
20116
20007
  if (shouldCache) {
20117
20008
  cache2.set(value, doc3);
20118
20009
  }
20119
20010
  return doc3;
20120
20011
  }
20121
20012
  }
20122
- function callPluginPrintFunction(path9, options8, printPath, args, embeds) {
20013
+ function callPluginPrintFunction(path10, options8, printPath, args, embeds) {
20123
20014
  var _a;
20124
- const { node } = path9;
20015
+ const { node } = path10;
20125
20016
  const { printer } = options8;
20126
20017
  let doc2;
20127
- if ((_a = printer.hasPrettierIgnore) == null ? void 0 : _a.call(printer, path9)) {
20128
- doc2 = print_ignored_default(path9, options8);
20018
+ if ((_a = printer.hasPrettierIgnore) == null ? void 0 : _a.call(printer, path10)) {
20019
+ doc2 = print_ignored_default(path10, options8);
20129
20020
  } else if (embeds.has(node)) {
20130
20021
  doc2 = embeds.get(node);
20131
20022
  } else {
20132
- doc2 = printer.print(path9, options8, printPath, args);
20023
+ doc2 = printer.print(path10, options8, printPath, args);
20133
20024
  }
20134
20025
  if (node === options8.cursorNode) {
20135
20026
  doc2 = inheritLabel(doc2, (doc3) => [cursor, doc3, cursor]);
20136
20027
  }
20137
- if (printer.printComment && (!printer.willPrintOwnComments || !printer.willPrintOwnComments(path9, options8))) {
20138
- doc2 = printComments(path9, doc2, options8);
20028
+ if (printer.printComment && (!printer.willPrintOwnComments || !printer.willPrintOwnComments(path10, options8))) {
20029
+ doc2 = printComments(path10, doc2, options8);
20139
20030
  }
20140
20031
  return doc2;
20141
20032
  }
@@ -20646,7 +20537,7 @@ async function printDocToString2(doc2, options8) {
20646
20537
 
20647
20538
  // src/config/resolve-config.js
20648
20539
  var import_micromatch = __toESM(require_micromatch(), 1);
20649
- import path5 from "path";
20540
+ import path6 from "path";
20650
20541
 
20651
20542
  // node_modules/mimic-fn/index.js
20652
20543
  var copyProperty = (to, from, property, ignoreNonConfigurable) => {
@@ -20732,8 +20623,8 @@ function memClear(fn) {
20732
20623
 
20733
20624
  // node_modules/url-or-path/index.js
20734
20625
  import { fileURLToPath, pathToFileURL } from "url";
20735
- var isUrlInstance = (urlOrPath) => urlOrPath instanceof URL;
20736
- var isUrlString = (urlOrPath) => typeof urlOrPath === "string" && urlOrPath.startsWith("file://");
20626
+ var isUrlInstance = (value) => value instanceof URL;
20627
+ var isUrlString = (value) => typeof value === "string" && value.startsWith("file://");
20737
20628
  var isUrl = (urlOrPath) => isUrlInstance(urlOrPath) || isUrlString(urlOrPath);
20738
20629
  var toPath = (urlOrPath) => isUrl(urlOrPath) ? fileURLToPath(urlOrPath) : urlOrPath;
20739
20630
 
@@ -20749,7 +20640,7 @@ var partition_default = partition2;
20749
20640
 
20750
20641
  // src/config/resolve-editorconfig.js
20751
20642
  var import_editorconfig = __toESM(require_src(), 1);
20752
- import path2 from "path";
20643
+ import path3 from "path";
20753
20644
 
20754
20645
  // src/config/editorconfig-to-prettier.js
20755
20646
  function removeUnset(editorConfig) {
@@ -20806,26 +20697,57 @@ function editorConfigToPrettier(editorConfig) {
20806
20697
  var editorconfig_to_prettier_default = editorConfigToPrettier;
20807
20698
 
20808
20699
  // src/config/find-project-root.js
20809
- import fs2 from "fs";
20810
- import path from "path";
20700
+ import path2 from "path";
20701
+
20702
+ // node_modules/iterate-directory-up/index.js
20703
+ import * as path from "path";
20704
+ var toAbsolutePath = (value) => path.resolve(toPath(value));
20705
+ function* iterateDirectoryUp(from, to) {
20706
+ from = toAbsolutePath(from);
20707
+ const { root } = path.parse(from);
20708
+ to = to ? toAbsolutePath(to) : root;
20709
+ if (from !== to && !from.startsWith(to)) {
20710
+ return;
20711
+ }
20712
+ for (let directory = from; directory !== to; directory = path.dirname(directory)) {
20713
+ yield directory;
20714
+ }
20715
+ yield to;
20716
+ }
20717
+ var iterate_directory_up_default = iterateDirectoryUp;
20718
+
20719
+ // src/utils/is-directory.js
20720
+ import fs2 from "fs/promises";
20721
+ async function isDirectory(directory, options8) {
20722
+ const allowSymlinks = (options8 == null ? void 0 : options8.allowSymlinks) ?? true;
20723
+ let stats;
20724
+ try {
20725
+ stats = await (allowSymlinks ? fs2.stat : fs2.lstat)(toPath(directory));
20726
+ } catch {
20727
+ return false;
20728
+ }
20729
+ return stats.isDirectory();
20730
+ }
20731
+ var is_directory_default = isDirectory;
20732
+
20733
+ // src/config/find-project-root.js
20811
20734
  var MARKERS = [".git", ".hg"];
20812
- var markerExists = (directory) => MARKERS.some((mark) => fs2.existsSync(path.join(directory, mark)));
20813
- function findProjectRoot(directory) {
20814
- while (!markerExists(directory)) {
20815
- const parentDirectory = path.resolve(directory, "..");
20816
- if (parentDirectory === directory) {
20817
- break;
20735
+ async function findProjectRoot(startDirectory) {
20736
+ for (const directory of iterate_directory_up_default(startDirectory)) {
20737
+ for (const name of MARKERS) {
20738
+ const directoryPath = path2.join(directory, name);
20739
+ if (await is_directory_default(directoryPath, { allowSymlinks: false })) {
20740
+ return directory;
20741
+ }
20818
20742
  }
20819
- directory = parentDirectory;
20820
20743
  }
20821
- return directory;
20822
20744
  }
20823
20745
  var find_project_root_default = findProjectRoot;
20824
20746
 
20825
20747
  // src/config/resolve-editorconfig.js
20826
20748
  async function loadEditorConfig(filePath) {
20827
20749
  const editorConfig = await import_editorconfig.default.parse(filePath, {
20828
- root: find_project_root_default(path2.dirname(path2.resolve(filePath)))
20750
+ root: await find_project_root_default(path3.dirname(path3.resolve(filePath)))
20829
20751
  });
20830
20752
  const config = editorconfig_to_prettier_default(editorConfig);
20831
20753
  return config;
@@ -20839,7 +20761,6 @@ var import_js_yaml = __toESM(require_loader(), 1);
20839
20761
  import { pathToFileURL as pathToFileURL4 } from "url";
20840
20762
 
20841
20763
  // node_modules/parse-json/index.js
20842
- var import_json_parse_even_better_errors = __toESM(require_lib4(), 1);
20843
20764
  var import_code_frame2 = __toESM(require_lib3(), 1);
20844
20765
 
20845
20766
  // node_modules/index-to-position/index.js
@@ -20862,6 +20783,7 @@ function indexToLineColumn(text, textIndex, { oneBased = false } = {}) {
20862
20783
  }
20863
20784
 
20864
20785
  // node_modules/parse-json/index.js
20786
+ var getCodePoint = (character) => `\\u{${character.codePointAt(0).toString(16)}}`;
20865
20787
  var _message;
20866
20788
  var _JSONError = class _JSONError extends Error {
20867
20789
  constructor(message) {
@@ -20890,7 +20812,7 @@ _message = new WeakMap();
20890
20812
  var JSONError = _JSONError;
20891
20813
  var generateCodeFrame = (string, location, highlightCode = true) => (0, import_code_frame2.codeFrameColumns)(string, { start: location }, { highlightCode });
20892
20814
  var getErrorLocation = (string, message) => {
20893
- const match = message.match(/in JSON at position (?<index>\d+)(?: \(line (?<line>\d+) column (?<column>\d+)\))? while parsing/);
20815
+ const match = message.match(/in JSON at position (?<index>\d+)(?: \(line (?<line>\d+) column (?<column>\d+)\))?$/);
20894
20816
  if (!match) {
20895
20817
  return;
20896
20818
  }
@@ -20905,9 +20827,14 @@ var getErrorLocation = (string, message) => {
20905
20827
  }
20906
20828
  return indexToLineColumn(string, index, { oneBased: true });
20907
20829
  };
20908
- function parseJson(string, reviver, filename) {
20830
+ var addCodePointToUnexpectedToken = (message) => message.replace(
20831
+ // TODO[engine:node@>=20]: The token always quoted after Node.js 20
20832
+ /(?<=^Unexpected token )(?<quote>')?(.)\k<quote>/,
20833
+ (_, _quote, token) => `"${token}"(${getCodePoint(token)})`
20834
+ );
20835
+ function parseJson(string, reviver, fileName) {
20909
20836
  if (typeof reviver === "string") {
20910
- filename = reviver;
20837
+ fileName = reviver;
20911
20838
  reviver = void 0;
20912
20839
  }
20913
20840
  let message;
@@ -20916,17 +20843,15 @@ function parseJson(string, reviver, filename) {
20916
20843
  } catch (error) {
20917
20844
  message = error.message;
20918
20845
  }
20919
- try {
20920
- (0, import_json_parse_even_better_errors.default)(string, reviver);
20921
- } catch (error) {
20922
- message = error.message;
20846
+ let location;
20847
+ if (string) {
20848
+ location = getErrorLocation(string, message);
20849
+ message = addCodePointToUnexpectedToken(message);
20850
+ } else {
20851
+ message += " while parsing empty string";
20923
20852
  }
20924
- message = message.replaceAll("\n", "");
20925
20853
  const jsonError = new JSONError(message);
20926
- if (filename) {
20927
- jsonError.fileName = filename;
20928
- }
20929
- const location = getErrorLocation(string, message);
20854
+ jsonError.fileName = fileName;
20930
20855
  if (location) {
20931
20856
  jsonError.codeFrame = generateCodeFrame(string, location);
20932
20857
  jsonError.rawCodeFrame = generateCodeFrame(
@@ -20958,7 +20883,7 @@ import assert5 from "assert";
20958
20883
  import { Stats, statSync, realpathSync } from "fs";
20959
20884
  import process3 from "process";
20960
20885
  import { URL as URL3, fileURLToPath as fileURLToPath5, pathToFileURL as pathToFileURL2 } from "url";
20961
- import path4 from "path";
20886
+ import path5 from "path";
20962
20887
  import { builtinModules } from "module";
20963
20888
 
20964
20889
  // node_modules/import-meta-resolve/lib/get-format.js
@@ -20969,7 +20894,7 @@ import { URL as URL2, fileURLToPath as fileURLToPath3 } from "url";
20969
20894
 
20970
20895
  // node_modules/import-meta-resolve/lib/package-json-reader.js
20971
20896
  import fs3 from "fs";
20972
- import path3 from "path";
20897
+ import path4 from "path";
20973
20898
  import { fileURLToPath as fileURLToPath2 } from "url";
20974
20899
 
20975
20900
  // node_modules/import-meta-resolve/lib/errors.js
@@ -21090,8 +21015,8 @@ codes.ERR_INVALID_PACKAGE_CONFIG = createError(
21090
21015
  * @param {string} [base]
21091
21016
  * @param {string} [message]
21092
21017
  */
21093
- (path9, base, message) => {
21094
- return `Invalid package config ${path9}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`;
21018
+ (path10, base, message) => {
21019
+ return `Invalid package config ${path10}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`;
21095
21020
  },
21096
21021
  Error
21097
21022
  );
@@ -21123,8 +21048,8 @@ codes.ERR_MODULE_NOT_FOUND = createError(
21123
21048
  * @param {string} base
21124
21049
  * @param {boolean} [exactUrl]
21125
21050
  */
21126
- (path9, base, exactUrl = false) => {
21127
- return `Cannot find ${exactUrl ? "module" : "package"} '${path9}' imported from ${base}`;
21051
+ (path10, base, exactUrl = false) => {
21052
+ return `Cannot find ${exactUrl ? "module" : "package"} '${path10}' imported from ${base}`;
21128
21053
  },
21129
21054
  Error
21130
21055
  );
@@ -21170,8 +21095,8 @@ codes.ERR_UNKNOWN_FILE_EXTENSION = createError(
21170
21095
  * @param {string} ext
21171
21096
  * @param {string} path
21172
21097
  */
21173
- (ext, path9) => {
21174
- return `Unknown file extension "${ext}" for ${path9}`;
21098
+ (ext, path10) => {
21099
+ return `Unknown file extension "${ext}" for ${path10}`;
21175
21100
  },
21176
21101
  TypeError
21177
21102
  );
@@ -21325,7 +21250,7 @@ function read(jsonPath, { base, specifier }) {
21325
21250
  }
21326
21251
  let string;
21327
21252
  try {
21328
- string = fs3.readFileSync(path3.toNamespacedPath(jsonPath), "utf8");
21253
+ string = fs3.readFileSync(path4.toNamespacedPath(jsonPath), "utf8");
21329
21254
  } catch (error) {
21330
21255
  const exception = (
21331
21256
  /** @type {ErrnoException} */
@@ -21581,7 +21506,7 @@ Default "index" lookups for the main are deprecated for ES modules.`,
21581
21506
  "DeprecationWarning",
21582
21507
  "DEP0151"
21583
21508
  );
21584
- } else if (path4.resolve(pkgPath, main) !== urlPath) {
21509
+ } else if (path5.resolve(pkgPath, main) !== urlPath) {
21585
21510
  process3.emitWarning(
21586
21511
  `Package ${pkgPath} has a "main" field set to "${main}", excluding the full filename and extension to the resolved file at "${urlPath.slice(
21587
21512
  pkgPath.length
@@ -21592,9 +21517,9 @@ Default "index" lookups for the main are deprecated for ES modules.`,
21592
21517
  );
21593
21518
  }
21594
21519
  }
21595
- function tryStatSync(path9) {
21520
+ function tryStatSync(path10) {
21596
21521
  try {
21597
- return statSync(path9);
21522
+ return statSync(path10);
21598
21523
  } catch {
21599
21524
  return new Stats();
21600
21525
  }
@@ -21692,7 +21617,7 @@ function finalizeResolution(resolved, base, preserveSymlinks) {
21692
21617
  if (!preserveSymlinks) {
21693
21618
  const real = realpathSync(filePath);
21694
21619
  const { search, hash } = resolved;
21695
- resolved = pathToFileURL2(real + (filePath.endsWith(path4.sep) ? "/" : ""));
21620
+ resolved = pathToFileURL2(real + (filePath.endsWith(path5.sep) ? "/" : ""));
21696
21621
  resolved.search = search;
21697
21622
  resolved.hash = hash;
21698
21623
  }
@@ -22336,7 +22261,7 @@ function defaultResolve(specifier, context = {}) {
22336
22261
  }
22337
22262
 
22338
22263
  // node_modules/import-meta-resolve/index.js
22339
- function resolve(specifier, parent) {
22264
+ function resolve2(specifier, parent) {
22340
22265
  if (!parent) {
22341
22266
  throw new Error(
22342
22267
  "Please pass `parent`: `import-meta-resolve` cannot ponyfill that"
@@ -22358,7 +22283,7 @@ function resolve(specifier, parent) {
22358
22283
 
22359
22284
  // src/utils/import-from-file.js
22360
22285
  function importFromFile(specifier, parent) {
22361
- const url2 = resolve(specifier, pathToFileURL3(parent).href);
22286
+ const url2 = resolve2(specifier, pathToFileURL3(parent).href);
22362
22287
  return import(url2);
22363
22288
  }
22364
22289
  var import_from_file_default = importFromFile;
@@ -22488,7 +22413,14 @@ function loadPrettierConfig(filePath, options8) {
22488
22413
  const { load, search } = getPrettierConfigExplorer({
22489
22414
  cache: Boolean(useCache)
22490
22415
  });
22491
- return configPath ? load(configPath) : search(filePath ? path5.resolve(filePath) : void 0);
22416
+ if (configPath) {
22417
+ return load(configPath);
22418
+ }
22419
+ if (!filePath) {
22420
+ return search();
22421
+ }
22422
+ const dirname2 = path6.dirname(path6.resolve(filePath));
22423
+ return search(dirname2);
22492
22424
  }
22493
22425
  async function resolveConfig(fileUrlOrPath, options8) {
22494
22426
  options8 = { useCache: true, ...options8 };
@@ -22506,23 +22438,22 @@ async function resolveConfig(fileUrlOrPath, options8) {
22506
22438
  };
22507
22439
  if (Array.isArray(merged.plugins)) {
22508
22440
  merged.plugins = merged.plugins.map(
22509
- (value) => typeof value === "string" && value.startsWith(".") ? path5.resolve(path5.dirname(result.filepath), value) : value
22441
+ (value) => typeof value === "string" && value.startsWith(".") ? path6.resolve(path6.dirname(result.filepath), value) : value
22510
22442
  );
22511
22443
  }
22512
22444
  return merged;
22513
22445
  }
22514
22446
  async function resolveConfigFile(fileUrlOrPath) {
22515
- const { search } = getPrettierConfigExplorer({ cache: false });
22516
- const result = await search(
22517
- fileUrlOrPath ? path5.resolve(toPath(fileUrlOrPath)) : void 0
22518
- );
22447
+ const { search } = get_prettier_config_explorer_default();
22448
+ const dirname2 = fileUrlOrPath ? path6.dirname(path6.resolve(toPath(fileUrlOrPath))) : void 0;
22449
+ const result = await search(dirname2);
22519
22450
  return (result == null ? void 0 : result.filepath) ?? null;
22520
22451
  }
22521
22452
  function mergeOverrides(configResult, filePath) {
22522
22453
  const { config, filepath: configPath } = configResult || {};
22523
22454
  const { overrides, ...options8 } = config || {};
22524
22455
  if (filePath && overrides) {
22525
- const relativeFilePath = path5.relative(path5.dirname(configPath), filePath);
22456
+ const relativeFilePath = path6.relative(path6.dirname(configPath), filePath);
22526
22457
  for (const override of overrides) {
22527
22458
  if (pathMatchesGlobs(
22528
22459
  relativeFilePath,
@@ -22553,7 +22484,7 @@ function pathMatchesGlobs(filePath, patterns, excludedPatterns) {
22553
22484
  }
22554
22485
 
22555
22486
  // src/utils/ignore.js
22556
- import path6 from "path";
22487
+ import path7 from "path";
22557
22488
  import url from "url";
22558
22489
  var import_ignore = __toESM(require_ignore(), 1);
22559
22490
 
@@ -22576,7 +22507,7 @@ var read_file_default = readFile;
22576
22507
 
22577
22508
  // src/utils/ignore.js
22578
22509
  var createIgnore = import_ignore.default.default;
22579
- var slash = path6.sep === "\\" ? (filePath) => string_replace_all_default(
22510
+ var slash = path7.sep === "\\" ? (filePath) => string_replace_all_default(
22580
22511
  /* isOptionalObject*/
22581
22512
  false,
22582
22513
  filePath,
@@ -22585,14 +22516,11 @@ var slash = path6.sep === "\\" ? (filePath) => string_replace_all_default(
22585
22516
  ) : (filePath) => filePath;
22586
22517
  function getRelativePath(file, ignoreFile) {
22587
22518
  const ignoreFilePath = toPath(ignoreFile);
22588
- const filePath = isUrl(file) ? url.fileURLToPath(file) : (
22589
- // @ts-expect-error -- URLs handled by `isUrl`
22590
- path6.resolve(file)
22591
- );
22592
- return path6.relative(
22519
+ const filePath = isUrl(file) ? url.fileURLToPath(file) : path7.resolve(file);
22520
+ return path7.relative(
22593
22521
  // If there's an ignore-path set, the filename must be relative to the
22594
22522
  // ignore path, not the current working directory.
22595
- ignoreFilePath ? path6.dirname(ignoreFilePath) : process.cwd(),
22523
+ ignoreFilePath ? path7.dirname(ignoreFilePath) : process.cwd(),
22596
22524
  filePath
22597
22525
  );
22598
22526
  }
@@ -22660,12 +22588,12 @@ var get_file_info_default = getFileInfo;
22660
22588
 
22661
22589
  // src/main/plugins/load-plugin.js
22662
22590
  import { pathToFileURL as pathToFileURL5 } from "url";
22663
- import path8 from "path";
22591
+ import path9 from "path";
22664
22592
 
22665
22593
  // src/utils/import-from-directory.js
22666
- import path7 from "path";
22594
+ import path8 from "path";
22667
22595
  function importFromDirectory(specifier, directory) {
22668
- return import_from_file_default(specifier, path7.join(directory, "noop.js"));
22596
+ return import_from_file_default(specifier, path8.join(directory, "noop.js"));
22669
22597
  }
22670
22598
  var import_from_directory_default = importFromDirectory;
22671
22599
 
@@ -22680,7 +22608,7 @@ var loadPluginFromDirectory = mem(
22680
22608
  );
22681
22609
  var importPlugin = mem(async (name) => {
22682
22610
  try {
22683
- return await import(pathToFileURL5(path8.resolve(name)).href);
22611
+ return await import(pathToFileURL5(path9.resolve(name)).href);
22684
22612
  } catch {
22685
22613
  return import_from_directory_default(name, process.cwd());
22686
22614
  }
@@ -23976,7 +23904,7 @@ function isNextLineEmpty2(text, startIndex) {
23976
23904
  import * as doc from "./doc.mjs";
23977
23905
 
23978
23906
  // src/main/version.evaluate.cjs
23979
- var version_evaluate_default = "3.1.0";
23907
+ var version_evaluate_default = "4.0.0-alpha.0";
23980
23908
 
23981
23909
  // src/index.js
23982
23910
  function withPlugins(fn, optionsArgumentIndex = 1) {