prettier 2.1.0 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bin-prettier.js CHANGED
@@ -58,7 +58,7 @@ var pleaseUpgradeNode = function pleaseUpgradeNode(pkg, opts) {
58
58
  };
59
59
 
60
60
  var name = "prettier";
61
- var version = "2.1.0";
61
+ var version = "2.1.1";
62
62
  var description = "Prettier is an opinionated code formatter";
63
63
  var bin = "./bin/prettier.js";
64
64
  var repository = "prettier/prettier";
@@ -78,12 +78,12 @@ var files = [
78
78
  "bin"
79
79
  ];
80
80
  var dependencies = {
81
- "@angular/compiler": "10.0.11",
81
+ "@angular/compiler": "10.0.12",
82
82
  "@babel/code-frame": "7.10.4",
83
83
  "@babel/parser": "7.11.2",
84
84
  "@glimmer/syntax": "0.59.0",
85
85
  "@iarna/toml": "2.2.5",
86
- "@typescript-eslint/typescript-estree": "3.9.1",
86
+ "@typescript-eslint/typescript-estree": "3.10.0",
87
87
  "angular-estree-parser": "2.2.0",
88
88
  "angular-html-parser": "1.7.1",
89
89
  camelcase: "6.0.0",
@@ -153,7 +153,7 @@ var devDependencies = {
153
153
  "@rollup/plugin-replace": "2.3.3",
154
154
  "@types/estree": "0.0.45",
155
155
  "@types/node": "14.6.0",
156
- "@typescript-eslint/types": "3.9.1",
156
+ "@typescript-eslint/types": "3.10.0",
157
157
  "babel-loader": "8.1.0",
158
158
  benchmark: "2.1.4",
159
159
  "builtin-modules": "3.1.0",
@@ -173,7 +173,7 @@ var devDependencies = {
173
173
  "jest-snapshot-serializer-raw": "1.1.0",
174
174
  "jest-watch-typeahead": "0.6.0",
175
175
  "npm-run-all": "4.1.5",
176
- prettier: "2.0.5",
176
+ prettier: "2.1.0",
177
177
  rimraf: "3.0.2",
178
178
  rollup: "2.26.5",
179
179
  "rollup-plugin-node-globals": "1.4.0",
@@ -201,7 +201,7 @@ var scripts = {
201
201
  "lint:typecheck": "tsc",
202
202
  "lint:eslint": "cross-env EFF_NO_LINK_RULES=true eslint . --format friendly",
203
203
  "lint:changelog": "node ./scripts/lint-changelog.js",
204
- "lint:prettier": "prettier \"**/*.{md,json,yml,html,css,js,d.ts}\" \"!test*\" --check",
204
+ "lint:prettier": "prettier . \"!test*\" --check",
205
205
  "lint:dist": "eslint --no-eslintrc --no-ignore --env=es6,browser --parser-options=ecmaVersion:2016 \"dist/!(bin-prettier|index|third-party).js\"",
206
206
  "lint:spellcheck": "cspell \"**/*\" \".github/**/*\"",
207
207
  "lint:deps": "node ./scripts/check-deps.js",
package/doc.js CHANGED
@@ -1120,7 +1120,7 @@
1120
1120
  }, value));
1121
1121
 
1122
1122
  var name = "prettier";
1123
- var version$1 = "2.1.0";
1123
+ var version$1 = "2.1.1";
1124
1124
  var description = "Prettier is an opinionated code formatter";
1125
1125
  var bin = "./bin/prettier.js";
1126
1126
  var repository = "prettier/prettier";
@@ -1140,12 +1140,12 @@
1140
1140
  "bin"
1141
1141
  ];
