prettier 2.6.0 → 2.6.1

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/LICENSE CHANGED
@@ -118,7 +118,7 @@ Repository: <https://github.com/babel/babel.git>
118
118
 
119
119
  ----------------------------------------
120
120
 
121
- ### @babel/parser@v7.17.3
121
+ ### @babel/parser@v7.17.8
122
122
 
123
123
  License: MIT
124
124
  By: The Babel Team
@@ -172,7 +172,7 @@ License: MIT
172
172
 
173
173
  ----------------------------------------
174
174
 
175
- ### @glimmer/syntax@v0.84.0
175
+ ### @glimmer/syntax@v0.84.1
176
176
 
177
177
  License: MIT
178
178
 
@@ -198,7 +198,7 @@ License: MIT
198
198
 
199
199
  ----------------------------------------
200
200
 
201
- ### @glimmer/util@v0.84.0
201
+ ### @glimmer/util@v0.84.1
202
202
 
203
203
  License: MIT
204
204
 
@@ -337,7 +337,7 @@ License: MIT
337
337
 
338
338
  ----------------------------------------
339
339
 
340
- ### @typescript-eslint/types@v5.15.0
340
+ ### @typescript-eslint/types@v5.16.0
341
341
 
342
342
  License: MIT
343
343
  Repository: <https://github.com/typescript-eslint/typescript-eslint.git>
@@ -366,7 +366,7 @@ Repository: <https://github.com/typescript-eslint/typescript-eslint.git>
366
366
 
367
367
  ----------------------------------------
368
368
 
369
- ### @typescript-eslint/typescript-estree@v5.15.0
369
+ ### @typescript-eslint/typescript-estree@v5.16.0
370
370
 
371
371
  License: BSD-2-Clause
372
372
  Repository: <https://github.com/typescript-eslint/typescript-eslint.git>
@@ -400,7 +400,7 @@ Repository: <https://github.com/typescript-eslint/typescript-eslint.git>
400
400
 
401
401
  ----------------------------------------
402
402
 
403
- ### @typescript-eslint/visitor-keys@v5.15.0
403
+ ### @typescript-eslint/visitor-keys@v5.16.0
404
404
 
405
405
  License: MIT
406
406
  Repository: <https://github.com/typescript-eslint/typescript-eslint.git>
@@ -1946,7 +1946,7 @@ Repository: <git+https://github.com/mk-pmb/flatten-js.git>
1946
1946
 
1947
1947
  ----------------------------------------
1948
1948
 
1949
- ### flow-parser@v0.173.0
1949
+ ### flow-parser@v0.174.1
1950
1950
 
1951
1951
  License: MIT
1952
1952
  By: Flow Team
@@ -3233,7 +3233,7 @@ By: Kat Marchán
3233
3233
 
3234
3234
  ----------------------------------------
3235
3235
 
3236
- ### json5@v2.2.0
3236
+ ### json5@v2.2.1
3237
3237
 
3238
3238
  License: MIT
3239
3239
  By: Aseem Kishore
@@ -3709,7 +3709,7 @@ Repository: <git://github.com/isaacs/minimatch.git>
3709
3709
 
3710
3710
  ----------------------------------------
3711
3711
 
3712
- ### minimist@v1.2.5
3712
+ ### minimist@v1.2.6
3713
3713
 
3714
3714
  License: MIT
3715
3715
  By: James Halliday
@@ -4755,42 +4755,6 @@ By: Sindre Sorhus
4755
4755
 
4756
4756
  ----------------------------------------
4757
4757
 
4758
- ### source-map@v0.6.1
4759
-
4760
- License: BSD-3-Clause
4761
- By: Nick Fitzgerald
4762
- Repository: <http://github.com/mozilla/source-map.git>
4763
-
4764
- > Copyright (c) 2009-2011, Mozilla Foundation and contributors
4765
- > All rights reserved.
4766
- >
4767
- > Redistribution and use in source and binary forms, with or without
4768
- > modification, are permitted provided that the following conditions are met:
4769
- >
4770
- > * Redistributions of source code must retain the above copyright notice, this
4771
- > list of conditions and the following disclaimer.
4772
- >
4773
- > * Redistributions in binary form must reproduce the above copyright notice,
4774
- > this list of conditions and the following disclaimer in the documentation
4775
- > and/or other materials provided with the distribution.
4776
- >
4777
- > * Neither the names of the Mozilla Foundation nor the names of project
4778
- > contributors may be used to endorse or promote products derived from this
4779
- > software without specific prior written permission.
4780
- >
4781
- > THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
4782
- > ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
4783
- > WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
4784
- > DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
4785
- > FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
4786
- > DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
4787
- > SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
4788
- > CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
4789
- > OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
4790
- > OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
4791
-
4792
- ----------------------------------------
4793
-
4794
4758
  ### state-toggle@v1.0.3
4795
4759
 
4796
4760
  License: MIT
