Skip to content

Commit 98d27c7

Browse files
committed
Bump Prettier dependency to 1.19.0
1 parent e788e8d commit 98d27c7

12 files changed

Lines changed: 57 additions & 47 deletions

File tree

docs/rationale.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,11 @@ One final thing: TC39 has [not yet decided if decorators come before or after `e
132132

133133
```js
134134
@decorator
135-
export class Foo { }
135+
export class Foo {}
136136

137-
export @decorator class Foo { }
137+
export
138+
@decorator
139+
class Foo {}
138140
```
139141

140142
### Semicolons

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "prettier",
3-
"version": "1.19.0",
3+
"version": "1.20.0-dev",
44
"description": "Prettier is an opinionated code formatter",
55
"bin": {
66
"prettier": "./bin/prettier.js"
@@ -96,7 +96,7 @@
9696
"jest-snapshot-serializer-raw": "1.1.0",
9797
"jest-watch-typeahead": "0.4.0",
9898
"mkdirp": "0.5.1",
99-
"prettier": "1.18.2",
99+
"prettier": "1.19.0",
100100
"prettylint": "1.0.0",
101101
"rimraf": "3.0.0",
102102
"rollup": "1.26.3",

src/language-css/printer-postcss.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,8 @@ function genericPrint(path, options, print) {
593593
(isAdditionNode(iNode) || isSubtractionNode(iNode)) &&
594594
i === 0 &&
595595
(iNextNode.type === "value-number" || iNextNode.isHex) &&
596-
(parentParentNode && isColorAdjusterFuncNode(parentParentNode)) &&
596+
parentParentNode &&
597+
isColorAdjusterFuncNode(parentParentNode) &&
597598
!hasEmptyRawBefore(iNextNode);
598599

599600
const requireSpaceBeforeOperator =

src/language-html/printer-html.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,10 +207,10 @@ function genericPrint(path, options, print) {
207207
const shouldHugContent =
208208
node.children.length === 1 &&
209209
node.firstChild.type === "interpolation" &&
210-
(node.firstChild.isLeadingSpaceSensitive &&
211-
!node.firstChild.hasLeadingSpaces) &&
212-
(node.lastChild.isTrailingSpaceSensitive &&
213-
!node.lastChild.hasTrailingSpaces);
210+
node.firstChild.isLeadingSpaceSensitive &&
211+
!node.firstChild.hasLeadingSpaces &&
212+
node.lastChild.isTrailingSpaceSensitive &&
213+
!node.lastChild.hasTrailingSpaces;
214214
const attrGroupId = Symbol("element-attr-group-id");
215215
return concat([
216216
group(

src/language-html/utils.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,9 +276,9 @@ function forceBreakContent(node) {
276276
node.children.some(child => hasNonTextChild(child)))) ||
277277
(node.firstChild &&
278278
node.firstChild === node.lastChild &&
279-
(hasLeadingLineBreak(node.firstChild) &&
280-
(!node.lastChild.isTrailingSpaceSensitive ||
281-
hasTrailingLineBreak(node.lastChild))))
279+
hasLeadingLineBreak(node.firstChild) &&
280+
(!node.lastChild.isTrailingSpaceSensitive ||
281+
hasTrailingLineBreak(node.lastChild)))
282282
);
283283
}
284284

src/language-js/comments.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,8 @@ function handleClassComments(
428428
enclosingNode &&
429429
(enclosingNode.type === "ClassDeclaration" ||
430430
enclosingNode.type === "ClassExpression") &&
431-
(enclosingNode.decorators && enclosingNode.decorators.length > 0) &&
431+
enclosingNode.decorators &&
432+
enclosingNode.decorators.length > 0 &&
432433
!(followingNode && followingNode.type === "Decorator")
433434
) {
434435
if (!enclosingNode.decorators || enclosingNode.decorators.length === 0) {
@@ -573,8 +574,8 @@ function handleCommentInEmptyParens(text, enclosingNode, comment, options) {
573574
}
574575
if (
575576
enclosingNode &&
576-
(enclosingNode.type === "MethodDefinition" &&
577-
enclosingNode.value.params.length === 0)
577+
enclosingNode.type === "MethodDefinition" &&
578+
enclosingNode.value.params.length === 0
578579
) {
579580
addDanglingComment(enclosingNode.value, comment);
580581
return true;

src/language-js/embed.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,10 @@ function embed(path, print, textToDoc, options) {
161161
*/
162162
if (
163163
parentParent &&
164-
(parentParent.type === "TaggedTemplateExpression" &&
165-
parent.quasis.length === 1 &&
166-
(parentParent.tag.type === "Identifier" &&
167-
(parentParent.tag.name === "md" ||
168-
parentParent.tag.name === "markdown")))
164+
parentParent.type === "TaggedTemplateExpression" &&
165+
parent.quasis.length === 1 &&
166+
parentParent.tag.type === "Identifier" &&
167+
(parentParent.tag.name === "md" || parentParent.tag.name === "markdown")
169168
) {
170169
const text = parent.quasis[0].value.raw.replace(
171170
/((?:\\\\)*)\\`/g,

src/language-js/printer-estree.js

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -597,9 +597,9 @@ function printPathNoParens(path, options, print, args) {
597597
(n === parent.body && parent.type === "ArrowFunctionExpression") ||
598598
(n !== parent.body && parent.type === "ForStatement") ||
599599
(parent.type === "ConditionalExpression" &&
600-
(parentParent.type !== "ReturnStatement" &&
601-
parentParent.type !== "CallExpression" &&
602-
parentParent.type !== "OptionalCallExpression"));
600+
parentParent.type !== "ReturnStatement" &&
601+
parentParent.type !== "CallExpression" &&
602+
parentParent.type !== "OptionalCallExpression");
603603

604604
const shouldIndentIfInlining =
605605
parent.type === "AssignmentExpression" ||
@@ -3601,10 +3601,10 @@ function printPathNoParens(path, options, print, args) {
36013601
isNgForOf(n, index, parentNode) ||
36023602
(((index === 1 && (n.key.name === "then" || n.key.name === "else")) ||
36033603
(index === 2 &&
3604-
(n.key.name === "else" &&
3605-
parentNode.body[index - 1].type ===
3606-
"NGMicrosyntaxKeyedExpression" &&
3607-
parentNode.body[index - 1].key.name === "then"))) &&
3604+
n.key.name === "else" &&
3605+
parentNode.body[index - 1].type ===
3606+
"NGMicrosyntaxKeyedExpression" &&
3607+
parentNode.body[index - 1].key.name === "then")) &&
36083608
parentNode.body[0].type === "NGMicrosyntaxExpression");
36093609
return concat([
36103610
path.call(print, "key"),
@@ -4450,12 +4450,12 @@ function printExportDeclaration(path, options, print) {
44504450

44514451
if (
44524452
isDefault &&
4453-
(decl.declaration.type !== "ClassDeclaration" &&
4454-
decl.declaration.type !== "FunctionDeclaration" &&
4455-
decl.declaration.type !== "TSInterfaceDeclaration" &&
4456-
decl.declaration.type !== "DeclareClass" &&
4457-
decl.declaration.type !== "DeclareFunction" &&
4458-
decl.declaration.type !== "TSDeclareFunction")
4453+
decl.declaration.type !== "ClassDeclaration" &&
4454+
decl.declaration.type !== "FunctionDeclaration" &&
4455+
decl.declaration.type !== "TSInterfaceDeclaration" &&
4456+
decl.declaration.type !== "DeclareClass" &&
4457+
decl.declaration.type !== "DeclareFunction" &&
4458+
decl.declaration.type !== "TSDeclareFunction"
44594459
) {
44604460
parts.push(semi);
44614461
}
@@ -5140,7 +5140,7 @@ function separatorNoWhitespace(
51405140

51415141
if (
51425142
(childNode.type === "JSXElement" && !childNode.closingElement) ||
5143-
(nextNode && (nextNode.type === "JSXElement" && !nextNode.closingElement))
5143+
(nextNode && nextNode.type === "JSXElement" && !nextNode.closingElement)
51445144
) {
51455145
return child.length === 1 ? softline : hardline;
51465146
}

src/language-yaml/utils.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,13 @@ function getFlowScalarLineContents(nodeType, content, options) {
217217
index !== 0 &&
218218
rawLineContents[index - 1].length !== 0 &&
219219
lineContentWords.length !== 0 &&
220-
!// trailing backslash in quoteDouble should be preserved
221-
(nodeType === "quoteDouble" && getLast(getLast(reduced)).endsWith("\\"))
220+
!(
221+
// trailing backslash in quoteDouble should be preserved
222+
(
223+
nodeType === "quoteDouble" &&
224+
getLast(getLast(reduced)).endsWith("\\")
225+
)
226+
)
222227
? reduced.concat([reduced.pop().concat(lineContentWords)])
223228
: reduced.concat([lineContentWords]),
224229
[]

tests_integration/__tests__/infer-parser.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,11 @@ describe("--write and --list-different with unknown path and no parser", () => {
165165
});
166166

167167
describe("multiple files", () => {
168-
runPrettier("cli/infer-parser/", ["--list-different", "--write", "*"]).test(
169-
{ status: 0 }
170-
);
168+
runPrettier("cli/infer-parser/", [
169+
"--list-different",
170+
"--write",
171+
"*"
172+
]).test({ status: 0 });
171173
});
172174
});
173175

0 commit comments

Comments
 (0)