prettier 0.12.3 → 0.13.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2ad3bf2a469895aec98cbf18d946801ac1d3e4193752e4255aca13042a3bd75f
4
- data.tar.gz: 9b4e4fa497a06c2e2e2475e1ce10aea29b4c852a6eae7150ff8da3f39da3c60d
3
+ metadata.gz: d4d48bb295fd20db723ba6491459aa439df3258c9ccea2ebbca3d47e76001de4
4
+ data.tar.gz: ac54ec92f5cfb7812419c04993c8113143bd0610a433969e96d5d2651a931974
5
5
  SHA512:
6
- metadata.gz: 2967c369962a05b9b35bea2e23d100b2b5229e2dc3830d26c7c7b279fd768dae27afe34e93e55ba0a1a4bb1164a47d7644cf98b3462e6dd897228ef2a3c14c86
7
- data.tar.gz: f89e8b4df94cd5a0b94ad78302ddf70838a46e16cb01418e76fb5fbb5f04e987f6a1570dddcf9efea39868b2426a1866f64bdc69214aeec576ac08351e8c323e
6
+ metadata.gz: 9dff32300805824e2ca6d0353ea17525f26dbbeea44140cd1c25bd65f28cd3a00b9b69d3702d4fce82bbfe65dee5464919f069d02d191b6a93fd15d4f2501284
7
+ data.tar.gz: e71972c078fec8a949efe8398ad649b10e5f74860daa2789c891d613203dfb23d4568f9ce88a7c926886fce853c7e1423bf13c64e2262e39b1cf5c5c9bf19cdc
@@ -6,6 +6,48 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.13.0] - 2019-07-05
10
+
11
+ ### Added
12
+
13
+ - Added `locStart` and `locEnd` functions to support `--cursor-offset`.
14
+
15
+ ### Changed
16
+
17
+ - Comments inside of `do...end` blocks that preceeded `call` nodes were associating the comment with the `var_ref` instead of the `call` itself. For example,
18
+
19
+ <!-- prettier-ignore -->
20
+ ```ruby
21
+ foo.each do |bar|
22
+ # comment
23
+ bar.baz
24
+ bar.baz
25
+ end
26
+ ```
27
+
28
+ would get printed as
29
+
30
+ <!-- prettier-ignore -->
31
+ ```ruby
32
+ foo.each do |bar|
33
+ # comment
34
+ bar
35
+ .baz
36
+ bar.baz
37
+ end
38
+ ```
39
+
40
+ but now gets printed correctly. (Thanks to @xipgroc for the report.)
41
+
42
+ - Double splats inside a hash were previously failing to print. For example,
43
+
44
+ <!-- prettier-ignore -->
45
+ ```ruby
46
+ { foo: "bar", **baz }
47
+ ```
48
+
49
+ would fail to print, but now works. (Thanks to @petevk for the report.)
50
+
9
51
  ## [0.12.3] - 2019-05-16
10
52
 
11
53
  ### Changed