1142
1142
  var dependencies = {
1143
- "@angular/compiler": "10.0.11",
1143
+ "@angular/compiler": "10.0.12",
1144
1144
  "@babel/code-frame": "7.10.4",
1145
1145
  "@babel/parser": "7.11.2",
1146
1146
  "@glimmer/syntax": "0.59.0",
1147
1147
  "@iarna/toml": "2.2.5",
1148
- "@typescript-eslint/typescript-estree": "3.9.1",
1148
+ "@typescript-eslint/typescript-estree": "3.10.0",
1149
1149
  "angular-estree-parser": "2.2.0",
1150
1150
  "angular-html-parser": "1.7.1",
1151
1151
  camelcase: "6.0.0",
@@ -1215,7 +1215,7 @@
1215
1215
  "@rollup/plugin-replace": "2.3.3",
1216
1216
  "@types/estree": "0.0.45",
1217
1217
  "@types/node": "14.6.0",
1218
- "@typescript-eslint/types": "3.9.1",
1218
+ "@typescript-eslint/types": "3.10.0",
1219
1219
  "babel-loader": "8.1.0",
1220
1220
  benchmark: "2.1.4",
1221
1221
  "builtin-modules": "3.1.0",
@@ -1235,7 +1235,7 @@
1235
1235
  "jest-snapshot-serializer-raw": "1.1.0",
1236
1236
  "jest-watch-typeahead": "0.6.0",
1237
1237
  "npm-run-all": "4.1.5",
1238
- prettier: "2.0.5",
1238
+ prettier: "2.1.0",
1239
1239
  rimraf: "3.0.2",
1240
1240
  rollup: "2.26.5",
1241
1241
  "rollup-plugin-node-globals": "1.4.0",
@@ -1263,7 +1263,7 @@
1263
1263
  "lint:typecheck": "tsc",
1264
1264
  "lint:eslint": "cross-env EFF_NO_LINK_RULES=true eslint . --format friendly",
1265
1265
  "lint:changelog": "node ./scripts/lint-changelog.js",
1266
- "lint:prettier": "prettier \"**/*.{md,json,yml,html,css,js,d.ts}\" \"!test*\" --check",
1266
+ "lint:prettier": "prettier . \"!test*\" --check",
1267
1267
  "lint:dist": "eslint --no-eslintrc --no-ignore --env=es6,browser --parser-options=ecmaVersion:2016 \"dist/!(bin-prettier|index|third-party).js\"",
1268
1268
  "lint:spellcheck": "cspell \"**/*\" \".github/**/*\"",
1269
1269
  "lint:deps": "node ./scripts/check-deps.js",
package/index.js CHANGED
@@ -21,7 +21,7 @@ var stream__default = /*#__PURE__*/_interopDefaultLegacy(stream$6);
21
21
  var events__default = /*#__PURE__*/_interopDefaultLegacy(events$1);
22
22
 
23
23
  var name = "prettier";
24
- var version = "2.1.0";
24
+ var version = "2.1.1";
25
25
  var description = "Prettier is an opinionated code formatter";
26
26
  var bin = "./bin/prettier.js";
27
27
  var repository = "prettier/prettier";
@@ -41,12 +41,12 @@ var files = [
41
41
  "bin"
42
42
  ];
43
43
  var dependencies = {
44
- "@angular/compiler": "10.0.11",
44
+ "@angular/compiler": "10.0.12",
45
45
  "@babel/code-frame": "7.10.4",
46
46
  "@babel/parser": "7.11.2",
47
47
  "@glimmer/syntax": "0.59.0",
48
48
  "@iarna/toml": "2.2.5",
49
- "@typescript-eslint/typescript-estree": "3.9.1",
49
+ "@typescript-eslint/typescript-estree": "3.10.0",
50
50
  "angular-estree-parser": "2.2.0",
51
51
  "angular-html-parser": "1.7.1",
52
52
  camelcase: "6.0.0",
@@ -116,7 +116,7 @@ var devDependencies = {
116
116
  "@rollup/plugin-replace": "2.3.3",
117
117
  "@types/estree": "0.0.45",
118
118
  "@types/node": "14.6.0",
119
- "@typescript-eslint/types": "3.9.1",
119
+ "@typescript-eslint/types": "3.10.0",
120
120
  "babel-loader": "8.1.0",
121
121
  benchmark: "2.1.4",
122
122
  "builtin-modules": "3.1.0",
@@ -136,7 +136,7 @@ var devDependencies = {
136
136
  "jest-snapshot-serializer-raw": "1.1.0",
137
137
  "jest-watch-typeahead": "0.6.0",
138
138
  "npm-run-all": "4.1.5",
139
- prettier: "2.0.5",
139
+ prettier: "2.1.0",
140
140
  rimraf: "3.0.2",
141
141
  rollup: "2.26.5",
142
142
  "rollup-plugin-node-globals": "1.4.0",
@@ -164,7 +164,7 @@ var scripts = {
164
164
  "lint:typecheck": "tsc",
165
165
  "lint:eslint": "cross-env EFF_NO_LINK_RULES=true eslint . --format friendly",
166
166
  "lint:changelog": "node ./scripts/lint-changelog.js",
167
- "lint:prettier": "prettier \"**/*.{md,json,yml,html,css,js,d.ts}\" \"!test*\" --check",
167
+ "lint:prettier": "prettier . \"!test*\" --check",
168
168
  "lint:dist": "eslint --no-eslintrc --no-ignore --env=es6,browser --parser-options=ecmaVersion:2016 \"dist/!(bin-prettier|index|third-party).js\"",
169
169
  "lint:spellcheck": "cspell \"**/*\" \".github/**/*\"",
170
170
  "lint:deps": "node ./scripts/check-deps.js",
@@ -40665,8 +40665,14 @@ function needsParens(path, options) {
40665
40665
 
40666
40666
  // fallthrough
40667
40667
 
40668
- case "TSTypeOperator":
40669
40668
  case "TSInferType":
40669
+ if (node.type === "TSInferType" && parent.type === "TSRestType") {
40670
+ return false;
40671
+ }
40672
+
40673
+ // fallthrough
40674
+
40675
+ case "TSTypeOperator":
40670
40676
  return parent.type === "TSArrayType" || parent.type === "TSOptionalType" || parent.type === "TSRestType" || parent.type === "TSIndexedAccessType" && node === parent.objectType || parent.type === "TSTypeOperator" || parent.type === "TSTypeAnnotation" && /^TSJSDoc/.test(path.getParentNode(1).type);
40671
40677
 
40672
40678
  case "ArrayTypeAnnotation":
@@ -51617,7 +51623,7 @@ function inferStyleParser(node) {
51617
51623
  lang
51618
51624
  } = node.attrMap;
51619
51625
 
51620
- if (lang === "postcss" || lang === "css") {
51626
+ if (!lang || lang === "postcss" || lang === "css") {
51621
51627
  return "css";
51622
51628
  }
51623
51629
 
@@ -51640,11 +51646,11 @@ function inferScriptParser(node, options) {
51640
51646
  }
51641
51647
 
51642
51648
  if (node.name === "style") {
51643
- return inferStyleParser(node) || "css";
51649
+ return inferStyleParser(node);
51644
51650
  }
51645
51651
 
51646
51652
  if (options && isVueNonHtmlBlock(node, options)) {
51647
- return _inferScriptParser(node) || inferStyleParser(node) || getParserName$2(node.attrMap.lang, options);
51653
+ return _inferScriptParser(node) || !("src" in node.attrMap) && getParserName$2(node.attrMap.lang, options);
51648
51654
  }
51649
51655
  }
51650
51656
 
@@ -52807,19 +52813,27 @@ function embed$4(path, print, textToDoc, options) {
52807
52813
  return;
52808
52814
  }
52809
52815
 
52810
- if (isVueNonHtmlBlock$1(node, options)) {
52816
+ if (!node.isSelfClosing && isVueNonHtmlBlock$1(node, options)) {
52811
52817
  const parser = inferScriptParser$1(node, options);
52812
52818
 
52813
52819
  if (!parser) {
52814
52820
  return;
52815
52821
  }
52816
52822
 
52817
- const doc = textToDoc(htmlTrimPreserveIndentation$1(getNodeContent(node, options)), {
52818
- parser
52819
- }, {
52820
- stripTrailingHardline: true
52821
- });
52822
- return concat$m([printOpeningTagPrefix(node, options), group$k(printOpeningTag(path, options, print)), hardline$f, doc, hardline$f, printClosingTag(node, options), printClosingTagSuffix(node, options)]);
52823
+ const content = getNodeContent(node, options);
52824
+ let isEmpty = /^\s*$/.test(content);
52825
+ let doc = "";
52826
+
52827
+ if (!isEmpty) {
52828
+ doc = textToDoc(htmlTrimPreserveIndentation$1(content), {
52829
+ parser
52830
+ }, {
52831
+ stripTrailingHardline: true
52832
+ });
52833
+ isEmpty = doc === "";
52834
+ }
52835
+
52836
+ return concat$m([printOpeningTagPrefix(node, options), group$k(printOpeningTag(path, options, print)), isEmpty ? "" : hardline$f, doc, isEmpty ? "" : hardline$f, printClosingTag(node, options), printClosingTagSuffix(node, options)]);
52823
52837
  }
52824
52838
 
52825
52839
  break;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "prettier",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "description": "Prettier is an opinionated code formatter",
5
5
  "bin": "./bin-prettier.js",
6
6
  "repository": "prettier/prettier",