prettier 2.8.0 → 2.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +3 -3
- package/esm/parser-babel.mjs +15 -15
- package/esm/parser-espree.mjs +14 -14
- package/esm/parser-flow.mjs +11 -11
- package/esm/parser-html.mjs +1 -1
- package/esm/parser-markdown.mjs +1 -1
- package/esm/parser-meriyah.mjs +5 -5
- package/esm/parser-postcss.mjs +16 -16
- package/esm/parser-typescript.mjs +38 -38
- package/esm/standalone.mjs +46 -46
- package/index.js +10 -6
- package/package.json +1 -1
- package/parser-babel.js +16 -16
- package/parser-espree.js +14 -14
- package/parser-flow.js +11 -11
- package/parser-html.js +1 -1
- package/parser-markdown.js +1 -1
- package/parser-meriyah.js +5 -5
- package/parser-postcss.js +27 -27
- package/parser-typescript.js +37 -37
- package/standalone.js +41 -41
package/index.js
CHANGED
|
@@ -27525,7 +27525,7 @@ var require_class = __commonJS2({
|
|
|
27525
27525
|
if (node.static) {
|
|
27526
27526
|
parts.push("static ");
|
|
27527
27527
|
}
|
|
27528
|
-
if (node.type === "TSAbstractPropertyDefinition" || node.abstract) {
|
|
27528
|
+
if (node.type === "TSAbstractPropertyDefinition" || node.type === "TSAbstractAccessorProperty" || node.abstract) {
|
|
27529
27529
|
parts.push("abstract ");
|
|
27530
27530
|
}
|
|
27531
27531
|
if (node.override) {
|
|
@@ -27537,7 +27537,7 @@ var require_class = __commonJS2({
|
|
|
27537
27537
|
if (node.variance) {
|
|
27538
27538
|
parts.push(print("variance"));
|
|
27539
27539
|
}
|
|
27540
|
-
if (node.type === "ClassAccessorProperty") {
|
|
27540
|
+
if (node.type === "ClassAccessorProperty" || node.type === "AccessorProperty" || node.type === "TSAbstractAccessorProperty") {
|
|
27541
27541
|
parts.push("accessor ");
|
|
27542
27542
|
}
|
|
27543
27543
|
parts.push(printPropertyKey(path, options, print), printOptionalToken(path), printDefiniteToken(path), printTypeAnnotation(path, options, print));
|
|
@@ -28555,10 +28555,12 @@ var require_statement = __commonJS2({
|
|
|
28555
28555
|
}
|
|
28556
28556
|
var isClassProperty = ({
|
|
28557
28557
|
type
|
|
28558
|
-
}) => type === "ClassProperty" || type === "PropertyDefinition" || type === "ClassPrivateProperty" || type === "ClassAccessorProperty";
|
|
28558
|
+
}) => type === "ClassProperty" || type === "PropertyDefinition" || type === "ClassPrivateProperty" || type === "ClassAccessorProperty" || type === "AccessorProperty" || type === "TSAbstractPropertyDefinition" || type === "TSAbstractAccessorProperty";
|
|
28559
28559
|
function shouldPrintSemicolonAfterClassProperty(node, nextNode) {
|
|
28560
|
-
const
|
|
28561
|
-
|
|
28560
|
+
const {
|
|
28561
|
+
name
|
|
28562
|
+
} = node.key;
|
|
28563
|
+
if ((name === "static" || name === "get" || name === "set" || name === "accessor") && !node.value && !node.typeAnnotation) {
|
|
28562
28564
|
return true;
|
|
28563
28565
|
}
|
|
28564
28566
|
if (!nextNode) {
|
|
@@ -28819,6 +28821,7 @@ var require_typescript = __commonJS2({
|
|
|
28819
28821
|
case "TSAbstractMethodDefinition":
|
|
28820
28822
|
case "TSDeclareMethod":
|
|
28821
28823
|
return printClassMethod(path, options, print);
|
|
28824
|
+
case "TSAbstractAccessorProperty":
|
|
28822
28825
|
case "TSAbstractPropertyDefinition":
|
|
28823
28826
|
return printClassProperty(path, options, print);
|
|
28824
28827
|
case "TSInterfaceHeritage":
|
|
@@ -29324,7 +29327,7 @@ var require_printer_estree = __commonJS2({
|
|
|
29324
29327
|
const {
|
|
29325
29328
|
type
|
|
29326
29329
|
} = node;
|
|
29327
|
-
if (type === "ClassMethod" || type === "ClassPrivateMethod" || type === "ClassProperty" || type === "ClassAccessorProperty" || type === "PropertyDefinition" || type === "TSAbstractPropertyDefinition" || type === "ClassPrivateProperty" || type === "MethodDefinition" || type === "TSAbstractMethodDefinition" || type === "TSDeclareMethod") {
|
|
29330
|
+
if (type === "ClassMethod" || type === "ClassPrivateMethod" || type === "ClassProperty" || type === "ClassAccessorProperty" || type === "AccessorProperty" || type === "TSAbstractAccessorProperty" || type === "PropertyDefinition" || type === "TSAbstractPropertyDefinition" || type === "ClassPrivateProperty" || type === "MethodDefinition" || type === "TSAbstractMethodDefinition" || type === "TSDeclareMethod") {
|
|
29328
29331
|
return printed;
|
|
29329
29332
|
}
|
|
29330
29333
|
let parts = [printed];
|
|
@@ -29696,6 +29699,7 @@ var require_printer_estree = __commonJS2({
|
|
|
29696
29699
|
case "PropertyDefinition":
|
|
29697
29700
|
case "ClassPrivateProperty":
|
|
29698
29701
|
case "ClassAccessorProperty":
|
|
29702
|
+
case "AccessorProperty":
|
|
29699
29703
|
return printClassProperty(path, options, print);
|
|
29700
29704
|
case "TemplateElement":
|
|
29701
29705
|
return replaceTextEndOfLine(node.value.raw);
|