package/cli.js CHANGED
@@ -4140,7 +4140,7 @@ var require_minimist = __commonJS2({
4140
4140
  var o = obj;
4141
4141
  for (var i2 = 0; i2 < keys.length - 1; i2++) {
4142
4142
  var key2 = keys[i2];
4143
- if (key2 === "__proto__")
4143
+ if (isConstructorOrProto(o, key2))
4144
4144
  return;
4145
4145
  if (o[key2] === void 0)
4146
4146
  o[key2] = {};
@@ -4151,7 +4151,7 @@ var require_minimist = __commonJS2({
4151
4151
  o = o[key2];
4152
4152
  }
4153
4153
  var key2 = keys[keys.length - 1];
4154
- if (key2 === "__proto__")
4154
+ if (isConstructorOrProto(o, key2))
4155
4155
  return;
4156
4156
  if (o === Object.prototype || o === Number.prototype || o === String.prototype)
4157
4157
  o = {};
@@ -4279,6 +4279,9 @@ var require_minimist = __commonJS2({
4279
4279
  return true;
4280
4280
  return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x);
4281
4281
  }
4282
+ function isConstructorOrProto(obj, key) {
4283
+ return key === "constructor" && typeof obj[key] === "function" || key === "__proto__";
4284
+ }
4282
4285
  }
4283
4286
  });
4284
4287
  var require_minimist2 = __commonJS2({
@@ -12113,11 +12116,23 @@ ${error.message}`);
12113
12116
  };
12114
12117
  }
12115
12118
  });
12119
+ var require_utils5 = __commonJS2({
12120
+ "src/cli/utils.js"(exports2, module2) {
12121
+ "use strict";
12122
+ var printToScreen2 = console.log.bind(console);
12123
+ module2.exports = {
12124
+ printToScreen: printToScreen2
12125
+ };
12126
+ }
12127
+ });
12116
12128
  var require_file_info = __commonJS2({
12117
12129
  "src/cli/file-info.js"(exports2, module2) {
12118
12130
  "use strict";
12119
12131
  var stringify2 = require_fast_json_stable_stringify();
12120
12132
  var prettier2 = require("./index.js");
12133
+ var {
12134
+ printToScreen: printToScreen2
12135
+ } = require_utils5();
12121
12136
  async function logFileInfoOrDie2(context) {
12122
12137
  const {
12123
12138
  fileInfo: file,
@@ -12134,7 +12149,7 @@ var require_file_info = __commonJS2({
12134
12149
  pluginSearchDirs,
12135
12150
  resolveConfig: config !== false
12136
12151
  });
12137
- context.logger.log(prettier2.format(stringify2(fileInfo), {
12152
+ printToScreen2(prettier2.format(stringify2(fileInfo), {
12138
12153
  parser: "json"
12139
12154
  }));
12140
12155
  }
@@ -12146,11 +12161,14 @@ var require_find_config_path = __commonJS2({
12146
12161
  "use strict";
12147
12162
  var path = require("path");
12148
12163
  var prettier2 = require("./index.js");
12164
+ var {
12165
+ printToScreen: printToScreen2
12166
+ } = require_utils5();
12149
12167
  async function logResolvedConfigPathOrDie2(context) {
12150
12168
  const file = context.argv.findConfigPath;
12151
12169
  const configFile = await prettier2.resolveConfigFile(file);
12152
12170
  if (configFile) {
12153
- context.logger.log(path.relative(process.cwd(), configFile));
12171
+ printToScreen2(path.relative(process.cwd(), configFile));
12154
12172
  } else {
12155
12173
  throw new Error(`Can not find configure file for "${file}"`);
12156
12174
  }
@@ -12180,6 +12198,9 @@ var {
12180
12198
  isNonEmptyArray
12181
12199
  }
12182
12200
  } = require_prettier_internal();
12201
+ var {
12202
+ printToScreen
12203
+ } = require_utils5();
12183
12204
  async function run(rawArguments) {
12184
12205
  let logger = createLogger();
12185
12206
  try {
@@ -12218,15 +12239,15 @@ async function main(rawArguments, logger) {
12218
12239
  throw new Error("Cannot use --file-info with multiple files");
12219
12240
  }
12220
12241
  if (context.argv.version) {
12221
- logger.log(prettier.version);
12242
+ printToScreen(prettier.version);
12222
12243
  return;
12223
12244
  }
12224
12245
  if (context.argv.help !== void 0) {
12225
- logger.log(typeof context.argv.help === "string" && context.argv.help !== "" ? createDetailedUsage(context, context.argv.help) : createUsage(context));
12246
+ printToScreen(typeof context.argv.help === "string" && context.argv.help !== "" ? createDetailedUsage(context, context.argv.help) : createUsage(context));
12226
12247
  return;
12227
12248
  }
12228
12249
  if (context.argv.supportInfo) {
12229
- logger.log(prettier.format(stringify(prettier.getSupportInfo()), {
12250
+ printToScreen(prettier.format(stringify(prettier.getSupportInfo()), {
12230
12251
  parser: "json"
12231
12252
  }));
12232
12253
  return;
@@ -12242,8 +12263,8 @@ async function main(rawArguments, logger) {
12242
12263
  } else if (hasFilePatterns) {
12243
12264
  await formatFiles(context);
12244
12265
  } else {
12245
- logger.log(createUsage(context));
12246
12266
  process.exitCode = 1;
12267
+ printToScreen(createUsage(context));
12247
12268
  }
12248
12269
  }
12249
12270
  module.exports = {