prettier 1.19.0 → 1.19.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/bin-prettier.js CHANGED
@@ -12,7 +12,7 @@ var events$1 = _interopDefault(require('events'));
12
12
  var readline$1 = _interopDefault(require('readline'));
13
13
 
14
14
  var name = "prettier";
15
- var version = "1.19.0";
15
+ var version = "1.19.1";
16
16
  var description = "Prettier is an opinionated code formatter";
17
17
  var bin = {
18
18
  prettier: "./bin/prettier.js"
@@ -48,7 +48,7 @@ var dependencies = {
48
48
  "find-parent-dir": "0.3.0",
49
49
  "find-project-root": "1.1.1",
50
50
  "flow-parser": "0.111.3",
51
- "get-stream": "5.1.0",
51
+ "get-stream": "4.1.0",
52
52
  globby: "6.1.0",
53
53
  graphql: "14.5.8",
54
54
  "html-element-attributes": "2.2.0",
@@ -108,7 +108,7 @@ var devDependencies = {
108
108
  "jest-snapshot-serializer-raw": "1.1.0",
109
109
  "jest-watch-typeahead": "0.4.0",
110
110
  mkdirp: "0.5.1",
111
- prettier: "1.18.2",
111
+ prettier: "1.19.0",
112
112
  prettylint: "1.0.0",
113
113
  rimraf: "3.0.0",
114
114
  rollup: "1.26.3",
@@ -142,7 +142,7 @@ var scripts = {
142
142
  build: "node --max-old-space-size=3072 ./scripts/build/build.js",
143
143
  "build-docs": "node ./scripts/build-docs.js",
144
144
  "check-deps": "node ./scripts/check-deps.js",
145
- spellcheck: "npx -p cspell@4.0.31 cspell {bin,scripts,src}/**/*.js {docs,website/blog}/**/*.md CHANGELOG.unreleased.md"
145
+ spellcheck: "npx -p cspell@4.0.31 cspell {bin,scripts,src}/**/*.js {docs,website/blog,changelog_unreleased}/**/*.md"
146
146
  };
147
147
  var _package = {
148
148
  name: name,
@@ -34370,7 +34370,8 @@ function printTypeParameters(path, options, print, paramsKey) {
34370
34370
  var grandparent = path.getNode(2);
34371
34371
  var greatGreatGrandParent = path.getNode(4);
34372
34372
  var isParameterInTestCall = grandparent != null && isTestCall$1(grandparent);
34373
- var shouldInline = isParameterInTestCall || n[paramsKey].length === 0 || n[paramsKey].length === 1 && (shouldHugType(n[paramsKey][0]) || n[paramsKey][0].type === "GenericTypeAnnotation" && shouldHugType(n[paramsKey][0].id) || n[paramsKey][0].type === "TSTypeReference" && shouldHugType(n[paramsKey][0].typeName) || n[paramsKey][0].type === "NullableTypeAnnotation" || greatGreatGrandParent && greatGreatGrandParent.type === "VariableDeclarator" && grandparent && grandparent.type === "TSTypeAnnotation" && n[paramsKey][0].type !== "TSConditionalType" && n[paramsKey][0].type !== "TSMappedType");
34373
+ var shouldInline = isParameterInTestCall || n[paramsKey].length === 0 || n[paramsKey].length === 1 && (shouldHugType(n[paramsKey][0]) || n[paramsKey][0].type === "GenericTypeAnnotation" && shouldHugType(n[paramsKey][0].id) || n[paramsKey][0].type === "TSTypeReference" && shouldHugType(n[paramsKey][0].typeName) || n[paramsKey][0].type === "NullableTypeAnnotation" || // See https://github.com/prettier/prettier/pull/6467 for the context.
34374
+ greatGreatGrandParent && greatGreatGrandParent.type === "VariableDeclarator" && grandparent && grandparent.type === "TSTypeAnnotation" && n[paramsKey][0].type !== "TSUnionType" && n[paramsKey][0].type !== "UnionTypeAnnotation" && n[paramsKey][0].type !== "TSConditionalType" && n[paramsKey][0].type !== "TSMappedType");
34374
34375
 
34375
34376
  if (shouldInline) {
34376
34377
  return concat$6(["<", join$4(", ", path.map(print, paramsKey)), ">"]);
@@ -42971,7 +42972,7 @@ var options$6 = {
42971
42972
  }]
42972
42973
  },
42973
42974
  vueIndentScriptAndStyle: {
42974
- since: "1.19.0-beta.1",
42975
+ since: "1.19.0",
42975
42976
  category: CATEGORY_HTML,
42976
42977
  type: "boolean",
42977
42978
  default: false,
package/index.js CHANGED
@@ -10,7 +10,7 @@ var util$2 = _interopDefault(require('util'));
10
10
  var events$1 = _interopDefault(require('events'));
11
11
 
12
12
  var name = "prettier";
13
- var version = "1.19.0";
13
+ var version = "1.19.1";
14
14
  var description = "Prettier is an opinionated code formatter";
15
15
  var bin = {
16
16
  prettier: "./bin/prettier.js"
@@ -46,7 +46,7 @@ var dependencies = {
46
46
  "find-parent-dir": "0.3.0",
47
47
  "find-project-root": "1.1.1",
48
48
  "flow-parser": "0.111.3",
49
- "get-stream": "5.1.0",
49
+ "get-stream": "4.1.0",
50
50
  globby: "6.1.0",
51
51
  graphql: "14.5.8",
52
52
  "html-element-attributes": "2.2.0",
@@ -106,7 +106,7 @@ var devDependencies = {
106
106
  "jest-snapshot-serializer-raw": "1.1.0",
107
107
  "jest-watch-typeahead": "0.4.0",
108
108
  mkdirp: "0.5.1",
109
- prettier: "1.18.2",
109
+ prettier: "1.19.0",
110
110
  prettylint: "1.0.0",
111
111
  rimraf: "3.0.0",
112
112
  rollup: "1.26.3",
@@ -140,7 +140,7 @@ var scripts = {
140
140
  build: "node --max-old-space-size=3072 ./scripts/build/build.js",
141
141
  "build-docs": "node ./scripts/build-docs.js",
142
142
  "check-deps": "node ./scripts/check-deps.js",
143
- spellcheck: "npx -p cspell@4.0.31 cspell {bin,scripts,src}/**/*.js {docs,website/blog}/**/*.md CHANGELOG.unreleased.md"
143
+ spellcheck: "npx -p cspell@4.0.31 cspell {bin,scripts,src}/**/*.js {docs,website/blog,changelog_unreleased}/**/*.md"
144
144
  };
145
145
  var _package = {
146
146
  name: name,
@@ -34364,7 +34364,8 @@ function printTypeParameters(path, options, print, paramsKey) {
34364
34364
  var grandparent = path.getNode(2);
34365
34365
  var greatGreatGrandParent = path.getNode(4);
34366
34366
  var isParameterInTestCall = grandparent != null && isTestCall$1(grandparent);
34367
- var shouldInline = isParameterInTestCall || n[paramsKey].length === 0 || n[paramsKey].length === 1 && (shouldHugType(n[paramsKey][0]) || n[paramsKey][0].type === "GenericTypeAnnotation" && shouldHugType(n[paramsKey][0].id) || n[paramsKey][0].type === "TSTypeReference" && shouldHugType(n[paramsKey][0].typeName) || n[paramsKey][0].type === "NullableTypeAnnotation" || greatGreatGrandParent && greatGreatGrandParent.type === "VariableDeclarator" && grandparent && grandparent.type === "TSTypeAnnotation" && n[paramsKey][0].type !== "TSConditionalType" && n[paramsKey][0].type !== "TSMappedType");
34367
+ var shouldInline = isParameterInTestCall || n[paramsKey].length === 0 || n[paramsKey].length === 1 && (shouldHugType(n[paramsKey][0]) || n[paramsKey][0].type === "GenericTypeAnnotation" && shouldHugType(n[paramsKey][0].id) || n[paramsKey][0].type === "TSTypeReference" && shouldHugType(n[paramsKey][0].typeName) || n[paramsKey][0].type === "NullableTypeAnnotation" || // See https://github.com/prettier/prettier/pull/6467 for the context.
34368
+ greatGreatGrandParent && greatGreatGrandParent.type === "VariableDeclarator" && grandparent && grandparent.type === "TSTypeAnnotation" && n[paramsKey][0].type !== "TSUnionType" && n[paramsKey][0].type !== "UnionTypeAnnotation" && n[paramsKey][0].type !== "TSConditionalType" && n[paramsKey][0].type !== "TSMappedType");
34368
34369
 
34369
34370
  if (shouldInline) {
34370
34371
  return concat$6(["<", join$4(", ", path.map(print, paramsKey)), ">"]);
@@ -42965,7 +42966,7 @@ var options$6 = {
42965
42966
  }]
42966
42967
  },
42967
42968
  vueIndentScriptAndStyle: {
42968
- since: "1.19.0-beta.1",
42969
+ since: "1.19.0",
42969
42970
  category: CATEGORY_HTML,
42970
42971
  type: "boolean",
42971
42972
  default: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prettier",
3
- "version": "1.19.0",
3
+ "version": "1.19.1",
4
4
  "description": "Prettier is an opinionated code formatter",
5
5
  "bin": "./bin-prettier.js",
6
6
  "repository": "prettier/prettier",
package/standalone.js CHANGED
@@ -5,7 +5,7 @@
5
5
  }(this, (function () { 'use strict';
6
6
 
7
7
  var name = "prettier";
8
- var version = "1.19.0";
8
+ var version = "1.19.1";
9
9
  var description = "Prettier is an opinionated code formatter";
10
10
  var bin = {
11
11
  prettier: "./bin/prettier.js"
@@ -41,7 +41,7 @@
41
41
  "find-parent-dir": "0.3.0",
42
42
  "find-project-root": "1.1.1",
43
43
  "flow-parser": "0.111.3",
44
- "get-stream": "5.1.0",
44
+ "get-stream": "4.1.0",
45
45
  globby: "6.1.0",
46
46
  graphql: "14.5.8",
47
47
  "html-element-attributes": "2.2.0",
@@ -101,7 +101,7 @@
101
101
  "jest-snapshot-serializer-raw": "1.1.0",
102
102
  "jest-watch-typeahead": "0.4.0",
103
103
  mkdirp: "0.5.1",
104
- prettier: "1.18.2",
104
+ prettier: "1.19.0",
105
105
  prettylint: "1.0.0",
106
106
  rimraf: "3.0.0",
107
107
  rollup: "1.26.3",
@@ -135,7 +135,7 @@
135
135
  build: "node --max-old-space-size=3072 ./scripts/build/build.js",
136
136
  "build-docs": "node ./scripts/build-docs.js",
137
137
  "check-deps": "node ./scripts/check-deps.js",
138
- spellcheck: "npx -p cspell@4.0.31 cspell {bin,scripts,src}/**/*.js {docs,website/blog}/**/*.md CHANGELOG.unreleased.md"
138
+ spellcheck: "npx -p cspell@4.0.31 cspell {bin,scripts,src}/**/*.js {docs,website/blog,changelog_unreleased}/**/*.md"
139
139
  };
140
140
  var _package = {
141
141
  name: name,
@@ -21705,7 +21705,7 @@
21705
21705
  }]
21706
21706
  },
21707
21707
  vueIndentScriptAndStyle: {
21708
- since: "1.19.0-beta.1",
21708
+ since: "1.19.0",
21709
21709
  category: CATEGORY_HTML,
21710
21710
  type: "boolean",
21711
21711
  default: false,
@@ -27956,7 +27956,8 @@
27956
27956
  var grandparent = path.getNode(2);
27957
27957
  var greatGreatGrandParent = path.getNode(4);
27958
27958
  var isParameterInTestCall = grandparent != null && isTestCall$1(grandparent);
27959
- var shouldInline = isParameterInTestCall || n[paramsKey].length === 0 || n[paramsKey].length === 1 && (shouldHugType(n[paramsKey][0]) || n[paramsKey][0].type === "GenericTypeAnnotation" && shouldHugType(n[paramsKey][0].id) || n[paramsKey][0].type === "TSTypeReference" && shouldHugType(n[paramsKey][0].typeName) || n[paramsKey][0].type === "NullableTypeAnnotation" || greatGreatGrandParent && greatGreatGrandParent.type === "VariableDeclarator" && grandparent && grandparent.type === "TSTypeAnnotation" && n[paramsKey][0].type !== "TSConditionalType" && n[paramsKey][0].type !== "TSMappedType");
27959
+ var shouldInline = isParameterInTestCall || n[paramsKey].length === 0 || n[paramsKey].length === 1 && (shouldHugType(n[paramsKey][0]) || n[paramsKey][0].type === "GenericTypeAnnotation" && shouldHugType(n[paramsKey][0].id) || n[paramsKey][0].type === "TSTypeReference" && shouldHugType(n[paramsKey][0].typeName) || n[paramsKey][0].type === "NullableTypeAnnotation" || // See https://github.com/prettier/prettier/pull/6467 for the context.
27960
+ greatGreatGrandParent && greatGreatGrandParent.type === "VariableDeclarator" && grandparent && grandparent.type === "TSTypeAnnotation" && n[paramsKey][0].type !== "TSUnionType" && n[paramsKey][0].type !== "UnionTypeAnnotation" && n[paramsKey][0].type !== "TSConditionalType" && n[paramsKey][0].type !== "TSMappedType");
27960
27961
 
27961
27962
  if (shouldInline) {
27962
27963
  return concat$d(["<", join$9(", ", path.map(print, paramsKey)), ">"]);
package/third-party.js CHANGED
@@ -33,55 +33,6 @@ function _createClass(Constructor, protoProps, staticProps) {
33
33
  return Constructor;
34
34
  }
35
35
 
36
- function _defineProperty(obj, key, value) {
37
- if (key in obj) {
38
- Object.defineProperty(obj, key, {
39
- value: value,
40
- enumerable: true,
41
- configurable: true,
42
- writable: true
43
- });
44
- } else {
45
- obj[key] = value;
46
- }
47
-
48
- return obj;
49
- }
50
-
51
- function ownKeys(object, enumerableOnly) {
52
- var keys = Object.keys(object);
53
-
54
- if (Object.getOwnPropertySymbols) {
55
- var symbols = Object.getOwnPropertySymbols(object);
56
- if (enumerableOnly) symbols = symbols.filter(function (sym) {
57
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
58
- });
59
- keys.push.apply(keys, symbols);
60
- }
61
-
62
- return keys;
63
- }
64
-
65
- function _objectSpread2(target) {
66
- for (var i = 1; i < arguments.length; i++) {
67
- var source = arguments[i] != null ? arguments[i] : {};
68
-
69
- if (i % 2) {
70
- ownKeys(source, true).forEach(function (key) {
71
- _defineProperty(target, key, source[key]);
72
- });
73
- } else if (Object.getOwnPropertyDescriptors) {
74
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
75
- } else {
76
- ownKeys(source).forEach(function (key) {
77
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
78
- });
79
- }
80
- }
81
-
82
- return target;
83
- }
84
-
85
36
  function _inherits(subClass, superClass) {
86
37
  if (typeof superClass !== "function" && superClass !== null) {
87
38
  throw new TypeError("Super expression must either be null or a function");
@@ -5232,28 +5183,30 @@ var pump = function pump() {
5232
5183
 
5233
5184
  var pump_1 = pump;
5234
5185
 
5235
- var PassThroughStream = stream.PassThrough;
5186
+ var PassThrough = stream.PassThrough;
5236
5187
 
5237
5188
  var bufferStream = function bufferStream(options) {
5238
- options = _objectSpread2({}, options);
5189
+ options = Object.assign({}, options);
5239
5190
  var _options = options,
5240
5191
  array = _options.array;
5241
5192
  var _options2 = options,
5242
5193
  encoding = _options2.encoding;
5243
- var isBuffer = encoding === 'buffer';
5194
+ var buffer = encoding === 'buffer';
5244
5195
  var objectMode = false;
5245
5196
 
5246
5197
  if (array) {
5247
- objectMode = !(encoding || isBuffer);
5198
+ objectMode = !(encoding || buffer);
5248
5199
  } else {
5249
5200
  encoding = encoding || 'utf8';
5250
5201
  }
5251
5202
 
5252
- if (isBuffer) {
5203
+ if (buffer) {
5253
5204
  encoding = null;
5254
5205
  }
5255
5206
 
5256
- var stream = new PassThroughStream({
5207
+ var len = 0;
5208
+ var ret = [];
5209
+ var stream = new PassThrough({
5257
5210
  objectMode
5258
5211
  });
5259
5212
 
@@ -5261,28 +5214,26 @@ var bufferStream = function bufferStream(options) {
5261
5214
  stream.setEncoding(encoding);
5262
5215
  }
5263
5216
 
5264
- var length = 0;
5265
- var chunks = [];
5266
5217
  stream.on('data', function (chunk) {
5267
- chunks.push(chunk);
5218
+ ret.push(chunk);
5268
5219
 
5269
5220
  if (objectMode) {
5270
- length = chunks.length;
5221
+ len = ret.length;
5271
5222
  } else {
5272
- length += chunk.length;
5223
+ len += chunk.length;
5273
5224
  }
5274
5225
  });
5275
5226
 
5276
5227
  stream.getBufferedValue = function () {
5277
5228
  if (array) {
5278
- return chunks;
5229
+ return ret;
5279
5230
  }
5280
5231
 
5281
- return isBuffer ? Buffer.concat(chunks, length) : chunks.join('');
5232
+ return buffer ? Buffer.concat(ret, len) : ret.join('');
5282
5233
  };
5283
5234
 
5284
5235
  stream.getBufferedLength = function () {
5285
- return length;
5236
+ return len;
5286
5237
  };
5287
5238
 
5288
5239
  return stream;
@@ -5307,79 +5258,59 @@ function (_Error) {
5307
5258
  }(_wrapNativeSuper(Error));
5308
5259
 
5309
5260
  function getStream(inputStream, options) {
5310
- var _options, maxBuffer, stream;
5311
-
5312
- return regeneratorRuntime.async(function getStream$(_context) {
5313
- while (1) {
5314
- switch (_context.prev = _context.next) {
5315
- case 0:
5316
- if (inputStream) {
5317
- _context.next = 2;
5318
- break;
5319
- }
5261
+ if (!inputStream) {
5262
+ return Promise.reject(new Error('Expected a stream'));
5263
+ }
5320
5264
 
5321
- return _context.abrupt("return", Promise.reject(new Error('Expected a stream')));
5322
-
5323
- case 2:
5324
- options = _objectSpread2({
5325
- maxBuffer: Infinity
5326
- }, options);
5327
- _options = options, maxBuffer = _options.maxBuffer;
5328
- _context.next = 6;
5329
- return regeneratorRuntime.awrap(new Promise(function (resolve, reject) {
5330
- var rejectPromise = function rejectPromise(error) {
5331
- if (error) {
5332
- // A null check
5333
- error.bufferedData = stream.getBufferedValue();
5334
- }
5335
-
5336
- reject(error);
5337
- };
5338
-
5339
- stream = pump_1(inputStream, bufferStream(options), function (error) {
5340
- if (error) {
5341
- rejectPromise(error);
5342
- return;
5343
- }
5344
-
5345
- resolve();
5346
- });
5347
- stream.on('data', function () {
5348
- if (stream.getBufferedLength() > maxBuffer) {
5349
- rejectPromise(new MaxBufferError());
5350
- }
5351
- });
5352
- }));
5265
+ options = Object.assign({
5266
+ maxBuffer: Infinity
5267
+ }, options);
5268
+ var _options = options,
5269
+ maxBuffer = _options.maxBuffer;
5270
+ var stream;
5271
+ return new Promise(function (resolve, reject) {
5272
+ var rejectPromise = function rejectPromise(error) {
5273
+ if (error) {
5274
+ // A null check
5275
+ error.bufferedData = stream.getBufferedValue();
5276
+ }
5353
5277
 
5354
- case 6:
5355
- return _context.abrupt("return", stream.getBufferedValue());
5278
+ reject(error);
5279
+ };
5356
5280
 
5357
- case 7:
5358
- case "end":
5359
- return _context.stop();
5281
+ stream = pump_1(inputStream, bufferStream(options), function (error) {
5282
+ if (error) {
5283
+ rejectPromise(error);
5284
+ return;
5360
5285
  }
5361
- }
5286
+
5287
+ resolve();
5288
+ });
5289
+ stream.on('data', function () {
5290
+ if (stream.getBufferedLength() > maxBuffer) {
5291
+ rejectPromise(new MaxBufferError());
5292
+ }
5293
+ });
5294
+ }).then(function () {
5295
+ return stream.getBufferedValue();
5362
5296
  });
5363
5297
  }
5364
5298
 
5365
- var getStream_1 = getStream; // TODO: Remove this for the next major release
5366
-
5367
- var default_1 = getStream;
5299
+ var getStream_1 = getStream;
5368
5300
 
5369
5301
  var buffer = function buffer(stream, options) {
5370
- return getStream(stream, _objectSpread2({}, options, {
5302
+ return getStream(stream, Object.assign({}, options, {
5371
5303
  encoding: 'buffer'
5372
5304
  }));
5373
5305
  };
5374
5306
 
5375
5307
  var array = function array(stream, options) {
5376
- return getStream(stream, _objectSpread2({}, options, {
5308
+ return getStream(stream, Object.assign({}, options, {
5377
5309
  array: true
5378
5310
  }));
5379
5311
  };
5380
5312
 
5381
5313
  var MaxBufferError_1 = MaxBufferError;
5382
- getStream_1.default = default_1;
5383
5314
  getStream_1.buffer = buffer;
5384
5315
  getStream_1.array = array;
5385
5316
  getStream_1.MaxBufferError = MaxBufferError_1;