prettier 3.3.1 → 3.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +41 -40
- package/doc.js +11 -11
- package/doc.mjs +11 -11
- package/index.cjs +9 -9
- package/index.d.ts +1 -2
- package/index.mjs +703 -763
- package/internal/cli.mjs +15 -15
- package/package.json +1 -1
- package/plugins/acorn.js +14 -12
- package/plugins/acorn.mjs +14 -12
- package/plugins/angular.js +1 -1
- package/plugins/angular.mjs +1 -1
- package/plugins/babel.js +10 -11
- package/plugins/babel.mjs +10 -11
- package/plugins/estree.js +27 -27
- package/plugins/estree.mjs +27 -27
- package/plugins/flow.js +15 -16
- package/plugins/flow.mjs +15 -16
- package/plugins/glimmer.js +13 -13
- package/plugins/glimmer.mjs +13 -13
- package/plugins/graphql.js +8 -8
- package/plugins/graphql.mjs +8 -8
- package/plugins/html.js +19 -16
- package/plugins/html.mjs +18 -15
- package/plugins/markdown.js +43 -40
- package/plugins/markdown.mjs +43 -40
- package/plugins/meriyah.js +4 -5
- package/plugins/meriyah.mjs +4 -5
- package/plugins/postcss.js +28 -25
- package/plugins/postcss.mjs +28 -25
- package/plugins/typescript.js +15 -20
- package/plugins/typescript.mjs +15 -20
- package/plugins/yaml.js +6 -6
- package/plugins/yaml.mjs +6 -6
- package/standalone.js +31 -30
- package/standalone.mjs +28 -27
package/LICENSE
CHANGED
|
@@ -17,7 +17,7 @@ MIT, ISC, BSD-2-Clause, BSD-3-Clause, Apache-2.0
|
|
|
17
17
|
|
|
18
18
|
## Bundled dependencies
|
|
19
19
|
|
|
20
|
-
### @angular/compiler@v18.
|
|
20
|
+
### @angular/compiler@v18.1.0
|
|
21
21
|
|
|
22
22
|
> Angular - the compiler library
|
|
23
23
|
|
|
@@ -27,7 +27,7 @@ Author: angular
|
|
|
27
27
|
|
|
28
28
|
----------------------------------------
|
|
29
29
|
|
|
30
|
-
### @babel/code-frame@v7.24.
|
|
30
|
+
### @babel/code-frame@v7.24.7
|
|
31
31
|
|
|
32
32
|
> Generate errors that contain a code frame that point to source locations.
|
|
33
33
|
|
|
@@ -61,7 +61,7 @@ Author: The Babel Team (https://babel.dev/team)
|
|
|
61
61
|
|
|
62
62
|
----------------------------------------
|
|
63
63
|
|
|
64
|
-
### @babel/helper-validator-identifier@v7.24.
|
|
64
|
+
### @babel/helper-validator-identifier@v7.24.7
|
|
65
65
|
|
|
66
66
|
> Validate identifier/keywords name
|
|
67
67
|
|
|
@@ -94,7 +94,7 @@ Author: The Babel Team (https://babel.dev/team)
|
|
|
94
94
|
|
|
95
95
|
----------------------------------------
|
|
96
96
|
|
|
97
|
-
### @babel/highlight@v7.24.
|
|
97
|
+
### @babel/highlight@v7.24.7
|
|
98
98
|
|
|
99
99
|
> Syntax highlight JavaScript strings for output in terminals.
|
|
100
100
|
|
|
@@ -128,7 +128,7 @@ Author: The Babel Team (https://babel.dev/team)
|
|
|
128
128
|
|
|
129
129
|
----------------------------------------
|
|
130
130
|
|
|
131
|
-
### @babel/parser@v7.24.
|
|
131
|
+
### @babel/parser@v7.24.8
|
|
132
132
|
|
|
133
133
|
> A JavaScript parser
|
|
134
134
|
|
|
@@ -456,7 +456,7 @@ Author: Alex Bell <alex@bellandwhistle.net>
|
|
|
456
456
|
|
|
457
457
|
----------------------------------------
|
|
458
458
|
|
|
459
|
-
### @typescript-eslint/types@
|
|
459
|
+
### @typescript-eslint/types@v8.0.0-alpha.41
|
|
460
460
|
|
|
461
461
|
> Types for the TypeScript-ESTree AST spec
|
|
462
462
|
|
|
@@ -488,7 +488,7 @@ Repository: <https://github.com/typescript-eslint/typescript-eslint.git>
|
|
|
488
488
|
|
|
489
489
|
----------------------------------------
|
|
490
490
|
|
|
491
|
-
### @typescript-eslint/typescript-estree@
|
|
491
|
+
### @typescript-eslint/typescript-estree@v8.0.0-alpha.41
|
|
492
492
|
|
|
493
493
|
> A parser that converts TypeScript source code into an ESTree compatible form
|
|
494
494
|
|
|
@@ -525,13 +525,13 @@ Repository: <https://github.com/typescript-eslint/typescript-eslint.git>
|
|
|
525
525
|
|
|
526
526
|
----------------------------------------
|
|
527
527
|
|
|
528
|
-
### acorn@v8.
|
|
528
|
+
### acorn@v8.12.1
|
|
529
529
|
|
|
530
530
|
> ECMAScript parser
|
|
531
531
|
|
|
532
532
|
License: MIT
|
|
533
533
|
Homepage: <https://github.com/acornjs/acorn>
|
|
534
|
-
Repository: <https://github.com/acornjs/acorn.git>
|
|
534
|
+
Repository: <git+https://github.com/acornjs/acorn.git>
|
|
535
535
|
|
|
536
536
|
> MIT License
|
|
537
537
|
>
|
|
@@ -619,7 +619,7 @@ Author: Ika <ikatyang@gmail.com> (https://github.com/ikatyang)
|
|
|
619
619
|
|
|
620
620
|
----------------------------------------
|
|
621
621
|
|
|
622
|
-
### angular-html-parser@
|
|
622
|
+
### angular-html-parser@v6.0.2
|
|
623
623
|
|
|
624
624
|
> A HTML parser extracted from Angular with some modifications
|
|
625
625
|
|
|
@@ -627,26 +627,26 @@ License: MIT
|
|
|
627
627
|
Homepage: <https://github.com/prettier/angular-html-parser/blob/master/packages/angular-html-parser#readme>
|
|
628
628
|
Author: Ika <ikatyang@gmail.com> (https://github.com/ikatyang)
|
|
629
629
|
|
|
630
|
-
> MIT License
|
|
631
|
-
>
|
|
632
|
-
> Copyright (c) Ika <ikatyang@gmail.com> (https://github.com/ikatyang)
|
|
633
|
-
>
|
|
634
|
-
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
635
|
-
> of this software and associated documentation files (the "Software"), to deal
|
|
636
|
-
> in the Software without restriction, including without limitation the rights
|
|
637
|
-
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
638
|
-
> copies of the Software, and to permit persons to whom the Software is
|
|
639
|
-
> furnished to do so, subject to the following conditions:
|
|
640
|
-
>
|
|
641
|
-
> The above copyright notice and this permission notice shall be included in all
|
|
642
|
-
> copies or substantial portions of the Software.
|
|
643
|
-
>
|
|
644
|
-
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
645
|
-
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
646
|
-
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
647
|
-
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
648
|
-
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
649
|
-
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
630
|
+
> MIT License
|
|
631
|
+
>
|
|
632
|
+
> Copyright (c) Ika <ikatyang@gmail.com> (https://github.com/ikatyang)
|
|
633
|
+
>
|
|
634
|
+
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
635
|
+
> of this software and associated documentation files (the "Software"), to deal
|
|
636
|
+
> in the Software without restriction, including without limitation the rights
|
|
637
|
+
> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
638
|
+
> copies of the Software, and to permit persons to whom the Software is
|
|
639
|
+
> furnished to do so, subject to the following conditions:
|
|
640
|
+
>
|
|
641
|
+
> The above copyright notice and this permission notice shall be included in all
|
|
642
|
+
> copies or substantial portions of the Software.
|
|
643
|
+
>
|
|
644
|
+
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
645
|
+
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
646
|
+
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
647
|
+
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
648
|
+
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
649
|
+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
650
650
|
> SOFTWARE.
|
|
651
651
|
|
|
652
652
|
----------------------------------------
|
|
@@ -1167,7 +1167,7 @@ Author: Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
|
1167
1167
|
|
|
1168
1168
|
----------------------------------------
|
|
1169
1169
|
|
|
1170
|
-
### espree@v10.0
|
|
1170
|
+
### espree@v10.1.0
|
|
1171
1171
|
|
|
1172
1172
|
> An Esprima-compatible JavaScript parser built on Acorn
|
|
1173
1173
|
|
|
@@ -1302,7 +1302,7 @@ Author: James Halliday <mail@substack.net> (http://substack.net)
|
|
|
1302
1302
|
|
|
1303
1303
|
----------------------------------------
|
|
1304
1304
|
|
|
1305
|
-
### fastq@v1.
|
|
1305
|
+
### fastq@v1.17.1
|
|
1306
1306
|
|
|
1307
1307
|
> Fast, in memory work queue
|
|
1308
1308
|
|
|
@@ -1528,7 +1528,7 @@ Contributors:
|
|
|
1528
1528
|
|
|
1529
1529
|
----------------------------------------
|
|
1530
1530
|
|
|
1531
|
-
### flow-parser@v0.
|
|
1531
|
+
### flow-parser@v0.237.2
|
|
1532
1532
|
|
|
1533
1533
|
> JavaScript parser written in OCaml. Produces ESTree AST
|
|
1534
1534
|
|
|
@@ -1605,7 +1605,7 @@ Contributors:
|
|
|
1605
1605
|
|
|
1606
1606
|
----------------------------------------
|
|
1607
1607
|
|
|
1608
|
-
### graphql@v16.
|
|
1608
|
+
### graphql@v16.9.0
|
|
1609
1609
|
|
|
1610
1610
|
> A Query Language and Runtime which can target any service.
|
|
1611
1611
|
|
|
@@ -2223,7 +2223,7 @@ Author: fisker Cheung <lionkay@gmail.com> (https://www.fiskercheung.com/)
|
|
|
2223
2223
|
|
|
2224
2224
|
----------------------------------------
|
|
2225
2225
|
|
|
2226
|
-
### jest-docblock@
|
|
2226
|
+
### jest-docblock@v30.0.0-alpha.5
|
|
2227
2227
|
|
|
2228
2228
|
License: MIT
|
|
2229
2229
|
Repository: <https://github.com/jestjs/jest.git>
|
|
@@ -2231,6 +2231,7 @@ Repository: <https://github.com/jestjs/jest.git>
|
|
|
2231
2231
|
> MIT License
|
|
2232
2232
|
>
|
|
2233
2233
|
> Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2234
|
+
> Copyright Contributors to the Jest project.
|
|
2234
2235
|
>
|
|
2235
2236
|
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
2236
2237
|
> of this software and associated documentation files (the "Software"), to deal
|
|
@@ -2564,7 +2565,7 @@ Repository: <git@github.com:teambition/merge2.git>
|
|
|
2564
2565
|
|
|
2565
2566
|
----------------------------------------
|
|
2566
2567
|
|
|
2567
|
-
### meriyah@v4.
|
|
2568
|
+
### meriyah@v4.5.0
|
|
2568
2569
|
|
|
2569
2570
|
> A 100% compliant, self-hosted javascript parser with high focus on both performance and stability
|
|
2570
2571
|
|
|
@@ -2834,7 +2835,7 @@ Author: Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
|
|
2834
2835
|
|
|
2835
2836
|
----------------------------------------
|
|
2836
2837
|
|
|
2837
|
-
### picocolors@v1.0.
|
|
2838
|
+
### picocolors@v1.0.1
|
|
2838
2839
|
|
|
2839
2840
|
> The tiniest and the fastest library for terminal output formatting with ANSI colors
|
|
2840
2841
|
|
|
@@ -2943,7 +2944,7 @@ Author: typicode
|
|
|
2943
2944
|
|
|
2944
2945
|
----------------------------------------
|
|
2945
2946
|
|
|
2946
|
-
### postcss@v8.4.
|
|
2947
|
+
### postcss@v8.4.39
|
|
2947
2948
|
|
|
2948
2949
|
> Tool for transforming styles with JS plugins
|
|
2949
2950
|
|
|
@@ -3685,7 +3686,7 @@ Author: JoshuaKGoldberg <npm@joshuakgoldberg.com>
|
|
|
3685
3686
|
|
|
3686
3687
|
----------------------------------------
|
|
3687
3688
|
|
|
3688
|
-
### typescript@v5.
|
|
3689
|
+
### typescript@v5.5.3
|
|
3689
3690
|
|
|
3690
3691
|
> TypeScript is a language for application scale JavaScript development
|
|
3691
3692
|
|
|
@@ -4360,7 +4361,7 @@ Author: Ika <ikatyang@gmail.com> (https://github.com/ikatyang)
|
|
|
4360
4361
|
|
|
4361
4362
|
----------------------------------------
|
|
4362
4363
|
|
|
4363
|
-
### yocto-queue@v1.
|
|
4364
|
+
### yocto-queue@v1.1.1
|
|
4364
4365
|
|
|
4365
4366
|
> Tiny queue data structure
|
|
4366
4367
|
|
package/doc.js
CHANGED
|
@@ -378,7 +378,7 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
|
|
|
378
378
|
var _isNarrowWidth = (codePoint) => !(isFullWidth(codePoint) || isWide(codePoint));
|
|
379
379
|
|
|
380
380
|
// src/utils/get-string-width.js
|
|
381
|
-
var notAsciiRegex = /[^\x20-\x7F]
|
|
381
|
+
var notAsciiRegex = /[^\x20-\x7F]/u;
|
|
382
382
|
function getStringWidth(text) {
|
|
383
383
|
if (!text) {
|
|
384
384
|
return 0;
|
|
@@ -503,7 +503,7 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
|
|
|
503
503
|
function breakParentGroup(groupStack) {
|
|
504
504
|
if (groupStack.length > 0) {
|
|
505
505
|
const parentGroup = at_default(
|
|
506
|
-
/* isOptionalObject*/
|
|
506
|
+
/* isOptionalObject */
|
|
507
507
|
false,
|
|
508
508
|
groupStack,
|
|
509
509
|
-1
|
|
@@ -560,12 +560,12 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
|
|
|
560
560
|
function stripTrailingHardlineFromParts(parts) {
|
|
561
561
|
parts = [...parts];
|
|
562
562
|
while (parts.length >= 2 && at_default(
|
|
563
|
-
/* isOptionalObject*/
|
|
563
|
+
/* isOptionalObject */
|
|
564
564
|
false,
|
|
565
565
|
parts,
|
|
566
566
|
-2
|
|
567
567
|
).type === DOC_TYPE_LINE && at_default(
|
|
568
|
-
/* isOptionalObject*/
|
|
568
|
+
/* isOptionalObject */
|
|
569
569
|
false,
|
|
570
570
|
parts,
|
|
571
571
|
-1
|
|
@@ -574,7 +574,7 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
|
|
|
574
574
|
}
|
|
575
575
|
if (parts.length > 0) {
|
|
576
576
|
const lastPart = stripTrailingHardlineFromDoc(at_default(
|
|
577
|
-
/* isOptionalObject*/
|
|
577
|
+
/* isOptionalObject */
|
|
578
578
|
false,
|
|
579
579
|
parts,
|
|
580
580
|
-1
|
|
@@ -610,7 +610,7 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
|
|
|
610
610
|
case DOC_TYPE_ARRAY:
|
|
611
611
|
return stripTrailingHardlineFromParts(doc);
|
|
612
612
|
case DOC_TYPE_STRING:
|
|
613
|
-
return doc.replace(/[\n\r]
|
|
613
|
+
return doc.replace(/[\n\r]*$/u, "");
|
|
614
614
|
case DOC_TYPE_ALIGN:
|
|
615
615
|
case DOC_TYPE_CURSOR:
|
|
616
616
|
case DOC_TYPE_TRIM:
|
|
@@ -662,7 +662,7 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
|
|
|
662
662
|
}
|
|
663
663
|
const [currentPart, ...restParts] = Array.isArray(part) ? part : [part];
|
|
664
664
|
if (typeof currentPart === "string" && typeof at_default(
|
|
665
|
-
/* isOptionalObject*/
|
|
665
|
+
/* isOptionalObject */
|
|
666
666
|
false,
|
|
667
667
|
parts,
|
|
668
668
|
-1
|
|
@@ -902,7 +902,7 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
|
|
|
902
902
|
}
|
|
903
903
|
const groupMode = doc.break ? MODE_BREAK : mode;
|
|
904
904
|
const contents = doc.expandedStates && groupMode === MODE_BREAK ? at_default(
|
|
905
|
-
/* isOptionalObject*/
|
|
905
|
+
/* isOptionalObject */
|
|
906
906
|
false,
|
|
907
907
|
doc.expandedStates,
|
|
908
908
|
-1
|
|
@@ -969,7 +969,7 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
|
|
|
969
969
|
switch (get_doc_type_default(doc2)) {
|
|
970
970
|
case DOC_TYPE_STRING: {
|
|
971
971
|
const formatted = newLine !== "\n" ? string_replace_all_default(
|
|
972
|
-
/* isOptionalObject*/
|
|
972
|
+
/* isOptionalObject */
|
|
973
973
|
false,
|
|
974
974
|
doc2,
|
|
975
975
|
"\n",
|
|
@@ -1039,7 +1039,7 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
|
|
|
1039
1039
|
} else {
|
|
1040
1040
|
if (doc2.expandedStates) {
|
|
1041
1041
|
const mostExpanded = at_default(
|
|
1042
|
-
/* isOptionalObject*/
|
|
1042
|
+
/* isOptionalObject */
|
|
1043
1043
|
false,
|
|
1044
1044
|
doc2.expandedStates,
|
|
1045
1045
|
-1
|
|
@@ -1087,7 +1087,7 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
|
|
|
1087
1087
|
}
|
|
1088
1088
|
if (doc2.id) {
|
|
1089
1089
|
groupModeMap[doc2.id] = at_default(
|
|
1090
|
-
/* isOptionalObject*/
|
|
1090
|
+
/* isOptionalObject */
|
|
1091
1091
|
false,
|
|
1092
1092
|
cmds,
|
|
1093
1093
|
-1
|
package/doc.mjs
CHANGED
|
@@ -343,7 +343,7 @@ function isWide(x) {
|
|
|
343
343
|
var _isNarrowWidth = (codePoint) => !(isFullWidth(codePoint) || isWide(codePoint));
|
|
344
344
|
|
|
345
345
|
// src/utils/get-string-width.js
|
|
346
|
-
var notAsciiRegex = /[^\x20-\x7F]
|
|
346
|
+
var notAsciiRegex = /[^\x20-\x7F]/u;
|
|
347
347
|
function getStringWidth(text) {
|
|
348
348
|
if (!text) {
|
|
349
349
|
return 0;
|
|
@@ -468,7 +468,7 @@ function willBreak(doc) {
|
|
|
468
468
|
function breakParentGroup(groupStack) {
|
|
469
469
|
if (groupStack.length > 0) {
|
|
470
470
|
const parentGroup = at_default(
|
|
471
|
-
/* isOptionalObject*/
|
|
471
|
+
/* isOptionalObject */
|
|
472
472
|
false,
|
|
473
473
|
groupStack,
|
|
474
474
|
-1
|
|
@@ -525,12 +525,12 @@ function removeLines(doc) {
|
|
|
525
525
|
function stripTrailingHardlineFromParts(parts) {
|
|
526
526
|
parts = [...parts];
|
|
527
527
|
while (parts.length >= 2 && at_default(
|
|
528
|
-
/* isOptionalObject*/
|
|
528
|
+
/* isOptionalObject */
|
|
529
529
|
false,
|
|
530
530
|
parts,
|
|
531
531
|
-2
|
|
532
532
|
).type === DOC_TYPE_LINE && at_default(
|
|
533
|
-
/* isOptionalObject*/
|
|
533
|
+
/* isOptionalObject */
|
|
534
534
|
false,
|
|
535
535
|
parts,
|
|
536
536
|
-1
|
|
@@ -539,7 +539,7 @@ function stripTrailingHardlineFromParts(parts) {
|
|
|
539
539
|
}
|
|
540
540
|
if (parts.length > 0) {
|
|
541
541
|
const lastPart = stripTrailingHardlineFromDoc(at_default(
|
|
542
|
-
/* isOptionalObject*/
|
|
542
|
+
/* isOptionalObject */
|
|
543
543
|
false,
|
|
544
544
|
parts,
|
|
545
545
|
-1
|
|
@@ -575,7 +575,7 @@ function stripTrailingHardlineFromDoc(doc) {
|
|
|
575
575
|
case DOC_TYPE_ARRAY:
|
|
576
576
|
return stripTrailingHardlineFromParts(doc);
|
|
577
577
|
case DOC_TYPE_STRING:
|
|
578
|
-
return doc.replace(/[\n\r]
|
|
578
|
+
return doc.replace(/[\n\r]*$/u, "");
|
|
579
579
|
case DOC_TYPE_ALIGN:
|
|
580
580
|
case DOC_TYPE_CURSOR:
|
|
581
581
|
case DOC_TYPE_TRIM:
|
|
@@ -627,7 +627,7 @@ function cleanDocFn(doc) {
|
|
|
627
627
|
}
|
|
628
628
|
const [currentPart, ...restParts] = Array.isArray(part) ? part : [part];
|
|
629
629
|
if (typeof currentPart === "string" && typeof at_default(
|
|
630
|
-
/* isOptionalObject*/
|
|
630
|
+
/* isOptionalObject */
|
|
631
631
|
false,
|
|
632
632
|
parts,
|
|
633
633
|
-1
|
|
@@ -867,7 +867,7 @@ function fits(next, restCommands, width, hasLineSuffix, groupModeMap, mustBeFlat
|
|
|
867
867
|
}
|
|
868
868
|
const groupMode = doc.break ? MODE_BREAK : mode;
|
|
869
869
|
const contents = doc.expandedStates && groupMode === MODE_BREAK ? at_default(
|
|
870
|
-
/* isOptionalObject*/
|
|
870
|
+
/* isOptionalObject */
|
|
871
871
|
false,
|
|
872
872
|
doc.expandedStates,
|
|
873
873
|
-1
|
|
@@ -934,7 +934,7 @@ function printDocToString(doc, options) {
|
|
|
934
934
|
switch (get_doc_type_default(doc2)) {
|
|
935
935
|
case DOC_TYPE_STRING: {
|
|
936
936
|
const formatted = newLine !== "\n" ? string_replace_all_default(
|
|
937
|
-
/* isOptionalObject*/
|
|
937
|
+
/* isOptionalObject */
|
|
938
938
|
false,
|
|
939
939
|
doc2,
|
|
940
940
|
"\n",
|
|
@@ -1004,7 +1004,7 @@ function printDocToString(doc, options) {
|
|
|
1004
1004
|
} else {
|
|
1005
1005
|
if (doc2.expandedStates) {
|
|
1006
1006
|
const mostExpanded = at_default(
|
|
1007
|
-
/* isOptionalObject*/
|
|
1007
|
+
/* isOptionalObject */
|
|
1008
1008
|
false,
|
|
1009
1009
|
doc2.expandedStates,
|
|
1010
1010
|
-1
|
|
@@ -1052,7 +1052,7 @@ function printDocToString(doc, options) {
|
|
|
1052
1052
|
}
|
|
1053
1053
|
if (doc2.id) {
|
|
1054
1054
|
groupModeMap[doc2.id] = at_default(
|
|
1055
|
-
/* isOptionalObject*/
|
|
1055
|
+
/* isOptionalObject */
|
|
1056
1056
|
false,
|
|
1057
1057
|
cmds,
|
|
1058
1058
|
-1
|
package/index.cjs
CHANGED
|
@@ -62,10 +62,10 @@ function skip(characters) {
|
|
|
62
62
|
var skipWhitespace, skipSpaces, skipToLineEnd, skipEverythingButNewLine;
|
|
63
63
|
var init_skip = __esm({
|
|
64
64
|
"src/utils/skip.js"() {
|
|
65
|
-
skipWhitespace = skip(/\s/);
|
|
65
|
+
skipWhitespace = skip(/\s/u);
|
|
66
66
|
skipSpaces = skip(" ");
|
|
67
67
|
skipToLineEnd = skip(",; ");
|
|
68
|
-
skipEverythingButNewLine = skip(/[^\n\r]/);
|
|
68
|
+
skipEverythingButNewLine = skip(/[^\n\r]/u);
|
|
69
69
|
}
|
|
70
70
|
});
|
|
71
71
|
|
|
@@ -293,7 +293,7 @@ function getIndentSize(value, tabWidth) {
|
|
|
293
293
|
}
|
|
294
294
|
return get_alignment_size_default(
|
|
295
295
|
// All the leading whitespaces
|
|
296
|
-
value.slice(lastNewlineIndex + 1).match(/^[\t ]*/)[0],
|
|
296
|
+
value.slice(lastNewlineIndex + 1).match(/^[\t ]*/u)[0],
|
|
297
297
|
tabWidth
|
|
298
298
|
);
|
|
299
299
|
}
|
|
@@ -320,7 +320,7 @@ var init_escape_string_regexp = __esm({
|
|
|
320
320
|
// src/utils/get-max-continuous-count.js
|
|
321
321
|
function getMaxContinuousCount(text, searchString) {
|
|
322
322
|
const results = text.match(
|
|
323
|
-
new RegExp(`(${escapeStringRegexp(searchString)})+`, "
|
|
323
|
+
new RegExp(`(${escapeStringRegexp(searchString)})+`, "gu")
|
|
324
324
|
);
|
|
325
325
|
if (results === null) {
|
|
326
326
|
return 0;
|
|
@@ -409,7 +409,7 @@ var init_get_string_width = __esm({
|
|
|
409
409
|
"src/utils/get-string-width.js"() {
|
|
410
410
|
init_emoji_regex();
|
|
411
411
|
init_get_east_asian_width();
|
|
412
|
-
notAsciiRegex = /[^\x20-\x7F]
|
|
412
|
+
notAsciiRegex = /[^\x20-\x7F]/u;
|
|
413
413
|
get_string_width_default = getStringWidth;
|
|
414
414
|
}
|
|
415
415
|
});
|
|
@@ -470,9 +470,9 @@ var init_string_replace_all = __esm({
|
|
|
470
470
|
// src/utils/make-string.js
|
|
471
471
|
function makeString(rawText, enclosingQuote, unescapeUnnecessaryEscapes) {
|
|
472
472
|
const otherQuote = enclosingQuote === '"' ? "'" : '"';
|
|
473
|
-
const regex = /\\(.)|(["'])/
|
|
473
|
+
const regex = /\\(.)|(["'])/gsu;
|
|
474
474
|
const raw = string_replace_all_default(
|
|
475
|
-
/* isOptionalObject*/
|
|
475
|
+
/* isOptionalObject */
|
|
476
476
|
false,
|
|
477
477
|
rawText,
|
|
478
478
|
regex,
|
|
@@ -486,7 +486,7 @@ function makeString(rawText, enclosingQuote, unescapeUnnecessaryEscapes) {
|
|
|
486
486
|
if (quote) {
|
|
487
487
|
return quote;
|
|
488
488
|
}
|
|
489
|
-
return unescapeUnnecessaryEscapes && /^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]
|
|
489
|
+
return unescapeUnnecessaryEscapes && /^[^\n\r"'0-7\\bfnrt-vx\u2028\u2029]$/u.test(escaped) ? escaped : "\\" + escaped;
|
|
490
490
|
}
|
|
491
491
|
);
|
|
492
492
|
return enclosingQuote + raw + enclosingQuote;
|
|
@@ -585,7 +585,7 @@ var init_public = __esm({
|
|
|
585
585
|
// src/main/version.evaluate.cjs
|
|
586
586
|
var require_version_evaluate = __commonJS({
|
|
587
587
|
"src/main/version.evaluate.cjs"(exports2, module2) {
|
|
588
|
-
module2.exports = "3.3.
|
|
588
|
+
module2.exports = "3.3.3";
|
|
589
589
|
}
|
|
590
590
|
});
|
|
591
591
|
|
package/index.d.ts
CHANGED
|
@@ -613,8 +613,7 @@ export interface ResolveConfigOptions {
|
|
|
613
613
|
/**
|
|
614
614
|
* `resolveConfig` can be used to resolve configuration for a given source file,
|
|
615
615
|
* passing its path or url as the first argument. The config search will start at
|
|
616
|
-
* the file location and continue to search up the directory.
|
|
617
|
-
* (You can use `process.cwd()` to start searching from the current directory).
|
|
616
|
+
* the directory of the file location and continue to search up the directory.
|
|
618
617
|
*
|
|
619
618
|
* A promise is returned which will resolve to:
|
|
620
619
|
*
|