@@ -381,7 +423,8 @@ would previously result in `array[]`, but now prints properly. (Thanks to @xipgr
381
423
 
382
424
  - Initial release 🎉
383
425
 
384
- [unreleased]: https://github.com/prettier/plugin-ruby/compare/v0.12.3...HEAD
426
+ [unreleased]: https://github.com/prettier/plugin-ruby/compare/v0.13.0...HEAD
427
+ [0.13.0]: https://github.com/prettier/plugin-ruby/compare/v0.12.3...v0.13.0
385
428
  [0.12.3]: https://github.com/prettier/plugin-ruby/compare/v0.12.2...v0.12.3
386
429
  [0.12.2]: https://github.com/prettier/plugin-ruby/compare/v0.12.1...v0.12.2
387
430
  [0.12.1]: https://github.com/prettier/plugin-ruby/compare/v0.12.0...v0.12.1
data/README.md CHANGED
@@ -160,7 +160,30 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
160
160
 
161
161
  <!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
162
162
  <!-- prettier-ignore -->
163
- <table><tr><td align="center"><a href="https://kevindeisz.com"><img src="https://avatars2.githubusercontent.com/u/5093358?v=4" width="100px;" alt="Kevin Deisz"/><br /><sub><b>Kevin Deisz</b></sub></a><br /><a href="https://github.com/kddeisz/plugin-ruby/commits?author=kddeisz" title="Code">💻</a> <a href="https://github.com/kddeisz/plugin-ruby/commits?author=kddeisz" title="Documentation">📖</a> <a href="#maintenance-kddeisz" title="Maintenance">🚧</a> <a href="#review-kddeisz" title="Reviewed Pull Requests">👀</a> <a href="https://github.com/kddeisz/plugin-ruby/commits?author=kddeisz" title="Tests">⚠️</a></td><td align="center"><a href="https://www.alanfoster.me/"><img src="https://avatars2.githubusercontent.com/u/1271782?v=4" width="100px;" alt="Alan Foster"/><br /><sub><b>Alan Foster</b></sub></a><br /><a href="https://github.com/kddeisz/plugin-ruby/commits?author=AlanFoster" title="Code">💻</a> <a href="https://github.com/kddeisz/plugin-ruby/commits?author=AlanFoster" title="Documentation">📖</a> <a href="#review-AlanFoster" title="Reviewed Pull Requests">👀</a> <a href="https://github.com/kddeisz/plugin-ruby/commits?author=AlanFoster" title="Tests">⚠️</a></td><td align="center"><a href="https://github.com/johnschoeman"><img src="https://avatars0.githubusercontent.com/u/16049495?v=4" width="100px;" alt="johnschoeman"/><br /><sub><b>johnschoeman</b></sub></a><br /><a href="https://github.com/kddeisz/plugin-ruby/commits?author=johnschoeman" title="Tests">⚠️</a></td><td align="center"><a href="https://twitter.com/aaronjensen"><img src="https://avatars3.githubusercontent.com/u/8588?v=4" width="100px;" alt="Aaron Jensen"/><br /><sub><b>Aaron Jensen</b></sub></a><br /><a href="https://github.com/kddeisz/plugin-ruby/commits?author=aaronjensen" title="Documentation">📖</a></td><td align="center"><a href="http://cameronbothner.com"><img src="https://avatars1.githubusercontent.com/u/4642599?v=4" width="100px;" alt="Cameron Bothner"/><br /><sub><b>Cameron Bothner</b></sub></a><br /><a href="https://github.com/kddeisz/plugin-ruby/commits?author=cbothner" title="Code">💻</a></td><td align="center"><a href="https://localhost.dev"><img src="https://avatars3.githubusercontent.com/u/47308085?v=4" width="100px;" alt="localhost.dev"/><br /><sub><b>localhost.dev</b></sub></a><br /><a href="https://github.com/kddeisz/plugin-ruby/issues?q=author%3Alocalhostdotdev" title="Bug reports">🐛</a> <a href="https://github.com/kddeisz/plugin-ruby/commits?author=localhostdotdev" title="Code">💻</a></td><td align="center"><a href="https://deecewan.github.io"><img src="https://avatars0.githubusercontent.com/u/4755785?v=4" width="100px;" alt="David Buchan-Swanson"/><br /><sub><b>David Buchan-Swanson</b></sub></a><br /><a href="https://github.com/kddeisz/plugin-ruby/issues?q=author%3Adeecewan" title="Bug reports">🐛</a> <a href="https://github.com/kddeisz/plugin-ruby/commits?author=deecewan" title="Code">💻</a></td></tr><tr><td align="center"><a href="https://github.com/jpickwell"><img src="https://avatars1.githubusercontent.com/u/4682321?v=4" width="100px;" alt="Jordan Pickwell"/><br /><sub><b>Jordan Pickwell</b></sub></a><br /><a href="https://github.com/kddeisz/plugin-ruby/issues?q=author%3Ajpickwell" title="Bug reports">🐛</a></td><td align="center"><a href="http://codingitwrong.com"><img src="https://avatars0.githubusercontent.com/u/15832198?v=4" width="100px;" alt="Josh Justice"/><br /><sub><b>Josh Justice</b></sub></a><br /><a href="https://github.com/kddeisz/plugin-ruby/issues?q=author%3ACodingItWrong" title="Bug reports">🐛</a></td><td align="center"><a href="https://github.com/xipgroc"><img src="https://avatars0.githubusercontent.com/u/28561131?v=4" width="100px;" alt="xipgroc"/><br /><sub><b>xipgroc</b></sub></a><br /><a href="https://github.com/kddeisz/plugin-ruby/issues?q=author%3Axipgroc" title="Bug reports">🐛</a></td><td align="center"><a href="http://lejeun.es"><img src="https://avatars1.githubusercontent.com/u/15168?v=4" width="100px;" alt="Gregoire Lejeune"/><br /><sub><b>Gregoire Lejeune</b></sub></a><br /><a href="https://github.com/kddeisz/plugin-ruby/issues?q=author%3Aglejeune" title="Bug reports">🐛</a></td></tr></table>
163
+ <table>
164
+ <tr>
165
+ <td align="center"><a href="https://kevindeisz.com"><img src="https://avatars2.githubusercontent.com/u/5093358?v=4" width="100px;" alt="Kevin Deisz"/><br /><sub><b>Kevin Deisz</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/commits?author=kddeisz" title="Code">💻</a> <a href="https://github.com/prettier/plugin-ruby/commits?author=kddeisz" title="Documentation">📖</a> <a href="https://github.com/prettier/plugin-ruby/commits?author=kddeisz" title="Tests">⚠️</a> <a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Akddeisz" title="Bug reports">🐛</a></td>
166
+ <td align="center"><a href="https://www.alanfoster.me/"><img src="https://avatars2.githubusercontent.com/u/1271782?v=4" width="100px;" alt="Alan Foster"/><br /><sub><b>Alan Foster</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/commits?author=AlanFoster" title="Code">💻</a> <a href="https://github.com/prettier/plugin-ruby/commits?author=AlanFoster" title="Documentation">📖</a> <a href="https://github.com/prettier/plugin-ruby/commits?author=AlanFoster" title="Tests">⚠️</a> <a href="https://github.com/prettier/plugin-ruby/issues?q=author%3AAlanFoster" title="Bug reports">🐛</a></td>
167
+ <td align="center"><a href="https://github.com/johnschoeman"><img src="https://avatars0.githubusercontent.com/u/16049495?v=4" width="100px;" alt="johnschoeman"/><br /><sub><b>johnschoeman</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/commits?author=johnschoeman" title="Tests">⚠️</a></td>
168
+ <td align="center"><a href="https://twitter.com/aaronjensen"><img src="https://avatars3.githubusercontent.com/u/8588?v=4" width="100px;" alt="Aaron Jensen"/><br /><sub><b>Aaron Jensen</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/commits?author=aaronjensen" title="Documentation">📖</a></td>
169
+ <td align="center"><a href="http://cameronbothner.com"><img src="https://avatars1.githubusercontent.com/u/4642599?v=4" width="100px;" alt="Cameron Bothner"/><br /><sub><b>Cameron Bothner</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/commits?author=cbothner" title="Code">💻</a></td>
170
+ <td align="center"><a href="https://localhost.dev"><img src="https://avatars3.githubusercontent.com/u/47308085?v=4" width="100px;" alt="localhost.dev"/><br /><sub><b>localhost.dev</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Alocalhostdotdev" title="Bug reports">🐛</a> <a href="https://github.com/prettier/plugin-ruby/commits?author=localhostdotdev" title="Code">💻</a></td>
171
+ <td align="center"><a href="https://deecewan.github.io"><img src="https://avatars0.githubusercontent.com/u/4755785?v=4" width="100px;" alt="David Buchan-Swanson"/><br /><sub><b>David Buchan-Swanson</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Adeecewan" title="Bug reports">🐛</a> <a href="https://github.com/prettier/plugin-ruby/commits?author=deecewan" title="Code">💻</a></td>
172
+ </tr>
173
+ <tr>
174
+ <td align="center"><a href="https://github.com/jpickwell"><img src="https://avatars1.githubusercontent.com/u/4682321?v=4" width="100px;" alt="Jordan Pickwell"/><br /><sub><b>Jordan Pickwell</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Ajpickwell" title="Bug reports">🐛</a></td>
175
+ <td align="center"><a href="http://codingitwrong.com"><img src="https://avatars0.githubusercontent.com/u/15832198?v=4" width="100px;" alt="Josh Justice"/><br /><sub><b>Josh Justice</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3ACodingItWrong" title="Bug reports">🐛</a></td>
176
+ <td align="center"><a href="https://github.com/xipgroc"><img src="https://avatars0.githubusercontent.com/u/28561131?v=4" width="100px;" alt="xipgroc"/><br /><sub><b>xipgroc</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Axipgroc" title="Bug reports">🐛</a></td>
177
+ <td align="center"><a href="http://lejeun.es"><img src="https://avatars1.githubusercontent.com/u/15168?v=4" width="100px;" alt="Gregoire Lejeune"/><br /><sub><b>Gregoire Lejeune</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Aglejeune" title="Bug reports">🐛</a></td>
178
+ <td align="center"><a href="https://github.com/petevk"><img src="https://avatars3.githubusercontent.com/u/5108627?v=4" width="100px;" alt="Pete Van Klaveren"/><br /><sub><b>Pete Van Klaveren</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/issues?q=author%3Apetevk" title="Bug reports">🐛</a></td>
179
+ <td align="center"><a href="https://github.com/meleyal"><img src="https://avatars3.githubusercontent.com/u/15045?v=4" width="100px;" alt="meleyal"/><br /><sub><b>meleyal</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/commits?author=meleyal" title="Documentation">📖</a></td>
180
+ <td align="center"><a href="https://lip.is"><img src="https://avatars1.githubusercontent.com/u/125676?v=4" width="100px;" alt="Lipis"/><br /><sub><b>Lipis</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/commits?author=lipis" title="Documentation">📖</a></td>
181
+ </tr>
182
+ <tr>
183
+ <td align="center"><a href="https://janpiotrowski.de"><img src="https://avatars0.githubusercontent.com/u/183673?v=4" width="100px;" alt="Jan Piotrowski"/><br /><sub><b>Jan Piotrowski</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/commits?author=janpio" title="Documentation">📖</a></td>
184
+ <td align="center"><a href="https://www.andywaite.com"><img src="https://avatars1.githubusercontent.com/u/13400?v=4" width="100px;" alt="Andy Waite"/><br /><sub><b>Andy Waite</b></sub></a><br /><a href="https://github.com/prettier/plugin-ruby/commits?author=andyw8" title="Documentation">📖</a></td>
185
+ </tr>
186
+ </table>
164
187
 
165
188
  <!-- ALL-CONTRIBUTORS-LIST:END -->
166
189
 
@@ -14,7 +14,7 @@ var thirdParty__default = thirdParty['default'];
14
14
  var readline = _interopDefault(require('readline'));
15
15
 
16
16
  var name = "prettier";
17
- var version$1 = "1.17.1";
17
+ var version$1 = "1.18.2";
18
18
  var description = "Prettier is an opinionated code formatter";
19
19
  var bin = {
20
20
  "prettier": "./bin/prettier.js"
@@ -31,8 +31,8 @@ var dependencies = {
31
31
  "@angular/compiler": "7.2.9",
32
32
  "@babel/code-frame": "7.0.0",
33
33
  "@babel/parser": "7.2.0",
34
- "@glimmer/syntax": "0.30.3",
35
- "@iarna/toml": "2.0.0",
34
+ "@glimmer/syntax": "0.38.4",
35
+ "@iarna/toml": "2.2.3",
36
36
  "@typescript-eslint/typescript-estree": "1.6.0",
37
37
  "angular-estree-parser": "1.1.5",
38
38
  "angular-html-parser": "1.2.0",
@@ -110,7 +110,7 @@ var devDependencies = {
110
110
  "jest-snapshot-serializer-raw": "1.1.0",
111
111
  "jest-watch-typeahead": "0.1.0",
112
112
  "mkdirp": "0.5.1",
113
- "prettier": "1.17.0",
113
+ "prettier": "1.18.0",
114
114
  "prettylint": "1.0.0",
115
115
  "rimraf": "2.6.2",
116
116
  "rollup": "0.47.6",
@@ -178,10 +178,6 @@ var _package$1 = Object.freeze({
178
178
  default: _package
179
179
  });
180
180
 
181
- var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
182
-
183
-
184
-
185
181
  function unwrapExports (x) {
186
182
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
187
183
  }
@@ -11568,7 +11564,7 @@ function printString(raw, options, isDirectiveLiteral) {
11568
11564
  // sure that we consistently output the minimum amount of escaped quotes.
11569
11565
 
11570
11566
 
11571
- return makeString(rawContent, enclosingQuote, !(options.parser === "css" || options.parser === "less" || options.parser === "scss" || options.parentParser === "html" || options.parentParser === "vue" || options.parentParser === "angular" || options.parentParser === "lwc"));
11567
+ return makeString(rawContent, enclosingQuote, !(options.parser === "css" || options.parser === "less" || options.parser === "scss" || options.embeddedInHtml));
11572
11568
  }
11573
11569
 
11574
11570
  function makeString(rawContent, enclosingQuote, unescapeUnnecessaryEscapes) {
@@ -11624,6 +11620,53 @@ function getMaxContinuousCount(str, target) {
11624
11620
  }, 0);
11625
11621
  }
11626
11622
 
11623
+ function getMinNotPresentContinuousCount(str, target) {
11624
+ var matches = str.match(new RegExp(`(${escapeStringRegexp(target)})+`, "g"));
11625
+
11626
+ if (matches === null) {
11627
+ return 0;
11628
+ }
11629
+
11630
+ var countPresent = new Map();
11631
+ var max = 0;
11632
+ var _iteratorNormalCompletion = true;
11633
+ var _didIteratorError = false;
11634
+ var _iteratorError = undefined;
11635
+
11636
+ try {
11637
+ for (var _iterator = matches[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
11638
+ var match = _step.value;
11639
+ var count = match.length / target.length;
11640
+ countPresent.set(count, true);
11641
+
11642
+ if (count > max) {
11643
+ max = count;
11644
+ }
11645
+ }
11646
+ } catch (err) {
11647
+ _didIteratorError = true;
11648
+ _iteratorError = err;
11649
+ } finally {
11650
+ try {
11651
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
11652
+ _iterator.return();
11653
+ }
11654
+ } finally {
11655
+ if (_didIteratorError) {
11656
+ throw _iteratorError;
11657
+ }
11658
+ }
11659
+ }
11660
+
11661
+ for (var i = 1; i < max; i++) {
11662
+ if (!countPresent.get(i)) {
11663
+ return i;
11664
+ }
11665
+ }
11666
+
11667
+ return max + 1;
11668
+ }
11669
+
11627
11670
  function getStringWidth$1(text) {
11628
11671
  if (!text) {
11629
11672
  return 0;
@@ -11714,13 +11757,13 @@ function isWithinParentArrayProperty(path$$1, propertyName) {
11714
11757
 
11715
11758
  function replaceEndOfLineWith(text, replacement) {
11716
11759
  var parts = [];
11717
- var _iteratorNormalCompletion = true;
11718
- var _didIteratorError = false;
11719
- var _iteratorError = undefined;
11760
+ var _iteratorNormalCompletion2 = true;
11761
+ var _didIteratorError2 = false;
11762
+ var _iteratorError2 = undefined;
11720
11763
 
11721
11764
  try {
11722
- for (var _iterator = text.split("\n")[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
11723
- var part = _step.value;
11765
+ for (var _iterator2 = text.split("\n")[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
11766
+ var part = _step2.value;
11724
11767
 
11725
11768
  if (parts.length !== 0) {
11726
11769
  parts.push(replacement);
@@ -11729,16 +11772,16 @@ function replaceEndOfLineWith(text, replacement) {
11729
11772
  parts.push(part);
11730
11773
  }
11731
11774
  } catch (err) {
11732
- _didIteratorError = true;
11733
- _iteratorError = err;
11775
+ _didIteratorError2 = true;
11776
+ _iteratorError2 = err;
11734
11777
  } finally {
11735
11778
  try {
11736
- if (!_iteratorNormalCompletion && _iterator.return != null) {
11737
- _iterator.return();
11779
+ if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
11780
+ _iterator2.return();
11738
11781
  }
11739
11782
  } finally {
11740
- if (_didIteratorError) {
11741
- throw _iteratorError;
11783
+ if (_didIteratorError2) {
11784
+ throw _iteratorError2;
11742
11785
  }
11743
11786
  }
11744
11787
  }
@@ -11750,6 +11793,7 @@ var util$1 = {
11750
11793
  replaceEndOfLineWith,
11751
11794
  getStringWidth: getStringWidth$1,
11752
11795
  getMaxContinuousCount,
11796
+ getMinNotPresentContinuousCount,
11753
11797
  getPrecedence,
11754
11798
  shouldFlatten,
11755
11799
  isBitwiseOperator,
@@ -12640,6 +12684,7 @@ var docUtils = {
12640
12684
  willBreak,
12641
12685
  isLineNext,
12642
12686
  traverseDoc,
12687
+ findInDoc,
12643
12688
  mapDoc: mapDoc$1,
12644
12689
  propagateBreaks,
12645
12690
  removeLines,
@@ -13451,6 +13496,7 @@ function printSubtree(path$$1, print, options$$1, printAstToDoc) {
13451
13496
  function textToDoc(text, partialNextOptions, parentOptions, printAstToDoc) {
13452
13497
  var nextOptions = normalize$3(Object.assign({}, parentOptions, partialNextOptions, {
13453
13498
  parentParser: parentOptions.parser,
13499
+ embeddedInHtml: !!(parentOptions.embeddedInHtml || parentOptions.parser === "html" || parentOptions.parser === "vue" || parentOptions.parser === "angular" || parentOptions.parser === "lwc"),
13454
13500
  originalText: text
13455
13501
  }), {
13456
13502
  passThrough: true
@@ -13518,7 +13564,7 @@ function printAstToDoc(ast, options) {
13518
13564
 
13519
13565
  var res;
13520
13566
 
13521
- if (printer.willPrintOwnComments && printer.willPrintOwnComments(path$$1)) {
13567
+ if (printer.willPrintOwnComments && printer.willPrintOwnComments(path$$1, options)) {
13522
13568
  res = callPluginPrintFunction(path$$1, options, printGenerically, args);
13523
13569
  } else {
13524
13570
  // printComments will call the plugin print function and check for
@@ -14754,7 +14800,7 @@ var lodash_uniqby = createCommonjsModule(function (module, exports) {
14754
14800
  typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
14755
14801
  /** Detect free variable `global` from Node.js. */
14756
14802
 
14757
- var freeGlobal = typeof commonjsGlobal == 'object' && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
14803
+ var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
14758
14804
  /** Detect free variable `self`. */
14759
14805
 
14760
14806
  var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
@@ -17207,7 +17253,7 @@ var REJECTED = 'rejected';
17207
17253
 
17208
17254
  var NOOP = function NOOP() {};
17209
17255
 
17210
- var isNode = typeof commonjsGlobal !== 'undefined' && typeof commonjsGlobal.process !== 'undefined' && typeof commonjsGlobal.process.emit === 'function';
17256
+ var isNode = typeof global !== 'undefined' && typeof global.process !== 'undefined' && typeof global.process.emit === 'function';
17211
17257
  var asyncSetTimer = typeof setImmediate === 'undefined' ? setTimeout : setImmediate;
17212
17258
  var asyncQueue = [];
17213
17259
  var asyncTimer;
@@ -17355,12 +17401,12 @@ function publishRejection(promise) {
17355
17401
  publish(promise);
17356
17402
 
17357
17403
  if (!promise._handled && isNode) {
17358
- commonjsGlobal.process.emit('unhandledRejection', promise._data, promise);
17404
+ global.process.emit('unhandledRejection', promise._data, promise);
17359
17405
  }
17360
17406
  }
17361
17407
 
17362
17408
  function notifyRejectionHandled(promise) {
17363
- commonjsGlobal.process.emit('rejectionHandled', promise);
17409
+ global.process.emit('rejectionHandled', promise);
17364
17410
  }
17365
17411
  /**
17366
17412
  * @class
@@ -17539,7 +17585,7 @@ var arrayUniq = createCommonjsModule(function (module) {
17539
17585
  return ret === true;
17540
17586
  }
17541
17587
 
17542
- if ('Set' in commonjsGlobal) {
17588
+ if ('Set' in global) {
17543
17589
  if (typeof Set.prototype.forEach === 'function' && doesForEachActuallyWork()) {
17544
17590
  module.exports = uniqSetWithForEach;
17545
17591
  } else {
@@ -21682,7 +21728,7 @@ function handleCommentInEmptyParens(text, enclosingNode, comment, options) {
21682
21728
  // i.e. a function without any argument.
21683
21729
 
21684
21730
 
21685
- if (enclosingNode && ((enclosingNode.type === "FunctionDeclaration" || enclosingNode.type === "FunctionExpression" || enclosingNode.type === "ArrowFunctionExpression" && (enclosingNode.body.type !== "CallExpression" || enclosingNode.body.arguments.length === 0) || enclosingNode.type === "ClassMethod" || enclosingNode.type === "ObjectMethod") && enclosingNode.params.length === 0 || (enclosingNode.type === "CallExpression" || enclosingNode.type === "NewExpression") && enclosingNode.arguments.length === 0)) {
21731
+ if (enclosingNode && ((enclosingNode.type === "FunctionDeclaration" || enclosingNode.type === "FunctionExpression" || enclosingNode.type === "ArrowFunctionExpression" || enclosingNode.type === "ClassMethod" || enclosingNode.type === "ObjectMethod") && enclosingNode.params.length === 0 || (enclosingNode.type === "CallExpression" || enclosingNode.type === "NewExpression") && enclosingNode.arguments.length === 0)) {
21686
21732
  addDanglingComment$2(enclosingNode, comment);
21687
21733
  return true;
21688
21734
  }
@@ -21912,9 +21958,7 @@ var _require$$1$utils = doc.utils;
21912
21958
  var mapDoc$3 = _require$$1$utils.mapDoc;
21913
21959
  var stripTrailingHardline$1 = _require$$1$utils.stripTrailingHardline;
21914
21960
 
21915
- function embed(path$$1, print, textToDoc
21916
- /*, options */
21917
- ) {
21961
+ function embed(path$$1, print, textToDoc, options) {
21918
21962
  var node = path$$1.getValue();
21919
21963
  var parent = path$$1.getParentNode();
21920
21964
  var parentParent = path$$1.getParentNode(1);
@@ -22020,12 +22064,10 @@ function embed(path$$1, print, textToDoc
22020
22064
  return concat$5(["`", indent$3(concat$5([hardline$4, join$3(hardline$4, parts)])), hardline$4, "`"]);
22021
22065
  }
22022
22066
 
22023
- if (isHtml(path$$1)) {
22024
- return printHtmlTemplateLiteral(path$$1, print, textToDoc, "html");
22025
- }
22067
+ var htmlParser = isHtml(path$$1) ? "html" : isAngularComponentTemplate(path$$1) ? "angular" : undefined;
22026
22068
 
22027
- if (isAngularComponentTemplate(path$$1)) {
22028
- return printHtmlTemplateLiteral(path$$1, print, textToDoc, "angular");
22069
+ if (htmlParser) {
22070
+ return printHtmlTemplateLiteral(path$$1, print, textToDoc, htmlParser, options.embeddedInHtml);
22029
22071
  }
22030
22072
 
22031
22073
  break;
@@ -22065,6 +22107,10 @@ function getIndentation(str) {
22065
22107
  return firstMatchedIndent === null ? "" : firstMatchedIndent[1];
22066
22108
  }
22067
22109
 
22110
+ function uncook(cookedValue) {
22111
+ return cookedValue.replace(/([\\`]|\$\{)/g, "\\$1");
22112
+ }
22113
+
22068
22114
  function escapeTemplateCharacters(doc$$2, raw) {
22069
22115
  return mapDoc$3(doc$$2, function (currentDoc) {
22070
22116
  if (!currentDoc.parts) {
@@ -22074,7 +22120,7 @@ function escapeTemplateCharacters(doc$$2, raw) {
22074
22120
  var parts = [];
22075
22121
  currentDoc.parts.forEach(function (part) {
22076
22122
  if (typeof part === "string") {
22077
- parts.push(raw ? part.replace(/(\\*)`/g, "$1$1\\`") : part.replace(/([\\`]|\$\{)/g, "\\$1"));
22123
+ parts.push(raw ? part.replace(/(\\*)`/g, "$1$1\\`") : uncook(part));
22078
22124
  } else {
22079
22125
  parts.push(part);
22080
22126
  }
@@ -22185,8 +22231,11 @@ function printGraphqlComments(lines) {
22185
22231
  return parts.length === 0 ? null : join$3(hardline$4, parts);
22186
22232
  }
22187
22233
  /**
22188
- * Template literal in this context:
22234
+ * Template literal in these contexts:
22189
22235
  * <style jsx>{`div{color:red}`}</style>
22236
+ * css``
22237
+ * css.global``
22238
+ * css.resolve``
22190
22239
  */
22191
22240
 
22192
22241
 
@@ -22196,7 +22245,7 @@ function isStyledJsx(path$$1) {
22196
22245
  var parentParent = path$$1.getParentNode(1);
22197
22246
  return parentParent && node.quasis && parent.type === "JSXExpressionContainer" && parentParent.type === "JSXElement" && parentParent.openingElement.name.name === "style" && parentParent.openingElement.attributes.some(function (attribute) {
22198
22247
  return attribute.name.name === "jsx";
22199
- });
22248
+ }) || parent && parent.type === "TaggedTemplateExpression" && parent.tag.type === "Identifier" && parent.tag.name === "css" || parent && parent.type === "TaggedTemplateExpression" && parent.tag.type === "MemberExpression" && parent.tag.object.name === "css" && (parent.tag.property.name === "global" || parent.tag.property.name === "resolve");
22200
22249
  }
22201
22250
  /**
22202
22251
  * Angular Components can have:
@@ -22264,9 +22313,9 @@ function isStyledComponents(path$$1) {
22264
22313
 
22265
22314
  case "CallExpression":
22266
22315
  return (// styled(Component)``
22267
- isStyledIdentifier(tag.callee) || tag.callee.type === "MemberExpression" && (tag.callee.object.type === "MemberExpression" && ( // styled.foo.attr({})``
22268
- isStyledIdentifier(tag.callee.object.object) || // Component.extend.attr({)``
22269
- isStyledExtend(tag.callee.object)) || // styled(Component).attr({})``
22316
+ isStyledIdentifier(tag.callee) || tag.callee.type === "MemberExpression" && (tag.callee.object.type === "MemberExpression" && ( // styled.foo.attrs({})``
22317
+ isStyledIdentifier(tag.callee.object.object) || // Component.extend.attrs({})``
22318
+ isStyledExtend(tag.callee.object)) || // styled(Component).attrs({})``
22270
22319
  tag.callee.object.type === "CallExpression" && isStyledIdentifier(tag.callee.object.callee))
22271
22320
  );
22272
22321
 
@@ -22384,16 +22433,22 @@ function isHtml(path$$1) {
22384
22433
  }, function (node, name) {
22385
22434
  return node.type === "TaggedTemplateExpression" && node.tag.type === "Identifier" && node.tag.name === "html" && name === "quasi";
22386
22435
  }]);
22387
- }
22436
+ } // The counter is needed to distinguish nested embeds.
22437
+
22438
+
22439
+ var htmlTemplateLiteralCounter = 0;
22388
22440
 
22389
- function printHtmlTemplateLiteral(path$$1, print, textToDoc, parser) {
22441
+ function printHtmlTemplateLiteral(path$$1, print, textToDoc, parser, escapeClosingScriptTag) {
22390
22442
  var node = path$$1.getValue();
22391
- var placeholderPattern = "PRETTIER_HTML_PLACEHOLDER_(\\d+)_IN_JS";
22392
- var placeholders = node.expressions.map(function (_, i) {
22393
- return `PRETTIER_HTML_PLACEHOLDER_${i}_IN_JS`;
22394
- });
22443
+ var counter = htmlTemplateLiteralCounter;
22444
+ htmlTemplateLiteralCounter = htmlTemplateLiteralCounter + 1 >>> 0;
22445
+
22446
+ var composePlaceholder = function composePlaceholder(index) {
22447
+ return `PRETTIER_HTML_PLACEHOLDER_${index}_${counter}_IN_JS`;
22448
+ };
22449
+
22395
22450
  var text = node.quasis.map(function (quasi, index, quasis) {
22396
- return index === quasis.length - 1 ? quasi.value.raw : quasi.value.raw + placeholders[index];
22451
+ return index === quasis.length - 1 ? quasi.value.cooked : quasi.value.cooked + composePlaceholder(index);
22397
22452
  }).join("");
22398
22453
  var expressionDocs = path$$1.map(print, "expressions");
22399
22454
 
@@ -22401,13 +22456,11 @@ function printHtmlTemplateLiteral(path$$1, print, textToDoc, parser) {
22401
22456
  return "``";
22402
22457
  }
22403
22458
 
22459
+ var placeholderRegex = RegExp(composePlaceholder("(\\d+)"), "g");
22404
22460
  var contentDoc = mapDoc$3(stripTrailingHardline$1(textToDoc(text, {
22405
22461
  parser
22406
22462
  })), function (doc$$2) {
22407
- var placeholderRegex = new RegExp(placeholderPattern, "g");
22408
- var hasPlaceholder = typeof doc$$2 === "string" && placeholderRegex.test(doc$$2);
22409
-
22410
- if (!hasPlaceholder) {
22463
+ if (typeof doc$$2 !== "string") {
22411
22464
  return doc$$2;
22412
22465
  }
22413
22466
 
@@ -22419,6 +22472,12 @@ function printHtmlTemplateLiteral(path$$1, print, textToDoc, parser) {
22419
22472
 
22420
22473
  if (i % 2 === 0) {
22421
22474
  if (component) {
22475
+ component = uncook(component);
22476
+
22477
+ if (escapeClosingScriptTag) {
22478
+ component = component.replace(/<\/(script)\b/gi, "<\\/$1");
22479
+ }
22480
+
22422
22481
  parts.push(component);
22423
22482
  }
22424
22483
 
@@ -22818,12 +22877,65 @@ function hasNode$1(node, fn) {
22818
22877
  });
22819
22878
  }
22820
22879
 
22880
+ function hasNakedLeftSide$2(node) {
22881
+ return node.type === "AssignmentExpression" || node.type === "BinaryExpression" || node.type === "LogicalExpression" || node.type === "NGPipeExpression" || node.type === "ConditionalExpression" || node.type === "CallExpression" || node.type === "OptionalCallExpression" || node.type === "MemberExpression" || node.type === "OptionalMemberExpression" || node.type === "SequenceExpression" || node.type === "TaggedTemplateExpression" || node.type === "BindExpression" || node.type === "UpdateExpression" && !node.prefix || node.type === "TSAsExpression" || node.type === "TSNonNullExpression";
22882
+ }
22883
+
22884
+ function getLeftSide$1(node) {
22885
+ if (node.expressions) {
22886
+ return node.expressions[0];
22887
+ }
22888
+
22889
+ return node.left || node.test || node.callee || node.object || node.tag || node.argument || node.expression;
22890
+ }
22891
+
22892
+ function getLeftSidePathName$2(path$$1, node) {
22893
+ if (node.expressions) {
22894
+ return ["expressions", 0];
22895
+ }
22896
+
22897
+ if (node.left) {
22898
+ return ["left"];
22899
+ }
22900
+
22901
+ if (node.test) {
22902
+ return ["test"];
22903
+ }
22904
+
22905
+ if (node.object) {
22906
+ return ["object"];
22907
+ }
22908
+
22909
+ if (node.callee) {
22910
+ return ["callee"];
22911
+ }
22912
+
22913
+ if (node.tag) {
22914
+ return ["tag"];
22915
+ }
22916
+
22917
+ if (node.argument) {
22918
+ return ["argument"];
22919
+ }
22920
+
22921
+ if (node.expression) {
22922
+ return ["expression"];
22923
+ }
22924
+
22925
+ throw new Error("Unexpected node has no left side", node);
22926
+ }
22927
+
22821
22928
  var utils$4 = {
22929
+ getLeftSide: getLeftSide$1,
22930
+ getLeftSidePathName: getLeftSidePathName$2,
22931
+ hasNakedLeftSide: hasNakedLeftSide$2,
22822
22932
  hasNode: hasNode$1,
22823
22933
  hasFlowShorthandAnnotationComment: hasFlowShorthandAnnotationComment$2,
22824
22934
  hasFlowAnnotationComment: hasFlowAnnotationComment$1
22825
22935
  };
22826
22936
 
22937
+ var getLeftSidePathName$1 = utils$4.getLeftSidePathName;
22938
+ var hasNakedLeftSide$1 = utils$4.hasNakedLeftSide;
22827
22939
  var hasFlowShorthandAnnotationComment$1 = utils$4.hasFlowShorthandAnnotationComment;
22828
22940
 
22829
22941
  function hasClosureCompilerTypeCastComment(text, path$$1) {
@@ -22855,7 +22967,7 @@ function hasClosureCompilerTypeCastComment(text, path$$1) {
22855
22967
  return line.replace(/^[\s*]+/, "");
22856
22968
  }).join(" ").trim();
22857
22969
 
22858
- if (!/^@type\s+\{[^]+\}$/.test(cleaned)) {
22970
+ if (!/^@type\s*\{[^]+\}$/.test(cleaned)) {
22859
22971
  return false;
22860
22972
  }
22861
22973
 
@@ -22947,6 +23059,15 @@ function needsParens(path$$1, options) {
22947
23059
 
22948
23060
 
22949
23061
  if (node.type === "Identifier") {
23062
+ // ...unless those identifiers are embed placeholders. They might be substituted by complex
23063
+ // expressions, so the parens around them should not be dropped. Example (JS-in-HTML-in-JS):
23064
+ // let tpl = html`<script> f((${expr}) / 2); </script>`;
23065
+ // If the inner JS formatter removes the parens, the expression might change its meaning:
23066
+ // f((a + b) / 2) vs f(a + b / 2)
23067
+ if (node.extra && node.extra.parenthesized && /^PRETTIER_HTML_PLACEHOLDER_\d+_\d+_IN_JS$/.test(node.name)) {
23068
+ return true;
23069
+ }
23070
+
22950
23071
  return false;
22951
23072
  }
22952
23073
 
@@ -22958,6 +23079,13 @@ function needsParens(path$$1, options) {
22958
23079
 
22959
23080
  if ((parent.type === "ClassDeclaration" || parent.type === "ClassExpression") && parent.superClass === node && (node.type === "ArrowFunctionExpression" || node.type === "AssignmentExpression" || node.type === "AwaitExpression" || node.type === "BinaryExpression" || node.type === "ConditionalExpression" || node.type === "LogicalExpression" || node.type === "NewExpression" || node.type === "ObjectExpression" || node.type === "ParenthesizedExpression" || node.type === "SequenceExpression" || node.type === "TaggedTemplateExpression" || node.type === "UnaryExpression" || node.type === "UpdateExpression" || node.type === "YieldExpression")) {
22960
23081
  return true;
23082
+ } // `export default function` or `export default class` can't be followed by
23083
+ // anything after. So an expression like `export default (function(){}).toString()`
23084
+ // needs to be followed by a parentheses
23085
+
23086
+
23087
+ if (parent.type === "ExportDefaultDeclaration") {
23088
+ return shouldWrapFunctionForExportDefault(path$$1, options);
22961
23089
  }
22962
23090
 
22963
23091
  if (parent.type === "Decorator" && parent.expression === node) {
@@ -23009,9 +23137,11 @@ function needsParens(path$$1, options) {
23009
23137
  case "CallExpression":
23010
23138
  {
23011
23139
  var firstParentNotMemberExpression = parent;
23012
- var i = 0;
23140
+ var i = 0; // tagged templates are basically member expressions from a grammar perspective
23141
+ // see https://tc39.github.io/ecma262/#prod-MemberExpression
23142
+ // so are typescript's non-null assertions, though there's no grammar to point to
23013
23143
 
23014
- while (firstParentNotMemberExpression && firstParentNotMemberExpression.type === "MemberExpression") {
23144
+ while (firstParentNotMemberExpression && (firstParentNotMemberExpression.type === "MemberExpression" && firstParentNotMemberExpression.object === path$$1.getParentNode(i - 1) || firstParentNotMemberExpression.type === "TaggedTemplateExpression" || firstParentNotMemberExpression.type === "TSNonNullExpression")) {
23015
23145
  firstParentNotMemberExpression = path$$1.getParentNode(++i);
23016
23146
  }
23017
23147
 
@@ -23115,6 +23245,7 @@ function needsParens(path$$1, options) {
23115
23245
  case "TSTypeAssertion":
23116
23246
  case "TaggedTemplateExpression":
23117
23247
  case "UnaryExpression":
23248
+ case "JSXSpreadAttribute":
23118
23249
  case "SpreadElement":
23119
23250
  case "SpreadProperty":
23120
23251
  case "BindExpression":
@@ -23194,7 +23325,7 @@ function needsParens(path$$1, options) {
23194
23325
  } // Delegate to inner TSParenthesizedType
23195
23326
 
23196
23327
 
23197
- if (node.typeAnnotation.type === "TSParenthesizedType") {
23328
+ if (node.typeAnnotation.type === "TSParenthesizedType" && parent.type !== "TSArrayType") {
23198
23329
  return false;
23199
23330
  }
23200
23331
 
@@ -23368,9 +23499,6 @@ function needsParens(path$$1, options) {
23368
23499
  return true;
23369
23500
  // This is basically a kind of IIFE.
23370
23501
 
23371
- case "ExportDefaultDeclaration":
23372
- return true;
23373
-
23374
23502
  default:
23375
23503
  return false;
23376
23504
  }
@@ -23405,9 +23533,6 @@ function needsParens(path$$1, options) {
23405
23533
 
23406
23534
  case "ClassExpression":
23407
23535
  switch (parent.type) {
23408
- case "ExportDefaultDeclaration":
23409
- return true;
23410
-
23411
23536
  case "NewExpression":
23412
23537
  return name === "callee" && parent.callee === node;
23413
23538
 
@@ -23438,7 +23563,7 @@ function needsParens(path$$1, options) {
23438
23563
  return false;
23439
23564
 
23440
23565
  case "BindExpression":
23441
- if (parent.type === "BindExpression" && name === "callee" && parent.callee === node || parent.type === "MemberExpression") {
23566
+ if (parent.type === "BindExpression" && name === "callee" && parent.callee === node || parent.type === "MemberExpression" && name === "object" && parent.object === node || parent.type === "NewExpression" && name === "callee" && parent.callee === node) {
23442
23567
  return true;
23443
23568
  }
23444
23569
 
@@ -23520,6 +23645,26 @@ function isFollowedByRightBracket(path$$1) {
23520
23645
  return false;
23521
23646
  }
23522
23647
 
23648
+ function shouldWrapFunctionForExportDefault(path$$1, options) {
23649
+ var node = path$$1.getValue();
23650
+ var parent = path$$1.getParentNode();
23651
+
23652
+ if (node.type === "FunctionExpression" || node.type === "ClassExpression") {
23653
+ return parent.type === "ExportDefaultDeclaration" || // in some cases the function is already wrapped
23654
+ // (e.g. `export default (function() {})();`)
23655
+ // in this case we don't need to add extra parens
23656
+ !needsParens(path$$1, options);
23657
+ }
23658
+
23659
+ if (!hasNakedLeftSide$1(node) || parent.type !== "ExportDefaultDeclaration" && needsParens(path$$1, options)) {
23660
+ return false;
23661
+ }
23662
+
23663
+ return path$$1.call.apply(path$$1, [function (childPath) {
23664
+ return shouldWrapFunctionForExportDefault(childPath, options);
23665
+ }].concat(getLeftSidePathName$1(path$$1, node)));
23666
+ }
23667
+
23523
23668
  var needsParens_1 = needsParens;
23524
23669
 
23525
23670
  var _require$$0$builders$1 = doc.builders;
@@ -23625,6 +23770,9 @@ var isIdentifierName = utils$2.keyword.isIdentifierNameES5;
23625
23770
  var insertPragma = pragma.insertPragma;
23626
23771
  var printHtmlBinding = htmlBinding.printHtmlBinding;
23627
23772
  var isVueEventBindingExpression = htmlBinding.isVueEventBindingExpression;
23773
+ var getLeftSide = utils$4.getLeftSide;
23774
+ var getLeftSidePathName = utils$4.getLeftSidePathName;
23775
+ var hasNakedLeftSide = utils$4.hasNakedLeftSide;
23628
23776
  var hasNode = utils$4.hasNode;
23629
23777
  var hasFlowAnnotationComment = utils$4.hasFlowAnnotationComment;
23630
23778
  var hasFlowShorthandAnnotationComment = utils$4.hasFlowShorthandAnnotationComment;
@@ -25199,85 +25347,23 @@ function printPathNoParens(path$$1, options, print, args) {
25199
25347
  var expressions = path$$1.map(print, "expressions");
25200
25348
 
25201
25349
  var _parentNode = path$$1.getParentNode();
25202
- /**
25203
- * describe.each`table`(name, fn)
25204
- * describe.only.each`table`(name, fn)
25205
- * describe.skip.each`table`(name, fn)
25206
- * test.each`table`(name, fn)
25207
- * test.only.each`table`(name, fn)
25208
- * test.skip.each`table`(name, fn)
25209
- *
25210
- * Ref: https://github.com/facebook/jest/pull/6102
25211
- */
25212
25350
 
25351
+ if (isJestEachTemplateLiteral(n, _parentNode)) {
25352
+ var _printed2 = printJestEachTemplateLiteral(n, expressions, options);
25213
25353
 
25214
- var jestEachTriggerRegex = /^[xf]?(describe|it|test)$/;
25215
-
25216
- if (_parentNode.type === "TaggedTemplateExpression" && _parentNode.quasi === n && _parentNode.tag.type === "MemberExpression" && _parentNode.tag.property.type === "Identifier" && _parentNode.tag.property.name === "each" && (_parentNode.tag.object.type === "Identifier" && jestEachTriggerRegex.test(_parentNode.tag.object.name) || _parentNode.tag.object.type === "MemberExpression" && _parentNode.tag.object.property.type === "Identifier" && (_parentNode.tag.object.property.name === "only" || _parentNode.tag.object.property.name === "skip") && _parentNode.tag.object.object.type === "Identifier" && jestEachTriggerRegex.test(_parentNode.tag.object.object.name))) {
25217
- /**
25218
- * a | b | expected
25219
- * ${1} | ${1} | ${2}
25220
- * ${1} | ${2} | ${3}
25221
- * ${2} | ${1} | ${3}
25222
- */
25223
- var headerNames = n.quasis[0].value.raw.trim().split(/\s*\|\s*/);
25224
-
25225
- if (headerNames.length > 1 || headerNames.some(function (headerName) {
25226
- return headerName.length !== 0;
25227
- })) {
25228
- var stringifiedExpressions = expressions.map(function (doc$$2) {
25229
- return "${" + printDocToString$2(doc$$2, Object.assign({}, options, {
25230
- printWidth: Infinity,
25231
- endOfLine: "lf"
25232
- })).formatted + "}";
25233
- });
25234
- var tableBody = [{
25235
- hasLineBreak: false,
25236
- cells: []
25237
- }];
25238
-
25239
- for (var _i = 1; _i < n.quasis.length; _i++) {
25240
- var row = tableBody[tableBody.length - 1];
25241
- var correspondingExpression = stringifiedExpressions[_i - 1];
25242
- row.cells.push(correspondingExpression);
25243
-
25244
- if (correspondingExpression.indexOf("\n") !== -1) {
25245
- row.hasLineBreak = true;
25246
- }
25354
+ if (_printed2) {
25355
+ return _printed2;
25356
+ }
25357
+ }
25247
25358
 
25248
- if (n.quasis[_i].value.raw.indexOf("\n") !== -1) {
25249
- tableBody.push({
25250
- hasLineBreak: false,
25251
- cells: []
25252
- });
25253
- }
25254
- }
25359
+ var isSimple = isSimpleTemplateLiteral(n);
25255
25360
 
25256
- var maxColumnCount = tableBody.reduce(function (maxColumnCount, row) {
25257
- return Math.max(maxColumnCount, row.cells.length);
25258
- }, headerNames.length);
25259
- var maxColumnWidths = Array.from(new Array(maxColumnCount), function () {
25260
- return 0;
25261
- });
25262
- var table = [{
25263
- cells: headerNames
25264
- }].concat(tableBody.filter(function (row) {
25265
- return row.cells.length !== 0;
25266
- }));
25267
- table.filter(function (row) {
25268
- return !row.hasLineBreak;
25269
- }).forEach(function (row) {
25270
- row.cells.forEach(function (cell, index) {
25271
- maxColumnWidths[index] = Math.max(maxColumnWidths[index], getStringWidth$2(cell));
25272
- });
25273
- });
25274
- parts.push("`", indent$2(concat$4([hardline$3, join$2(hardline$3, table.map(function (row) {
25275
- return join$2(" | ", row.cells.map(function (cell, index) {
25276
- return row.hasLineBreak ? cell : cell + " ".repeat(maxColumnWidths[index] - getStringWidth$2(cell));
25277
- }));
25278
- }))])), hardline$3, "`");
25279
- return concat$4(parts);
25280
- }
25361
+ if (isSimple) {
25362
+ expressions = expressions.map(function (doc$$2) {
25363
+ return printDocToString$2(doc$$2, Object.assign({}, options, {
25364
+ printWidth: Infinity
25365
+ })).formatted;
25366
+ });
25281
25367
  }
25282
25368
 
25283
25369
  parts.push("`");
@@ -25300,13 +25386,17 @@ function printPathNoParens(path$$1, options, print, args) {
25300
25386
  var tabWidth = options.tabWidth;
25301
25387
  var quasi = childPath.getValue();
25302
25388
  var indentSize = getIndentSize$1(quasi.value.raw, tabWidth);
25303
- var _printed2 = expressions[i];
25389
+ var _printed3 = expressions[i];
25304
25390
 
25305
- if (n.expressions[i].comments && n.expressions[i].comments.length || n.expressions[i].type === "MemberExpression" || n.expressions[i].type === "OptionalMemberExpression" || n.expressions[i].type === "ConditionalExpression") {
25306
- _printed2 = concat$4([indent$2(concat$4([softline$1, _printed2])), softline$1]);
25391
+ if (!isSimple) {
25392
+ // Breaks at the template element boundaries (${ and }) are preferred to breaking
25393
+ // in the middle of a MemberExpression
25394
+ if (n.expressions[i].comments && n.expressions[i].comments.length || n.expressions[i].type === "MemberExpression" || n.expressions[i].type === "OptionalMemberExpression" || n.expressions[i].type === "ConditionalExpression") {
25395
+ _printed3 = concat$4([indent$2(concat$4([softline$1, _printed3])), softline$1]);
25396
+ }
25307
25397
  }
25308
25398
 
25309
- var aligned = indentSize === 0 && quasi.value.raw.endsWith("\n") ? align$1(-Infinity, _printed2) : addAlignmentToDoc$2(_printed2, indentSize, tabWidth);
25399
+ var aligned = indentSize === 0 && quasi.value.raw.endsWith("\n") ? align$1(-Infinity, _printed3) : addAlignmentToDoc$2(_printed3, indentSize, tabWidth);
25310
25400
  parts.push(group$1(concat$4(["${", aligned, lineSuffixBoundary$1, "}"])));
25311
25401
  }
25312
25402
  }, "quasis");
@@ -25353,8 +25443,7 @@ function printPathNoParens(path$$1, options, print, args) {
25353
25443
  case "TupleTypeAnnotation":
25354
25444
  {
25355
25445
  var typesField = n.type === "TSTupleType" ? "elementTypes" : "types";
25356
- return group$1(concat$4(["[", indent$2(concat$4([softline$1, printArrayItems(path$$1, options, typesField, print)])), // TypeScript doesn't support trailing commas in tuple types
25357
- n.type === "TSTupleType" ? "" : ifBreak$1(shouldPrintComma(options) ? "," : ""), comments.printDanglingComments(path$$1, options,
25446
+ return group$1(concat$4(["[", indent$2(concat$4([softline$1, printArrayItems(path$$1, options, typesField, print)])), ifBreak$1(shouldPrintComma(options, "all") ? "," : ""), comments.printDanglingComments(path$$1, options,
25358
25447
  /* sameIndent */
25359
25448
  true), softline$1, "]"]));
25360
25449
  }
@@ -25522,22 +25611,22 @@ function printPathNoParens(path$$1, options, print, args) {
25522
25611
  var result = [];
25523
25612
  var wasIndented = false;
25524
25613
 
25525
- for (var _i2 = 0; _i2 < types.length; ++_i2) {
25526
- if (_i2 === 0) {
25527
- result.push(types[_i2]);
25528
- } else if (isObjectType(n.types[_i2 - 1]) && isObjectType(n.types[_i2])) {
25614
+ for (var _i = 0; _i < types.length; ++_i) {
25615
+ if (_i === 0) {
25616
+ result.push(types[_i]);
25617
+ } else if (isObjectType(n.types[_i - 1]) && isObjectType(n.types[_i])) {
25529
25618
  // If both are objects, don't indent
25530
- result.push(concat$4([" & ", wasIndented ? indent$2(types[_i2]) : types[_i2]]));
25531
- } else if (!isObjectType(n.types[_i2 - 1]) && !isObjectType(n.types[_i2])) {
25619
+ result.push(concat$4([" & ", wasIndented ? indent$2(types[_i]) : types[_i]]));
25620
+ } else if (!isObjectType(n.types[_i - 1]) && !isObjectType(n.types[_i])) {
25532
25621
  // If no object is involved, go to the next line if it breaks
25533
- result.push(indent$2(concat$4([" &", line$3, types[_i2]])));
25622
+ result.push(indent$2(concat$4([" &", line$3, types[_i]])));
25534
25623
  } else {
25535
25624
  // If you go from object to non-object or vis-versa, then inline it
25536
- if (_i2 > 1) {
25625
+ if (_i > 1) {
25537
25626
  wasIndented = true;
25538
25627
  }
25539
25628
 
25540
- result.push(" & ", _i2 > 1 ? indent$2(types[_i2]) : types[_i2]);
25629
+ result.push(" & ", _i > 1 ? indent$2(types[_i]) : types[_i]);
25541
25630
  }
25542
25631
  }
25543
25632
 
@@ -25566,7 +25655,7 @@ function printPathNoParens(path$$1, options, print, args) {
25566
25655
  // // comment
25567
25656
  // | child2
25568
25657
 
25569
- var _printed3 = path$$1.map(function (typePath) {
25658
+ var _printed4 = path$$1.map(function (typePath) {
25570
25659
  var printedType = typePath.call(print);
25571
25660
 
25572
25661
  if (!shouldHug) {
@@ -25579,11 +25668,11 @@ function printPathNoParens(path$$1, options, print, args) {
25579
25668
  }, "types");
25580
25669
 
25581
25670
  if (shouldHug) {
25582
- return join$2(" | ", _printed3);
25671
+ return join$2(" | ", _printed4);
25583
25672
  }
25584
25673
 
25585
25674
  var shouldAddStartLine = shouldIndent && !hasLeadingOwnLineComment(options.originalText, n, options);
25586
- var code = concat$4([ifBreak$1(concat$4([shouldAddStartLine ? line$3 : "", "| "])), join$2(concat$4([line$3, "| "]), _printed3)]);
25675
+ var code = concat$4([ifBreak$1(concat$4([shouldAddStartLine ? line$3 : "", "| "])), join$2(concat$4([line$3, "| "]), _printed4)]);
25587
25676
  var hasParens;
25588
25677
 
25589
25678
  if (n.type === "TSUnionType") {
@@ -25669,9 +25758,9 @@ function printPathNoParens(path$$1, options, print, args) {
25669
25758
  parts.push("declare ");
25670
25759
  }
25671
25760
 
25672
- var _printed4 = printAssignmentRight(n.id, n.right, path$$1.call(print, "right"), options);
25761
+ var _printed5 = printAssignmentRight(n.id, n.right, path$$1.call(print, "right"), options);
25673
25762
 
25674
- parts.push("type ", path$$1.call(print, "id"), path$$1.call(print, "typeParameters"), " =", _printed4, semi);
25763
+ parts.push("type ", path$$1.call(print, "id"), path$$1.call(print, "typeParameters"), " =", _printed5, semi);
25675
25764
  return group$1(concat$4(parts));
25676
25765
  }
25677
25766
 
@@ -25748,6 +25837,15 @@ function printPathNoParens(path$$1, options, print, args) {
25748
25837
 
25749
25838
  if (n["default"]) {
25750
25839
  parts.push(" = ", path$$1.call(print, "default"));
25840
+ } // Keep comma if the file extension is .tsx and
25841
+ // has one type parameter that isn't extend with any types.
25842
+ // Because, otherwise formatted result will be invalid as tsx.
25843
+
25844
+
25845
+ var _grandParent = path$$1.getNode(2);
25846
+
25847
+ if (_parent9.params && _parent9.params.length === 1 && options.filepath && /\.tsx$/i.test(options.filepath) && !n.constraint && _grandParent.type === "ArrowFunctionExpression") {
25848
+ parts.push(",");
25751
25849
  }
25752
25850
 
25753
25851
  return concat$4(parts);
@@ -25962,9 +26060,15 @@ function printPathNoParens(path$$1, options, print, args) {
25962
26060
  return concat$4([n.operator, " ", path$$1.call(print, "typeAnnotation")]);
25963
26061
 
25964
26062
  case "TSMappedType":
25965
- return group$1(concat$4(["{", indent$2(concat$4([options.bracketSpacing ? line$3 : softline$1, n.readonly ? concat$4([getTypeScriptMappedTypeModifier(n.readonly, "readonly"), " "]) : "", printTypeScriptModifiers(path$$1, options, print), path$$1.call(print, "typeParameter"), n.optional ? getTypeScriptMappedTypeModifier(n.optional, "?") : "", ": ", path$$1.call(print, "typeAnnotation")])), comments.printDanglingComments(path$$1, options,
25966
- /* sameIndent */
25967
- true), options.bracketSpacing ? line$3 : softline$1, "}"]));
26063
+ {
26064
+ var _shouldBreak2 = hasNewlineInRange$1(options.originalText, options.locStart(n), options.locEnd(n));
26065
+
26066
+ return group$1(concat$4(["{", indent$2(concat$4([options.bracketSpacing ? line$3 : softline$1, n.readonly ? concat$4([getTypeScriptMappedTypeModifier(n.readonly, "readonly"), " "]) : "", printTypeScriptModifiers(path$$1, options, print), path$$1.call(print, "typeParameter"), n.optional ? getTypeScriptMappedTypeModifier(n.optional, "?") : "", ": ", path$$1.call(print, "typeAnnotation"), _shouldBreak2 && options.semi ? ";" : ""])), comments.printDanglingComments(path$$1, options,
26067
+ /* sameIndent */
26068
+ true), options.bracketSpacing ? line$3 : softline$1, "}"]), {
26069
+ shouldBreak: _shouldBreak2
26070
+ });
26071
+ }
25968
26072
 
25969
26073
  case "TSMethodSignature":
25970
26074
  parts.push(n.accessibility ? concat$4([n.accessibility, " "]) : "", n.export ? "export " : "", n.static ? "static " : "", n.readonly ? "readonly " : "", n.computed ? "[" : "", path$$1.call(print, "key"), n.computed ? "]" : "", printOptionalToken(path$$1), printFunctionParams(path$$1, print, options,
@@ -26242,7 +26346,7 @@ function printPropertyKey(path$$1, options, print) {
26242
26346
 
26243
26347
  if (options.quoteProps === "consistent" && !needsQuoteProps.has(parent)) {
26244
26348
  var objectHasStringProp = (parent.properties || parent.body || parent.members).some(function (prop) {
26245
- return prop.key && prop.key.type !== "Identifier" && !isStringPropSafeToCoerceToIdentifier(prop, options);
26349
+ return !prop.computed && prop.key && isStringLiteral(prop.key) && !isStringPropSafeToCoerceToIdentifier(prop, options);
26246
26350
  });
26247
26351
  needsQuoteProps.set(parent, objectHasStringProp);
26248
26352
  }
@@ -26257,7 +26361,7 @@ function printPropertyKey(path$$1, options, print) {
26257
26361
  }, "key");
26258
26362
  }
26259
26363
 
26260
- if (isStringPropSafeToCoerceToIdentifier(node, options) && (options.quoteProps === "as-needed" || options.quoteProps === "consistent" && !needsQuoteProps.get(parent))) {
26364
+ if (!node.computed && isStringPropSafeToCoerceToIdentifier(node, options) && (options.quoteProps === "as-needed" || options.quoteProps === "consistent" && !needsQuoteProps.get(parent))) {
26261
26365
  // 'a' -> a
26262
26366
  return path$$1.call(function (keyPath) {
26263
26367
  return comments.printComments(keyPath, function () {
@@ -26312,7 +26416,18 @@ function printMethod(path$$1, options, print) {
26312
26416
  }
26313
26417
 
26314
26418
  function couldGroupArg(arg) {
26315
- return arg.type === "ObjectExpression" && (arg.properties.length > 0 || arg.comments) || arg.type === "ArrayExpression" && (arg.elements.length > 0 || arg.comments) || arg.type === "TSTypeAssertion" || arg.type === "TSAsExpression" || arg.type === "FunctionExpression" || arg.type === "ArrowFunctionExpression" && !arg.returnType && (arg.body.type === "BlockStatement" || arg.body.type === "ArrowFunctionExpression" || arg.body.type === "ObjectExpression" || arg.body.type === "ArrayExpression" || arg.body.type === "CallExpression" || arg.body.type === "OptionalCallExpression" || arg.body.type === "ConditionalExpression" || isJSXNode(arg.body));
26419
+ return arg.type === "ObjectExpression" && (arg.properties.length > 0 || arg.comments) || arg.type === "ArrayExpression" && (arg.elements.length > 0 || arg.comments) || arg.type === "TSTypeAssertion" || arg.type === "TSAsExpression" || arg.type === "FunctionExpression" || arg.type === "ArrowFunctionExpression" && ( // we want to avoid breaking inside composite return types but not simple keywords
26420
+ // https://github.com/prettier/prettier/issues/4070
26421
+ // export class Thing implements OtherThing {
26422
+ // do: (type: Type) => Provider<Prop> = memoize(
26423
+ // (type: ObjectType): Provider<Opts> => {}
26424
+ // );
26425
+ // }
26426
+ // https://github.com/prettier/prettier/issues/6099
26427
+ // app.get("/", (req, res): void => {
26428
+ // res.send("Hello World!");
26429
+ // });
26430
+ !arg.returnType || !arg.returnType.typeAnnotation || arg.returnType.typeAnnotation.type !== "TSTypeReference") && (arg.body.type === "BlockStatement" || arg.body.type === "ArrowFunctionExpression" || arg.body.type === "ObjectExpression" || arg.body.type === "ArrayExpression" || arg.body.type === "CallExpression" || arg.body.type === "OptionalCallExpression" || arg.body.type === "ConditionalExpression" || isJSXNode(arg.body));
26316
26431
  }
26317
26432
 
26318
26433
  function shouldGroupLastArg(args) {
@@ -26338,6 +26453,130 @@ function isSimpleFlowType(node) {
26338
26453
  return node && flowTypeAnnotations.indexOf(node.type) !== -1 && !(node.type === "GenericTypeAnnotation" && node.typeParameters);
26339
26454
  }
26340
26455
 
26456
+ function isJestEachTemplateLiteral(node, parentNode) {
26457
+ /**
26458
+ * describe.each`table`(name, fn)
26459
+ * describe.only.each`table`(name, fn)
26460
+ * describe.skip.each`table`(name, fn)
26461
+ * test.each`table`(name, fn)
26462
+ * test.only.each`table`(name, fn)
26463
+ * test.skip.each`table`(name, fn)
26464
+ *
26465
+ * Ref: https://github.com/facebook/jest/pull/6102
26466
+ */
26467
+ var jestEachTriggerRegex = /^[xf]?(describe|it|test)$/;
26468
+ return parentNode.type === "TaggedTemplateExpression" && parentNode.quasi === node && parentNode.tag.type === "MemberExpression" && parentNode.tag.property.type === "Identifier" && parentNode.tag.property.name === "each" && (parentNode.tag.object.type === "Identifier" && jestEachTriggerRegex.test(parentNode.tag.object.name) || parentNode.tag.object.type === "MemberExpression" && parentNode.tag.object.property.type === "Identifier" && (parentNode.tag.object.property.name === "only" || parentNode.tag.object.property.name === "skip") && parentNode.tag.object.object.type === "Identifier" && jestEachTriggerRegex.test(parentNode.tag.object.object.name));
26469
+ }
26470
+
26471
+ function printJestEachTemplateLiteral(node, expressions, options) {
26472
+ /**
26473
+ * a | b | expected
26474
+ * ${1} | ${1} | ${2}
26475
+ * ${1} | ${2} | ${3}
26476
+ * ${2} | ${1} | ${3}
26477
+ */
26478
+ var headerNames = node.quasis[0].value.raw.trim().split(/\s*\|\s*/);
26479
+
26480
+ if (headerNames.length > 1 || headerNames.some(function (headerName) {
26481
+ return headerName.length !== 0;
26482
+ })) {
26483
+ var parts = [];
26484
+ var stringifiedExpressions = expressions.map(function (doc$$2) {
26485
+ return "${" + printDocToString$2(doc$$2, Object.assign({}, options, {
26486
+ printWidth: Infinity,
26487
+ endOfLine: "lf"
26488
+ })).formatted + "}";
26489
+ });
26490
+ var tableBody = [{
26491
+ hasLineBreak: false,
26492
+ cells: []
26493
+ }];
26494
+
26495
+ for (var i = 1; i < node.quasis.length; i++) {
26496
+ var row = tableBody[tableBody.length - 1];
26497
+ var correspondingExpression = stringifiedExpressions[i - 1];
26498
+ row.cells.push(correspondingExpression);
26499
+
26500
+ if (correspondingExpression.indexOf("\n") !== -1) {
26501
+ row.hasLineBreak = true;
26502
+ }
26503
+
26504
+ if (node.quasis[i].value.raw.indexOf("\n") !== -1) {
26505
+ tableBody.push({
26506
+ hasLineBreak: false,
26507
+ cells: []
26508
+ });
26509
+ }
26510
+ }
26511
+
26512
+ var maxColumnCount = tableBody.reduce(function (maxColumnCount, row) {
26513
+ return Math.max(maxColumnCount, row.cells.length);
26514
+ }, headerNames.length);
26515
+ var maxColumnWidths = Array.from(new Array(maxColumnCount), function () {
26516
+ return 0;
26517
+ });
26518
+ var table = [{
26519
+ cells: headerNames
26520
+ }].concat(tableBody.filter(function (row) {
26521
+ return row.cells.length !== 0;
26522
+ }));
26523
+ table.filter(function (row) {
26524
+ return !row.hasLineBreak;
26525
+ }).forEach(function (row) {
26526
+ row.cells.forEach(function (cell, index) {
26527
+ maxColumnWidths[index] = Math.max(maxColumnWidths[index], getStringWidth$2(cell));
26528
+ });
26529
+ });
26530
+ parts.push("`", indent$2(concat$4([hardline$3, join$2(hardline$3, table.map(function (row) {
26531
+ return join$2(" | ", row.cells.map(function (cell, index) {
26532
+ return row.hasLineBreak ? cell : cell + " ".repeat(maxColumnWidths[index] - getStringWidth$2(cell));
26533
+ }));
26534
+ }))])), hardline$3, "`");
26535
+ return concat$4(parts);
26536
+ }
26537
+ }
26538
+ /** @param node {import("estree").TemplateLiteral} */
26539
+
26540
+
26541
+ function isSimpleTemplateLiteral(node) {
26542
+ if (node.expressions.length === 0) {
26543
+ return false;
26544
+ }
26545
+
26546
+ return node.expressions.every(function (expr) {
26547
+ // Disallow comments since printDocToString can't print them here
26548
+ if (expr.comments) {
26549
+ return false;
26550
+ } // Allow `x` and `this`
26551
+
26552
+
26553
+ if (expr.type === "Identifier" || expr.type === "ThisExpression") {
26554
+ return true;
26555
+ } // Allow `a.b.c`, `a.b[c]`, and `this.x.y`
26556
+
26557
+
26558
+ if ((expr.type === "MemberExpression" || expr.type === "OptionalMemberExpression") && (expr.property.type === "Identifier" || expr.property.type === "Literal")) {
26559
+ var ancestor = expr;
26560
+
26561
+ while (ancestor.type === "MemberExpression" || ancestor.type === "OptionalMemberExpression") {
26562
+ ancestor = ancestor.object;
26563
+
26564
+ if (ancestor.comments) {
26565
+ return false;
26566
+ }
26567
+ }
26568
+
26569
+ if (ancestor.type === "Identifier" || ancestor.type === "ThisExpression") {
26570
+ return true;
26571
+ }
26572
+
26573
+ return false;
26574
+ }
26575
+
26576
+ return false;
26577
+ });
26578
+ }
26579
+
26341
26580
  var functionCompositionFunctionNames = new Set(["pipe", // RxJS, Ramda
26342
26581
  "pipeP", // Ramda
26343
26582
  "pipeK", // Ramda
@@ -27473,11 +27712,10 @@ function printJSXChildren(path$$1, options, print, jsxWhitespace, isFacebookTran
27473
27712
 
27474
27713
 
27475
27714
  function printJSXElement(path$$1, options, print) {
27476
- var n = path$$1.getValue(); // Turn <div></div> into <div />
27715
+ var n = path$$1.getValue();
27477
27716
 
27478
27717
  if (n.type === "JSXElement" && isEmptyJSXElement(n)) {
27479
- n.openingElement.selfClosing = true;
27480
- return path$$1.call(print, "openingElement");
27718
+ return concat$4([path$$1.call(print, "openingElement"), path$$1.call(print, "closingElement")]);
27481
27719
  }
27482
27720
 
27483
27721
  var openingLines = n.type === "JSXElement" ? path$$1.call(print, "openingElement") : path$$1.call(print, "openingFragment");
@@ -27719,7 +27957,7 @@ function printAssignmentRight(leftNode, rightNode, printedRight, options) {
27719
27957
  }
27720
27958
 
27721
27959
  var canBreak = isBinaryish(rightNode) && !shouldInlineLogicalExpression(rightNode) || rightNode.type === "ConditionalExpression" && isBinaryish(rightNode.test) && !shouldInlineLogicalExpression(rightNode.test) || rightNode.type === "StringLiteralTypeAnnotation" || rightNode.type === "ClassExpression" && rightNode.decorators && rightNode.decorators.length || (leftNode.type === "Identifier" || isStringLiteral(leftNode) || leftNode.type === "MemberExpression") && (isStringLiteral(rightNode) || isMemberExpressionChain(rightNode)) && // do not put values on a separate line from the key in json
27722
- options.parser !== "json" && options.parser !== "json5";
27960
+ options.parser !== "json" && options.parser !== "json5" || rightNode.type === "SequenceExpression";
27723
27961
 
27724
27962
  if (canBreak) {
27725
27963
  return group$1(indent$2(concat$4([line$3, printedRight])));
@@ -27797,60 +28035,12 @@ function hasLeadingOwnLineComment(text, node, options) {
27797
28035
  return res;
27798
28036
  }
27799
28037
 
27800
- function hasNakedLeftSide(node) {
27801
- return node.type === "AssignmentExpression" || node.type === "BinaryExpression" || node.type === "LogicalExpression" || node.type === "NGPipeExpression" || node.type === "ConditionalExpression" || node.type === "CallExpression" || node.type === "OptionalCallExpression" || node.type === "MemberExpression" || node.type === "OptionalMemberExpression" || node.type === "SequenceExpression" || node.type === "TaggedTemplateExpression" || node.type === "BindExpression" || node.type === "UpdateExpression" && !node.prefix || node.type === "TSNonNullExpression";
27802
- }
27803
-
27804
28038
  function isFlowAnnotationComment(text, typeAnnotation, options) {
27805
28039
  var start = options.locStart(typeAnnotation);
27806
28040
  var end = skipWhitespace$1(text, options.locEnd(typeAnnotation));
27807
28041
  return text.substr(start, 2) === "/*" && text.substr(end, 2) === "*/";
27808
28042
  }
27809
28043
 
27810
- function getLeftSide(node) {
27811
- if (node.expressions) {
27812
- return node.expressions[0];
27813
- }
27814
-
27815
- return node.left || node.test || node.callee || node.object || node.tag || node.argument || node.expression;
27816
- }
27817
-
27818
- function getLeftSidePathName(path$$1, node) {
27819
- if (node.expressions) {
27820
- return ["expressions", 0];
27821
- }
27822
-
27823
- if (node.left) {
27824
- return ["left"];
27825
- }
27826
-
27827
- if (node.test) {
27828
- return ["test"];
27829
- }
27830
-
27831
- if (node.object) {
27832
- return ["object"];
27833
- }
27834
-
27835
- if (node.callee) {
27836
- return ["callee"];
27837
- }
27838
-
27839
- if (node.tag) {
27840
- return ["tag"];
27841
- }
27842
-
27843
- if (node.argument) {
27844
- return ["argument"];
27845
- }
27846
-
27847
- if (node.expression) {
27848
- return ["expression"];
27849
- }
27850
-
27851
- throw new Error("Unexpected node has no left side", node);
27852
- }
27853
-
27854
28044
  function exprNeedsASIProtection(path$$1, options) {
27855
28045
  var node = path$$1.getValue();
27856
28046
  var maybeASIProblem = needsParens_1(path$$1, options) || node.type === "ParenthesizedExpression" || node.type === "TypeCastExpression" || node.type === "ArrowFunctionExpression" && !shouldPrintParamsWithoutParens(path$$1, options) || node.type === "ArrayExpression" || node.type === "ArrayPattern" || node.type === "UnaryExpression" && node.prefix && (node.operator === "+" || node.operator === "-") || node.type === "TemplateLiteral" || node.type === "TemplateElement" || isJSXNode(node) || node.type === "BindExpression" && !node.object || node.type === "RegExpLiteral" || node.type === "Literal" && node.pattern || node.type === "Literal" && node.regex;
@@ -28093,7 +28283,7 @@ function isLiteral(node) {
28093
28283
  }
28094
28284
 
28095
28285
  function isStringPropSafeToCoerceToIdentifier(node, options) {
28096
- return isStringLiteral(node.key) && isIdentifierName(node.key.value) && !node.computed && options.parser !== "json" && !(options.parser === "typescript" && node.type === "ClassProperty");
28286
+ return isStringLiteral(node.key) && isIdentifierName(node.key.value) && options.parser !== "json" && !(options.parser === "typescript" && node.type === "ClassProperty");
28097
28287
  }
28098
28288
 
28099
28289
  function isNumericLiteral(node) {
@@ -28179,7 +28369,9 @@ function isTheOnlyJSXElementInMarkdown(options, path$$1) {
28179
28369
  return parent.type === "Program" && parent.body.length == 1;
28180
28370
  }
28181
28371
 
28182
- function willPrintOwnComments(path$$1) {
28372
+ function willPrintOwnComments(path$$1
28373
+ /*, options */
28374
+ ) {
28183
28375
  var node = path$$1.getValue();
28184
28376
  var parent = path$$1.getParentNode();
28185
28377
  return (node && (isJSXNode(node) || hasFlowShorthandAnnotationComment(node) || parent && parent.type === "CallExpression" && (hasFlowAnnotationComment(node.leadingComments) || hasFlowAnnotationComment(node.trailingComments))) || parent && (parent.type === "JSXSpreadAttribute" || parent.type === "JSXSpreadChild" || parent.type === "UnionTypeAnnotation" || parent.type === "TSUnionType" || (parent.type === "ClassDeclaration" || parent.type === "ClassExpression") && parent.superClass === node)) && !hasIgnoreComment$1(path$$1);
@@ -30214,26 +30406,14 @@ function print(path$$1, options, print) {
30214
30406
  var isGlimmerComponent = tagFirstChar.toUpperCase() === tagFirstChar || isLocal;
30215
30407
  var hasChildren = n.children.length > 0;
30216
30408
  var isVoid = isGlimmerComponent && !hasChildren || voidTags.indexOf(n.tag) !== -1;
30217
- var closeTag = isVoid ? concat$10([" />", softline$4]) : ">";
30409
+ var closeTagForNoBreak = isVoid ? concat$10([" />", softline$4]) : ">";
30410
+ var closeTagForBreak = isVoid ? "/>" : ">";
30218
30411
 
30219
30412
  var _getParams = function _getParams(path$$1, print) {
30220
30413
  return indent$6(concat$10([n.attributes.length ? line$6 : "", join$7(line$6, path$$1.map(print, "attributes")), n.modifiers.length ? line$6 : "", join$7(line$6, path$$1.map(print, "modifiers")), n.comments.length ? line$6 : "", join$7(line$6, path$$1.map(print, "comments"))]));
30221
- }; // The problem here is that I want to not break at all if the children
30222
- // would not break but I need to force an indent, so I use a hardline.
30223
-
30224
- /**
30225
- * What happens now:
30226
- * <div>
30227
- * Hello
30228
- * </div>
30229
- * ==>
30230
- * <div>Hello</div>
30231
- * This is due to me using hasChildren to decide to put the hardline in.
30232
- * I would rather use a {DOES THE WHOLE THING NEED TO BREAK}
30233
- */
30234
-
30414
+ };
30235
30415
 
30236
- return concat$10([group$10(concat$10(["<", n.tag, _getParams(path$$1, print), n.blockParams.length ? ` as |${n.blockParams.join(" ")}|` : "", ifBreak$3(softline$4, ""), closeTag])), group$10(concat$10([indent$6(join$7(softline$4, [""].concat(path$$1.map(print, "children")))), ifBreak$3(hasChildren ? hardline$8 : "", ""), !isVoid ? concat$10(["</", n.tag, ">"]) : ""]))]);
30416
+ return concat$10([group$10(concat$10(["<", n.tag, _getParams(path$$1, print), n.blockParams.length ? ` as |${n.blockParams.join(" ")}|` : "", ifBreak$3(softline$4, ""), ifBreak$3(closeTagForBreak, closeTagForNoBreak)])), group$10(concat$10([indent$6(join$7(softline$4, [""].concat(path$$1.map(print, "children")))), ifBreak$3(hasChildren ? hardline$8 : "", ""), !isVoid ? concat$10(["</", n.tag, ">"]) : ""]))]);
30237
30417
  }
30238
30418
 
30239
30419
  case "BlockStatement":
@@ -31549,9 +31729,9 @@ function genericPrint$4(path$$1, options, print) {
31549
31729
 
31550
31730
  case "inlineCode":
31551
31731
  {
31552
- var backtickCount = util$1.getMaxContinuousCount(node.value, "`");
31732
+ var backtickCount = util$1.getMinNotPresentContinuousCount(node.value, "`");
31553
31733
 
31554
- var _style = backtickCount === 1 ? "``" : "`";
31734
+ var _style = "`".repeat(backtickCount || 1);
31555
31735
 
31556
31736
  var gap = backtickCount ? " " : "";
31557
31737
  return concat$12([_style, gap, node.value, gap, _style]);
@@ -33628,7 +33808,7 @@ var parseSrcset = createCommonjsModule(function (module) {
33628
33808
  // Browser globals (root is window)
33629
33809
  root.parseSrcset = factory();
33630
33810
  }
33631
- })(commonjsGlobal, function () {
33811
+ })(this, function () {
33632
33812
  // 1. Let input be the value passed to this algorithm.
33633
33813
  return function (input, options) {
33634
33814
  var logger = options && options.logger || console; // UTILITY FUNCTIONS
@@ -34078,7 +34258,7 @@ function embed$6(path$$1, print, textToDoc, options) {
34078
34258
  } // lit-html: html`<my-element obj=${obj}></my-element>`
34079
34259
 
34080
34260
 
34081
- if (/^PRETTIER_HTML_PLACEHOLDER_\d+_IN_JS$/.test(options.originalText.slice(node.valueSpan.start.offset, node.valueSpan.end.offset))) {
34261
+ if (/^PRETTIER_HTML_PLACEHOLDER_\d+_\d+_IN_JS$/.test(options.originalText.slice(node.valueSpan.start.offset, node.valueSpan.end.offset))) {
34082
34262
  return concat$14([node.rawName, "=", node.value]);
34083
34263
  } // lwc: html`<my-element data-for={value}></my-elememt>`
34084
34264
 
@@ -39315,7 +39495,7 @@ var fnmatch = createCommonjsModule(function (module, exports) {
39315
39495
  var ini = createCommonjsModule(function (module, exports) {
39316
39496
  "use strict"; // Based on iniparser by shockie <https://npmjs.org/package/iniparser>
39317
39497
 
39318
- var __awaiter = commonjsGlobal && commonjsGlobal.__awaiter || function (thisArg, _arguments, P, generator) {
39498
+ var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {
39319
39499
  return new (P || (P = Promise))(function (resolve, reject) {
39320
39500
  function fulfilled(value) {
39321
39501
  try {
@@ -39343,7 +39523,7 @@ var ini = createCommonjsModule(function (module, exports) {
39343
39523
  });
39344
39524
  };
39345
39525
 
39346
- var __generator = commonjsGlobal && commonjsGlobal.__generator || function (thisArg, body) {
39526
+ var __generator = this && this.__generator || function (thisArg, body) {
39347
39527
  var _ = {
39348
39528
  label: 0,
39349
39529
  sent: function sent() {
@@ -39454,7 +39634,7 @@ var ini = createCommonjsModule(function (module, exports) {
39454
39634
  }
39455
39635
  };
39456
39636
 
39457
- var __importStar = commonjsGlobal && commonjsGlobal.__importStar || function (mod) {
39637
+ var __importStar = this && this.__importStar || function (mod) {
39458
39638
  if (mod && mod.__esModule) return mod;
39459
39639
  var result = {};
39460
39640
  if (mod != null) for (var k in mod) {
@@ -39633,7 +39813,7 @@ var require$$4$6 = ( _package$3 && _package$2 ) || _package$3;
39633
39813
  var src$2 = createCommonjsModule(function (module, exports) {
39634
39814
  "use strict";
39635
39815
 
39636
- var __awaiter = commonjsGlobal && commonjsGlobal.__awaiter || function (thisArg, _arguments, P, generator) {
39816
+ var __awaiter = this && this.__awaiter || function (thisArg, _arguments, P, generator) {
39637
39817
  return new (P || (P = Promise))(function (resolve, reject) {
39638
39818
  function fulfilled(value) {
39639
39819
  try {
@@ -39661,7 +39841,7 @@ var src$2 = createCommonjsModule(function (module, exports) {
39661
39841
  });
39662
39842
  };
39663
39843
 
39664
- var __generator = commonjsGlobal && commonjsGlobal.__generator || function (thisArg, body) {
39844
+ var __generator = this && this.__generator || function (thisArg, body) {
39665
39845
  var _ = {
39666
39846
  label: 0,
39667
39847
  sent: function sent() {
@@ -39772,7 +39952,7 @@ var src$2 = createCommonjsModule(function (module, exports) {
39772
39952
  }
39773
39953
  };
39774
39954
 
39775
- var __importStar = commonjsGlobal && commonjsGlobal.__importStar || function (mod) {
39955
+ var __importStar = this && this.__importStar || function (mod) {
39776
39956
  if (mod && mod.__esModule) return mod;
39777
39957
  var result = {};
39778
39958
  if (mod != null) for (var k in mod) {
@@ -39782,7 +39962,7 @@ var src$2 = createCommonjsModule(function (module, exports) {
39782
39962
  return result;
39783
39963
  };
39784
39964
 
39785
- var __importDefault = commonjsGlobal && commonjsGlobal.__importDefault || function (mod) {
39965
+ var __importDefault = this && this.__importDefault || function (mod) {
39786
39966
  return mod && mod.__esModule ? mod : {
39787
39967
  "default": mod
39788
39968
  };
@@ -40244,6 +40424,7 @@ function (_Error) {
40244
40424
  _classCallCheck(this, ParserError);
40245
40425
 
40246
40426
  _this = _possibleConstructorReturn(this, _getPrototypeOf(ParserError).call(this, '[ParserError] ' + msg, filename, linenumber));
40427
+ _this.name = 'ParserError';
40247
40428
  _this.code = 'ParserError';
40248
40429
  if (Error.captureStackTrace) Error.captureStackTrace(_assertThisInitialized(_assertThisInitialized(_this)), ParserError);
40249
40430
  return _this;
@@ -40367,7 +40548,7 @@ function () {
40367
40548
  key: "return",
40368
40549
  value: function _return(value) {
40369
40550
  /* istanbul ignore next */
40370
- if (!this.stack.length) throw this.error(new ParserError('Stack underflow'));
40551
+ if (this.stack.length === 0) throw this.error(new ParserError('Stack underflow'));
40371
40552
  if (value === undefined) value = this.state.buf;
40372
40553
  this.state = this.stack.pop();
40373
40554
  this.state.returned = value;
@@ -40483,7 +40664,7 @@ var createDatetimeFloat = createCommonjsModule(function (module) {
40483
40664
  var createDate = createCommonjsModule(function (module) {
40484
40665
  'use strict';
40485
40666
 
40486
- var DateTime = commonjsGlobal.Date;
40667
+ var DateTime = global.Date;
40487
40668
 
40488
40669
  var Date =
40489
40670
  /*#__PURE__*/
@@ -40580,6 +40761,7 @@ var tomlParser = createCommonjsModule(function (module) {
40580
40761
  _classCallCheck(this, TomlError);
40581
40762
 
40582
40763
  _this = _possibleConstructorReturn(this, _getPrototypeOf(TomlError).call(this, msg));
40764
+ _this.name = 'TomlError';
40583
40765
  /* istanbul ignore next */
40584
40766
 
40585
40767
  if (Error.captureStackTrace) Error.captureStackTrace(_assertThisInitialized(_assertThisInitialized(_this)), TomlError);
@@ -40648,13 +40830,13 @@ var tomlParser = createCommonjsModule(function (module) {
40648
40830
  var SURROGATE_FIRST = 0xD800;
40649
40831
  var SURROGATE_LAST = 0xDFFF;
40650
40832
  var escapes = {
40651
- [CHAR_b]: '\x08',
40652
- [CHAR_t]: '\x09',
40653
- [CHAR_n]: '\x0a',
40654
- [CHAR_f]: '\x0c',
40655
- [CHAR_r]: '\x0d',
40656
- [CHAR_QUOT]: '\x22',
40657
- [CHAR_BSOL]: '\x5c'
40833
+ [CHAR_b]: '\u0008',
40834
+ [CHAR_t]: '\u0009',
40835
+ [CHAR_n]: '\u000A',
40836
+ [CHAR_f]: '\u000C',
40837
+ [CHAR_r]: '\u000D',
40838
+ [CHAR_QUOT]: '\u0022',
40839
+ [CHAR_BSOL]: '\u005C'
40658
40840
  };
40659
40841
 
40660
40842
  function isDigit(cp) {
@@ -40685,6 +40867,21 @@ var tomlParser = createCommonjsModule(function (module) {
40685
40867
 
40686
40868
  var _declared = Symbol('declared');
40687
40869
 
40870
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
40871
+ var defineProperty = Object.defineProperty;
40872
+ var descriptor = {
40873
+ configurable: true,
40874
+ enumerable: true,
40875
+ writable: true,
40876
+ value: undefined
40877
+ };
40878
+
40879
+ function hasKey(obj, key) {
40880
+ if (hasOwnProperty.call(obj, key)) return true;
40881
+ if (key === '__proto__') defineProperty(obj, '__proto__', descriptor);
40882
+ return false;
40883
+ }
40884
+
40688
40885
  var INLINE_TABLE = Symbol('inline-table');
40689
40886
 
40690
40887
  function InlineTable() {
@@ -40755,10 +40952,18 @@ var tomlParser = createCommonjsModule(function (module) {
40755
40952
  } // in an eval, to let bundlers not slurp in a util proxy
40756
40953
 
40757
40954
 
40758
- var utilInspect = eval(`require('util').inspect`);
40955
+ var _custom;
40956
+
40957
+ try {
40958
+ var utilInspect = eval("require('util').inspect");
40959
+ _custom = utilInspect.custom;
40960
+ } catch (_) {}
40961
+ /* eval require not available in transpiled bundle */
40962
+
40759
40963
  /* istanbul ignore next */
40760
40964
 
40761
- var _inspect = utilInspect && utilInspect.custom || 'inspect';
40965
+
40966
+ var _inspect = _custom || 'inspect';
40762
40967
 
40763
40968
  var BoxedBigInt =
40764
40969
  /*#__PURE__*/
@@ -40767,7 +40972,7 @@ var tomlParser = createCommonjsModule(function (module) {
40767
40972
  _classCallCheck(this, BoxedBigInt);
40768
40973
 
40769
40974
  try {
40770
- this.value = commonjsGlobal.BigInt(value);
40975
+ this.value = global.BigInt.asIntN(64, value);
40771
40976
  } catch (_) {
40772
40977
  /* istanbul ignore next */
40773
40978
  this.value = null;
@@ -40815,7 +41020,7 @@ var tomlParser = createCommonjsModule(function (module) {
40815
41020
  if (Object.is(num, -0)) num = 0;
40816
41021
  /* istanbul ignore else */
40817
41022
 
40818
- if (commonjsGlobal.BigInt && !Number.isSafeInteger(num)) {
41023
+ if (global.BigInt && !Number.isSafeInteger(num)) {
40819
41024
  return new BoxedBigInt(_value);
40820
41025
  } else {
40821
41026
  /* istanbul ignore next */
@@ -40982,7 +41187,7 @@ var tomlParser = createCommonjsModule(function (module) {
40982
41187
  for (var _iterator = kv.key[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
40983
41188
  var kw = _step.value;
40984
41189
 
40985
- if (kw in target && (!isTable(target[kw]) || target[kw][_declared])) {
41190
+ if (hasKey(target, kw) && (!isTable(target[kw]) || target[kw][_declared])) {
40986
41191
  throw this.error(new TomlError("Can't redefine existing key"));
40987
41192
  }
40988
41193
 
@@ -41003,7 +41208,7 @@ var tomlParser = createCommonjsModule(function (module) {
41003
41208
  }
41004
41209
  }
41005
41210
 
41006
- if (finalKey in target) {
41211
+ if (hasKey(target, finalKey)) {
41007
41212
  throw this.error(new TomlError("Can't redefine existing key"));
41008
41213
  } // unbox our numbers
41009
41214
 
@@ -41121,7 +41326,7 @@ var tomlParser = createCommonjsModule(function (module) {
41121
41326
  if (this.char === CHAR_SP || this.char === CTRL_I) {
41122
41327
  return null;
41123
41328
  } else if (this.char === CHAR_RSQB) {
41124
- if (keyword in this.ctx && (!isTable(this.ctx[keyword]) || this.ctx[keyword][_declared])) {
41329
+ if (hasKey(this.ctx, keyword) && (!isTable(this.ctx[keyword]) || this.ctx[keyword][_declared])) {
41125
41330
  throw this.error(new TomlError("Can't redefine existing key"));
41126
41331
  } else {
41127
41332
  this.ctx = this.ctx[keyword] = this.ctx[keyword] || Table();
@@ -41130,7 +41335,7 @@ var tomlParser = createCommonjsModule(function (module) {
41130
41335
 
41131
41336
  return this.next(this.parseWhitespaceToEOL);
41132
41337
  } else if (this.char === CHAR_PERIOD) {
41133
- if (!(keyword in this.ctx)) {
41338
+ if (!hasKey(this.ctx, keyword)) {
41134
41339
  this.ctx = this.ctx[keyword] = Table();
41135
41340
  } else if (isTable(this.ctx[keyword])) {
41136
41341
  this.ctx = this.ctx[keyword];
@@ -41168,7 +41373,7 @@ var tomlParser = createCommonjsModule(function (module) {
41168
41373
  if (this.char === CHAR_SP || this.char === CTRL_I) {
41169
41374
  return null;
41170
41375
  } else if (this.char === CHAR_RSQB) {
41171
- if (!(keyword in this.ctx)) {
41376
+ if (!hasKey(this.ctx, keyword)) {
41172
41377
  this.ctx[keyword] = List();
41173
41378
  }
41174
41379
 
@@ -41184,7 +41389,7 @@ var tomlParser = createCommonjsModule(function (module) {
41184
41389
 
41185
41390
  return this.next(this.parseListEnd);
41186
41391
  } else if (this.char === CHAR_PERIOD) {
41187
- if (!(keyword in this.ctx)) {
41392
+ if (!hasKey(this.ctx, keyword)) {
41188
41393
  this.ctx = this.ctx[keyword] = Table();
41189
41394
  } else if (isInlineList(this.ctx[keyword])) {
41190
41395
  throw this.error(new TomlError("Can't extend an inline array"));
@@ -41564,8 +41769,8 @@ var tomlParser = createCommonjsModule(function (module) {
41564
41769
  }
41565
41770
 
41566
41771
  return this.returnNow(String.fromCodePoint(codePoint));
41567
- } catch (ex) {
41568
- throw this.error(TomlError.wrap(ex));
41772
+ } catch (err) {
41773
+ throw this.error(TomlError.wrap(err));
41569
41774
  }
41570
41775
  }
41571
41776
  }, {
@@ -41604,7 +41809,30 @@ var tomlParser = createCommonjsModule(function (module) {
41604
41809
  } else if (this.char === CHAR_n) {
41605
41810
  return this.next(this.parseNan);
41606
41811
  } else {
41607
- return this.callNow(this.parseNoUnder, this.parseNumberInteger);
41812
+ return this.callNow(this.parseNoUnder, this.parseNumberIntegerStart);
41813
+ }
41814
+ }
41815
+ }, {
41816
+ key: "parseNumberIntegerStart",
41817
+ value: function parseNumberIntegerStart() {
41818
+ if (this.char === CHAR_0) {
41819
+ this.consume();
41820
+ return this.next(this.parseNumberIntegerExponentOrDecimal);
41821
+ } else {
41822
+ return this.goto(this.parseNumberInteger);
41823
+ }
41824
+ }
41825
+ }, {
41826
+ key: "parseNumberIntegerExponentOrDecimal",
41827
+ value: function parseNumberIntegerExponentOrDecimal() {
41828
+ if (this.char === CHAR_PERIOD) {
41829
+ this.consume();
41830
+ return this.call(this.parseNoUnder, this.parseNumberFloat);
41831
+ } else if (this.char === CHAR_E || this.char === CHAR_e) {
41832
+ this.consume();
41833
+ return this.next(this.parseNumberExponentSign);
41834
+ } else {
41835
+ return this.returnNow(Integer(this.state.buf));
41608
41836
  }
41609
41837
  }
41610
41838
  }, {
@@ -41634,9 +41862,9 @@ var tomlParser = createCommonjsModule(function (module) {
41634
41862
  }, {
41635
41863
  key: "parseNoUnder",
41636
41864
  value: function parseNoUnder() {
41637
- if (this.char === CHAR_LOWBAR) {
41638
- throw this.error(new TomlError('Unexpected character, expected digit, exponent marker(e) or whitespace'));
41639
- } else if (this.atEndOfWord() || this.char === CHAR_E || this.char === CHAR_e) {
41865
+ if (this.char === CHAR_LOWBAR || this.char === CHAR_PERIOD || this.char === CHAR_E || this.char === CHAR_e) {
41866
+ throw this.error(new TomlError('Unexpected character, expected digit'));
41867
+ } else if (this.atEndOfWord()) {
41640
41868
  throw this.error(new TomlError('Incomplete number'));
41641
41869
  }
41642
41870
 
@@ -42211,7 +42439,7 @@ var tomlParser = createCommonjsModule(function (module) {
42211
42439
  for (var _iterator2 = kv.key[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
42212
42440
  var kw = _step2.value;
42213
42441
 
42214
- if (kw in target && (!isTable(target[kw]) || target[kw][_declared])) {
42442
+ if (hasKey(target, kw) && (!isTable(target[kw]) || target[kw][_declared])) {
42215
42443
  throw this.error(new TomlError("Can't redefine existing key"));
42216
42444
  }
42217
42445
 
@@ -42232,7 +42460,7 @@ var tomlParser = createCommonjsModule(function (module) {
42232
42460
  }
42233
42461
  }
42234
42462
 
42235
- if (finalKey in target) {
42463
+ if (hasKey(target, finalKey)) {
42236
42464
  throw this.error(new TomlError("Can't redefine existing key"));
42237
42465
  }
42238
42466
 
@@ -42312,7 +42540,7 @@ function prettyError(err, buf) {
42312
42540
  var parseString_1 = parseString;
42313
42541
 
42314
42542
  function parseString(str) {
42315
- if (commonjsGlobal.Buffer && commonjsGlobal.Buffer.isBuffer(str)) {
42543
+ if (global.Buffer && global.Buffer.isBuffer(str)) {
42316
42544
  str = str.toString('utf8');
42317
42545
  }
42318
42546
 
@@ -42321,8 +42549,8 @@ function parseString(str) {
42321
42549
  try {
42322
42550
  parser.parse(str);
42323
42551
  return parser.finish();
42324
- } catch (ex) {
42325
- throw parsePrettyError(ex, str);
42552
+ } catch (err) {
42553
+ throw parsePrettyError(err, str);
42326
42554
  }
42327
42555
  }
42328
42556
 
@@ -42500,7 +42728,8 @@ var resolveConfig_1 = createCommonjsModule(function (module) {
42500
42728
  var patternList = [].concat(patterns);
42501
42729
  var excludedPatternList = [].concat(excludedPatterns || []);
42502
42730
  var opts = {
42503
- matchBase: true
42731
+ matchBase: true,
42732
+ dot: true
42504
42733
  };
42505
42734
  return patternList.some(function (pattern) {
42506
42735
  return minimatch_1(filePath, pattern, opts);