prettier 3.0.1 → 3.0.2
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 +10 -9
- package/index.cjs +1 -1
- package/index.mjs +62 -38
- package/internal/cli.mjs +20 -2
- package/internal/internal.mjs +61 -37
- package/package.json +1 -1
- package/plugins/babel.js +11 -11
- package/plugins/babel.mjs +11 -11
- package/plugins/estree.js +22 -22
- package/plugins/estree.mjs +22 -22
- package/plugins/flow.js +17 -17
- package/plugins/flow.mjs +17 -17
- package/plugins/html.js +15 -15
- package/plugins/html.mjs +15 -15
- package/plugins/markdown.js +38 -38
- package/plugins/markdown.mjs +38 -38
- package/plugins/postcss.js +1 -1
- package/plugins/postcss.mjs +1 -1
- package/plugins/typescript.js +17 -17
- package/plugins/typescript.mjs +17 -17
- package/standalone.js +24 -24
- package/standalone.mjs +24 -24
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@v16.
|
|
20
|
+
### @angular/compiler@v16.2.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.22.
|
|
30
|
+
### @babel/code-frame@v7.22.10
|
|
31
31
|
|
|
32
32
|
> Generate errors that contain a code frame that point to source locations.
|
|
33
33
|
|
|
@@ -94,7 +94,7 @@ Author: The Babel Team (https://babel.dev/team)
|
|
|
94
94
|
|
|
95
95
|
----------------------------------------
|
|
96
96
|
|
|
97
|
-
### @babel/highlight@v7.22.
|
|
97
|
+
### @babel/highlight@v7.22.10
|
|
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.22.
|
|
131
|
+
### @babel/parser@v7.22.10
|
|
132
132
|
|
|
133
133
|
> A JavaScript parser
|
|
134
134
|
|
|
@@ -397,7 +397,7 @@ Author: fisker Cheung <lionkay@gmail.com>
|
|
|
397
397
|
|
|
398
398
|
----------------------------------------
|
|
399
399
|
|
|
400
|
-
### @prettier/parse-srcset@v3.
|
|
400
|
+
### @prettier/parse-srcset@v3.1.0
|
|
401
401
|
|
|
402
402
|
> A spec-conformant JavaScript parser for the HTML5 srcset attribute
|
|
403
403
|
|
|
@@ -408,6 +408,7 @@ Author: Alex Bell <alex@bellandwhistle.net>
|
|
|
408
408
|
> The MIT License (MIT)
|
|
409
409
|
>
|
|
410
410
|
> Copyright (c) 2014 Alex Bell
|
|
411
|
+
> Copyright (c) fisker Cheung
|
|
411
412
|
>
|
|
412
413
|
> Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
413
414
|
> of this software and associated documentation files (the "Software"), to deal
|
|
@@ -429,7 +430,7 @@ Author: Alex Bell <alex@bellandwhistle.net>
|
|
|
429
430
|
|
|
430
431
|
----------------------------------------
|
|
431
432
|
|
|
432
|
-
### @typescript-eslint/types@v6.
|
|
433
|
+
### @typescript-eslint/types@v6.4.0
|
|
433
434
|
|
|
434
435
|
> Types for the TypeScript-ESTree AST spec
|
|
435
436
|
|
|
@@ -460,7 +461,7 @@ Repository: <https://github.com/typescript-eslint/typescript-eslint.git>
|
|
|
460
461
|
|
|
461
462
|
----------------------------------------
|
|
462
463
|
|
|
463
|
-
### @typescript-eslint/typescript-estree@v6.
|
|
464
|
+
### @typescript-eslint/typescript-estree@v6.4.0
|
|
464
465
|
|
|
465
466
|
> A parser that converts TypeScript source code into an ESTree compatible form
|
|
466
467
|
|
|
@@ -798,7 +799,7 @@ Contributors:
|
|
|
798
799
|
|
|
799
800
|
----------------------------------------
|
|
800
801
|
|
|
801
|
-
### camelcase@
|
|
802
|
+
### camelcase@v8.0.0
|
|
802
803
|
|
|
803
804
|
> Convert a dash/dot/underscore/space separated string to camelCase or PascalCase: `foo-bar` → `fooBar`
|
|
804
805
|
|
|
@@ -1915,7 +1916,7 @@ Contributors:
|
|
|
1915
1916
|
|
|
1916
1917
|
----------------------------------------
|
|
1917
1918
|
|
|
1918
|
-
### flow-parser@v0.
|
|
1919
|
+
### flow-parser@v0.214.0
|
|
1919
1920
|
|
|
1920
1921
|
> JavaScript parser written in OCaml. Produces ESTree AST
|
|
1921
1922
|
|
package/index.cjs
CHANGED
package/index.mjs
CHANGED
|
@@ -6068,9 +6068,9 @@ var require_lib = __commonJS({
|
|
|
6068
6068
|
}
|
|
6069
6069
|
});
|
|
6070
6070
|
|
|
6071
|
-
// node_modules/@babel/
|
|
6071
|
+
// node_modules/@babel/code-frame/node_modules/escape-string-regexp/index.js
|
|
6072
6072
|
var require_escape_string_regexp = __commonJS({
|
|
6073
|
-
"node_modules/@babel/
|
|
6073
|
+
"node_modules/@babel/code-frame/node_modules/escape-string-regexp/index.js"(exports, module) {
|
|
6074
6074
|
"use strict";
|
|
6075
6075
|
var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
|
|
6076
6076
|
module.exports = function(str) {
|
|
@@ -7224,9 +7224,9 @@ var require_ansi_styles = __commonJS({
|
|
|
7224
7224
|
}
|
|
7225
7225
|
});
|
|
7226
7226
|
|
|
7227
|
-
// node_modules/@babel/
|
|
7227
|
+
// node_modules/@babel/code-frame/node_modules/has-flag/index.js
|
|
7228
7228
|
var require_has_flag = __commonJS({
|
|
7229
|
-
"node_modules/@babel/
|
|
7229
|
+
"node_modules/@babel/code-frame/node_modules/has-flag/index.js"(exports, module) {
|
|
7230
7230
|
"use strict";
|
|
7231
7231
|
module.exports = (flag, argv) => {
|
|
7232
7232
|
argv = argv || process.argv;
|
|
@@ -7238,9 +7238,9 @@ var require_has_flag = __commonJS({
|
|
|
7238
7238
|
}
|
|
7239
7239
|
});
|
|
7240
7240
|
|
|
7241
|
-
// node_modules/@babel/
|
|
7241
|
+
// node_modules/@babel/code-frame/node_modules/supports-color/index.js
|
|
7242
7242
|
var require_supports_color = __commonJS({
|
|
7243
|
-
"node_modules/@babel/
|
|
7243
|
+
"node_modules/@babel/code-frame/node_modules/supports-color/index.js"(exports, module) {
|
|
7244
7244
|
"use strict";
|
|
7245
7245
|
var os2 = __require("os");
|
|
7246
7246
|
var hasFlag2 = require_has_flag();
|
|
@@ -7333,9 +7333,9 @@ var require_supports_color = __commonJS({
|
|
|
7333
7333
|
}
|
|
7334
7334
|
});
|
|
7335
7335
|
|
|
7336
|
-
// node_modules/@babel/
|
|
7336
|
+
// node_modules/@babel/code-frame/node_modules/chalk/templates.js
|
|
7337
7337
|
var require_templates = __commonJS({
|
|
7338
|
-
"node_modules/@babel/
|
|
7338
|
+
"node_modules/@babel/code-frame/node_modules/chalk/templates.js"(exports, module) {
|
|
7339
7339
|
"use strict";
|
|
7340
7340
|
var TEMPLATE_REGEX = /(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
|
|
7341
7341
|
var STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
|
|
@@ -7444,9 +7444,9 @@ var require_templates = __commonJS({
|
|
|
7444
7444
|
}
|
|
7445
7445
|
});
|
|
7446
7446
|
|
|
7447
|
-
// node_modules/@babel/
|
|
7447
|
+
// node_modules/@babel/code-frame/node_modules/chalk/index.js
|
|
7448
7448
|
var require_chalk = __commonJS({
|
|
7449
|
-
"node_modules/@babel/
|
|
7449
|
+
"node_modules/@babel/code-frame/node_modules/chalk/index.js"(exports, module) {
|
|
7450
7450
|
"use strict";
|
|
7451
7451
|
var escapeStringRegexp2 = require_escape_string_regexp();
|
|
7452
7452
|
var ansiStyles2 = require_ansi_styles();
|
|
@@ -7619,23 +7619,23 @@ var require_lib2 = __commonJS({
|
|
|
7619
7619
|
value: true
|
|
7620
7620
|
});
|
|
7621
7621
|
exports.default = highlight;
|
|
7622
|
-
exports.getChalk = getChalk;
|
|
7623
7622
|
exports.shouldHighlight = shouldHighlight;
|
|
7624
7623
|
var _jsTokens = require_js_tokens();
|
|
7625
7624
|
var _helperValidatorIdentifier = require_lib();
|
|
7626
|
-
var
|
|
7625
|
+
var _chalk2 = require_chalk();
|
|
7626
|
+
var chalk2 = _chalk2;
|
|
7627
7627
|
var sometimesKeywords = /* @__PURE__ */ new Set(["as", "async", "from", "get", "of", "set"]);
|
|
7628
|
-
function getDefs(
|
|
7628
|
+
function getDefs(chalk3) {
|
|
7629
7629
|
return {
|
|
7630
|
-
keyword:
|
|
7631
|
-
capitalized:
|
|
7632
|
-
jsxIdentifier:
|
|
7633
|
-
punctuator:
|
|
7634
|
-
number:
|
|
7635
|
-
string:
|
|
7636
|
-
regex:
|
|
7637
|
-
comment:
|
|
7638
|
-
invalid:
|
|
7630
|
+
keyword: chalk3.cyan,
|
|
7631
|
+
capitalized: chalk3.yellow,
|
|
7632
|
+
jsxIdentifier: chalk3.yellow,
|
|
7633
|
+
punctuator: chalk3.yellow,
|
|
7634
|
+
number: chalk3.magenta,
|
|
7635
|
+
string: chalk3.green,
|
|
7636
|
+
regex: chalk3.magenta,
|
|
7637
|
+
comment: chalk3.grey,
|
|
7638
|
+
invalid: chalk3.white.bgRed.bold
|
|
7639
7639
|
};
|
|
7640
7640
|
}
|
|
7641
7641
|
var NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
|
|
@@ -7690,18 +7690,28 @@ var require_lib2 = __commonJS({
|
|
|
7690
7690
|
return highlighted;
|
|
7691
7691
|
}
|
|
7692
7692
|
function shouldHighlight(options8) {
|
|
7693
|
-
return !!
|
|
7693
|
+
return !!chalk2.supportsColor || options8.forceColor;
|
|
7694
|
+
}
|
|
7695
|
+
var chalkWithForcedColor = void 0;
|
|
7696
|
+
function getChalk(forceColor) {
|
|
7697
|
+
if (forceColor) {
|
|
7698
|
+
var _chalkWithForcedColor;
|
|
7699
|
+
(_chalkWithForcedColor = chalkWithForcedColor) != null ? _chalkWithForcedColor : chalkWithForcedColor = new chalk2.constructor({
|
|
7700
|
+
enabled: true,
|
|
7701
|
+
level: 1
|
|
7702
|
+
});
|
|
7703
|
+
return chalkWithForcedColor;
|
|
7704
|
+
}
|
|
7705
|
+
return chalk2;
|
|
7694
7706
|
}
|
|
7695
|
-
|
|
7696
|
-
|
|
7697
|
-
|
|
7698
|
-
|
|
7699
|
-
}) : _chalk;
|
|
7707
|
+
{
|
|
7708
|
+
{
|
|
7709
|
+
exports.getChalk = (options8) => getChalk(options8.forceColor);
|
|
7710
|
+
}
|
|
7700
7711
|
}
|
|
7701
7712
|
function highlight(code, options8 = {}) {
|
|
7702
7713
|
if (code !== "" && shouldHighlight(options8)) {
|
|
7703
|
-
const
|
|
7704
|
-
const defs = getDefs(chalk2);
|
|
7714
|
+
const defs = getDefs(getChalk(options8.forceColor));
|
|
7705
7715
|
return highlightTokens(defs, code);
|
|
7706
7716
|
} else {
|
|
7707
7717
|
return code;
|
|
@@ -7720,12 +7730,26 @@ var require_lib3 = __commonJS({
|
|
|
7720
7730
|
exports.codeFrameColumns = codeFrameColumns2;
|
|
7721
7731
|
exports.default = _default;
|
|
7722
7732
|
var _highlight = require_lib2();
|
|
7733
|
+
var _chalk2 = require_chalk();
|
|
7734
|
+
var chalk2 = _chalk2;
|
|
7735
|
+
var chalkWithForcedColor = void 0;
|
|
7736
|
+
function getChalk(forceColor) {
|
|
7737
|
+
if (forceColor) {
|
|
7738
|
+
var _chalkWithForcedColor;
|
|
7739
|
+
(_chalkWithForcedColor = chalkWithForcedColor) != null ? _chalkWithForcedColor : chalkWithForcedColor = new chalk2.constructor({
|
|
7740
|
+
enabled: true,
|
|
7741
|
+
level: 1
|
|
7742
|
+
});
|
|
7743
|
+
return chalkWithForcedColor;
|
|
7744
|
+
}
|
|
7745
|
+
return chalk2;
|
|
7746
|
+
}
|
|
7723
7747
|
var deprecationWarningShown = false;
|
|
7724
|
-
function getDefs(
|
|
7748
|
+
function getDefs(chalk3) {
|
|
7725
7749
|
return {
|
|
7726
|
-
gutter:
|
|
7727
|
-
marker:
|
|
7728
|
-
message:
|
|
7750
|
+
gutter: chalk3.grey,
|
|
7751
|
+
marker: chalk3.red.bold,
|
|
7752
|
+
message: chalk3.red.bold
|
|
7729
7753
|
};
|
|
7730
7754
|
}
|
|
7731
7755
|
var NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
|
|
@@ -7787,8 +7811,8 @@ var require_lib3 = __commonJS({
|
|
|
7787
7811
|
}
|
|
7788
7812
|
function codeFrameColumns2(rawLines, loc, opts = {}) {
|
|
7789
7813
|
const highlighted = (opts.highlightCode || opts.forceColor) && (0, _highlight.shouldHighlight)(opts);
|
|
7790
|
-
const
|
|
7791
|
-
const defs = getDefs(
|
|
7814
|
+
const chalk3 = getChalk(opts.forceColor);
|
|
7815
|
+
const defs = getDefs(chalk3);
|
|
7792
7816
|
const maybeHighlight = (chalkFn, string) => {
|
|
7793
7817
|
return highlighted ? chalkFn(string) : string;
|
|
7794
7818
|
};
|
|
@@ -7827,7 +7851,7 @@ var require_lib3 = __commonJS({
|
|
|
7827
7851
|
${frame}`;
|
|
7828
7852
|
}
|
|
7829
7853
|
if (highlighted) {
|
|
7830
|
-
return
|
|
7854
|
+
return chalk3.reset(frame);
|
|
7831
7855
|
} else {
|
|
7832
7856
|
return frame;
|
|
7833
7857
|
}
|
|
@@ -21402,7 +21426,7 @@ function isNextLineEmpty2(text, startIndex) {
|
|
|
21402
21426
|
import * as doc from "./doc.mjs";
|
|
21403
21427
|
|
|
21404
21428
|
// src/main/version.evaluate.cjs
|
|
21405
|
-
var version_evaluate_default = "3.0.
|
|
21429
|
+
var version_evaluate_default = "3.0.2";
|
|
21406
21430
|
|
|
21407
21431
|
// src/index.js
|
|
21408
21432
|
function withPlugins(fn, optionsArgumentIndex = 1) {
|
package/internal/cli.mjs
CHANGED
|
@@ -5404,12 +5404,30 @@ var preserveCamelCase = (string, toLowerCase, toUpperCase, preserveConsecutiveUp
|
|
|
5404
5404
|
};
|
|
5405
5405
|
var preserveConsecutiveUppercase = (input, toLowerCase) => {
|
|
5406
5406
|
LEADING_CAPITAL.lastIndex = 0;
|
|
5407
|
-
return
|
|
5407
|
+
return string_replace_all_default(
|
|
5408
|
+
/* isOptionalObject*/
|
|
5409
|
+
false,
|
|
5410
|
+
input,
|
|
5411
|
+
LEADING_CAPITAL,
|
|
5412
|
+
(match) => toLowerCase(match)
|
|
5413
|
+
);
|
|
5408
5414
|
};
|
|
5409
5415
|
var postProcess = (input, toUpperCase) => {
|
|
5410
5416
|
SEPARATORS_AND_IDENTIFIER.lastIndex = 0;
|
|
5411
5417
|
NUMBERS_AND_IDENTIFIER.lastIndex = 0;
|
|
5412
|
-
return
|
|
5418
|
+
return string_replace_all_default(
|
|
5419
|
+
/* isOptionalObject*/
|
|
5420
|
+
false,
|
|
5421
|
+
string_replace_all_default(
|
|
5422
|
+
/* isOptionalObject*/
|
|
5423
|
+
false,
|
|
5424
|
+
input,
|
|
5425
|
+
NUMBERS_AND_IDENTIFIER,
|
|
5426
|
+
(match, pattern, offset) => ["_", "-"].includes(input.charAt(offset + match.length)) ? match : toUpperCase(match)
|
|
5427
|
+
),
|
|
5428
|
+
SEPARATORS_AND_IDENTIFIER,
|
|
5429
|
+
(_, identifier) => toUpperCase(identifier)
|
|
5430
|
+
);
|
|
5413
5431
|
};
|
|
5414
5432
|
function camelCase(input, options) {
|
|
5415
5433
|
if (!(typeof input === "string" || Array.isArray(input))) {
|
package/internal/internal.mjs
CHANGED
|
@@ -673,9 +673,9 @@ var require_lib = __commonJS({
|
|
|
673
673
|
}
|
|
674
674
|
});
|
|
675
675
|
|
|
676
|
-
// node_modules/@babel/
|
|
676
|
+
// node_modules/@babel/code-frame/node_modules/escape-string-regexp/index.js
|
|
677
677
|
var require_escape_string_regexp = __commonJS({
|
|
678
|
-
"node_modules/@babel/
|
|
678
|
+
"node_modules/@babel/code-frame/node_modules/escape-string-regexp/index.js"(exports, module) {
|
|
679
679
|
"use strict";
|
|
680
680
|
var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
|
|
681
681
|
module.exports = function(str) {
|
|
@@ -1829,9 +1829,9 @@ var require_ansi_styles = __commonJS({
|
|
|
1829
1829
|
}
|
|
1830
1830
|
});
|
|
1831
1831
|
|
|
1832
|
-
// node_modules/@babel/
|
|
1832
|
+
// node_modules/@babel/code-frame/node_modules/has-flag/index.js
|
|
1833
1833
|
var require_has_flag = __commonJS({
|
|
1834
|
-
"node_modules/@babel/
|
|
1834
|
+
"node_modules/@babel/code-frame/node_modules/has-flag/index.js"(exports, module) {
|
|
1835
1835
|
"use strict";
|
|
1836
1836
|
module.exports = (flag, argv) => {
|
|
1837
1837
|
argv = argv || process.argv;
|
|
@@ -1843,9 +1843,9 @@ var require_has_flag = __commonJS({
|
|
|
1843
1843
|
}
|
|
1844
1844
|
});
|
|
1845
1845
|
|
|
1846
|
-
// node_modules/@babel/
|
|
1846
|
+
// node_modules/@babel/code-frame/node_modules/supports-color/index.js
|
|
1847
1847
|
var require_supports_color = __commonJS({
|
|
1848
|
-
"node_modules/@babel/
|
|
1848
|
+
"node_modules/@babel/code-frame/node_modules/supports-color/index.js"(exports, module) {
|
|
1849
1849
|
"use strict";
|
|
1850
1850
|
var os = __require("os");
|
|
1851
1851
|
var hasFlag = require_has_flag();
|
|
@@ -1938,9 +1938,9 @@ var require_supports_color = __commonJS({
|
|
|
1938
1938
|
}
|
|
1939
1939
|
});
|
|
1940
1940
|
|
|
1941
|
-
// node_modules/@babel/
|
|
1941
|
+
// node_modules/@babel/code-frame/node_modules/chalk/templates.js
|
|
1942
1942
|
var require_templates = __commonJS({
|
|
1943
|
-
"node_modules/@babel/
|
|
1943
|
+
"node_modules/@babel/code-frame/node_modules/chalk/templates.js"(exports, module) {
|
|
1944
1944
|
"use strict";
|
|
1945
1945
|
var TEMPLATE_REGEX = /(?:\\(u[a-f\d]{4}|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi;
|
|
1946
1946
|
var STYLE_REGEX = /(?:^|\.)(\w+)(?:\(([^)]*)\))?/g;
|
|
@@ -2049,9 +2049,9 @@ var require_templates = __commonJS({
|
|
|
2049
2049
|
}
|
|
2050
2050
|
});
|
|
2051
2051
|
|
|
2052
|
-
// node_modules/@babel/
|
|
2052
|
+
// node_modules/@babel/code-frame/node_modules/chalk/index.js
|
|
2053
2053
|
var require_chalk = __commonJS({
|
|
2054
|
-
"node_modules/@babel/
|
|
2054
|
+
"node_modules/@babel/code-frame/node_modules/chalk/index.js"(exports, module) {
|
|
2055
2055
|
"use strict";
|
|
2056
2056
|
var escapeStringRegexp = require_escape_string_regexp();
|
|
2057
2057
|
var ansiStyles = require_ansi_styles();
|
|
@@ -2224,23 +2224,23 @@ var require_lib2 = __commonJS({
|
|
|
2224
2224
|
value: true
|
|
2225
2225
|
});
|
|
2226
2226
|
exports.default = highlight;
|
|
2227
|
-
exports.getChalk = getChalk;
|
|
2228
2227
|
exports.shouldHighlight = shouldHighlight;
|
|
2229
2228
|
var _jsTokens = require_js_tokens();
|
|
2230
2229
|
var _helperValidatorIdentifier = require_lib();
|
|
2231
|
-
var
|
|
2230
|
+
var _chalk2 = require_chalk();
|
|
2231
|
+
var chalk = _chalk2;
|
|
2232
2232
|
var sometimesKeywords = /* @__PURE__ */ new Set(["as", "async", "from", "get", "of", "set"]);
|
|
2233
|
-
function getDefs(
|
|
2233
|
+
function getDefs(chalk2) {
|
|
2234
2234
|
return {
|
|
2235
|
-
keyword:
|
|
2236
|
-
capitalized:
|
|
2237
|
-
jsxIdentifier:
|
|
2238
|
-
punctuator:
|
|
2239
|
-
number:
|
|
2240
|
-
string:
|
|
2241
|
-
regex:
|
|
2242
|
-
comment:
|
|
2243
|
-
invalid:
|
|
2235
|
+
keyword: chalk2.cyan,
|
|
2236
|
+
capitalized: chalk2.yellow,
|
|
2237
|
+
jsxIdentifier: chalk2.yellow,
|
|
2238
|
+
punctuator: chalk2.yellow,
|
|
2239
|
+
number: chalk2.magenta,
|
|
2240
|
+
string: chalk2.green,
|
|
2241
|
+
regex: chalk2.magenta,
|
|
2242
|
+
comment: chalk2.grey,
|
|
2243
|
+
invalid: chalk2.white.bgRed.bold
|
|
2244
2244
|
};
|
|
2245
2245
|
}
|
|
2246
2246
|
var NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
|
|
@@ -2295,18 +2295,28 @@ var require_lib2 = __commonJS({
|
|
|
2295
2295
|
return highlighted;
|
|
2296
2296
|
}
|
|
2297
2297
|
function shouldHighlight(options) {
|
|
2298
|
-
return !!
|
|
2298
|
+
return !!chalk.supportsColor || options.forceColor;
|
|
2299
|
+
}
|
|
2300
|
+
var chalkWithForcedColor = void 0;
|
|
2301
|
+
function getChalk(forceColor) {
|
|
2302
|
+
if (forceColor) {
|
|
2303
|
+
var _chalkWithForcedColor;
|
|
2304
|
+
(_chalkWithForcedColor = chalkWithForcedColor) != null ? _chalkWithForcedColor : chalkWithForcedColor = new chalk.constructor({
|
|
2305
|
+
enabled: true,
|
|
2306
|
+
level: 1
|
|
2307
|
+
});
|
|
2308
|
+
return chalkWithForcedColor;
|
|
2309
|
+
}
|
|
2310
|
+
return chalk;
|
|
2299
2311
|
}
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
}) : _chalk;
|
|
2312
|
+
{
|
|
2313
|
+
{
|
|
2314
|
+
exports.getChalk = (options) => getChalk(options.forceColor);
|
|
2315
|
+
}
|
|
2305
2316
|
}
|
|
2306
2317
|
function highlight(code, options = {}) {
|
|
2307
2318
|
if (code !== "" && shouldHighlight(options)) {
|
|
2308
|
-
const
|
|
2309
|
-
const defs = getDefs(chalk);
|
|
2319
|
+
const defs = getDefs(getChalk(options.forceColor));
|
|
2310
2320
|
return highlightTokens(defs, code);
|
|
2311
2321
|
} else {
|
|
2312
2322
|
return code;
|
|
@@ -2325,12 +2335,26 @@ var require_lib3 = __commonJS({
|
|
|
2325
2335
|
exports.codeFrameColumns = codeFrameColumns;
|
|
2326
2336
|
exports.default = _default;
|
|
2327
2337
|
var _highlight = require_lib2();
|
|
2338
|
+
var _chalk2 = require_chalk();
|
|
2339
|
+
var chalk = _chalk2;
|
|
2340
|
+
var chalkWithForcedColor = void 0;
|
|
2341
|
+
function getChalk(forceColor) {
|
|
2342
|
+
if (forceColor) {
|
|
2343
|
+
var _chalkWithForcedColor;
|
|
2344
|
+
(_chalkWithForcedColor = chalkWithForcedColor) != null ? _chalkWithForcedColor : chalkWithForcedColor = new chalk.constructor({
|
|
2345
|
+
enabled: true,
|
|
2346
|
+
level: 1
|
|
2347
|
+
});
|
|
2348
|
+
return chalkWithForcedColor;
|
|
2349
|
+
}
|
|
2350
|
+
return chalk;
|
|
2351
|
+
}
|
|
2328
2352
|
var deprecationWarningShown = false;
|
|
2329
|
-
function getDefs(
|
|
2353
|
+
function getDefs(chalk2) {
|
|
2330
2354
|
return {
|
|
2331
|
-
gutter:
|
|
2332
|
-
marker:
|
|
2333
|
-
message:
|
|
2355
|
+
gutter: chalk2.grey,
|
|
2356
|
+
marker: chalk2.red.bold,
|
|
2357
|
+
message: chalk2.red.bold
|
|
2334
2358
|
};
|
|
2335
2359
|
}
|
|
2336
2360
|
var NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
|
|
@@ -2392,8 +2416,8 @@ var require_lib3 = __commonJS({
|
|
|
2392
2416
|
}
|
|
2393
2417
|
function codeFrameColumns(rawLines, loc, opts = {}) {
|
|
2394
2418
|
const highlighted = (opts.highlightCode || opts.forceColor) && (0, _highlight.shouldHighlight)(opts);
|
|
2395
|
-
const
|
|
2396
|
-
const defs = getDefs(
|
|
2419
|
+
const chalk2 = getChalk(opts.forceColor);
|
|
2420
|
+
const defs = getDefs(chalk2);
|
|
2397
2421
|
const maybeHighlight = (chalkFn, string) => {
|
|
2398
2422
|
return highlighted ? chalkFn(string) : string;
|
|
2399
2423
|
};
|
|
@@ -2432,7 +2456,7 @@ var require_lib3 = __commonJS({
|
|
|
2432
2456
|
${frame}`;
|
|
2433
2457
|
}
|
|
2434
2458
|
if (highlighted) {
|
|
2435
|
-
return
|
|
2459
|
+
return chalk2.reset(frame);
|
|
2436
2460
|
} else {
|
|
2437
2461
|
return frame;
|
|
2438
2462
|
}
|