Bump Prettier dependency to 1.19.0
This commit is contained in:
1 parent
e788e8d3d5
commit
98d27c7de2
12 files changed
+57
-47
No files matched your search
+4
-2
@@ -132,9 +132,11 @@ One final thing: TC39 has [not yet decided if decorators come before or after `e
|
||||
|
||||
```js
|
||||
@decorator
|
||||
export class Foo { }
|
||||
export class Foo {}
|
||||
|
||||
export @decorator class Foo { }
|
||||
export
|
||||
@decorator
|
||||
class Foo {}
|
||||
```
|
||||
|
||||
### Semicolons
|
||||
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "prettier",
|
||||
"version": "1.19.0",
|
||||
"version": "1.20.0-dev",
|
||||
"description": "Prettier is an opinionated code formatter",
|
||||
"bin": {
|
||||
"prettier": "./bin/prettier.js"
|
||||
@@ -96,7 +96,7 @@
|
||||
"jest-snapshot-serializer-raw": "1.1.0",
|
||||
"jest-watch-typeahead": "0.4.0",
|
||||
"mkdirp": "0.5.1",
|
||||
"prettier": "1.18.2",
|
||||
"prettier": "1.19.0",
|
||||
"prettylint": "1.0.0",
|
||||
"rimraf": "3.0.0",
|
||||
"rollup": "1.26.3",
|
||||
|
||||
@@ -593,7 +593,8 @@ function genericPrint(path, options, print) {
|
||||
(isAdditionNode(iNode) || isSubtractionNode(iNode)) &&
|
||||
i === 0 &&
|
||||
(iNextNode.type === "value-number" || iNextNode.isHex) &&
|
||||
(parentParentNode && isColorAdjusterFuncNode(parentParentNode)) &&
|
||||
parentParentNode &&
|
||||
isColorAdjusterFuncNode(parentParentNode) &&
|
||||
!hasEmptyRawBefore(iNextNode);
|
||||
|
||||
const requireSpaceBeforeOperator =
|
||||
|
||||
@@ -207,10 +207,10 @@ function genericPrint(path, options, print) {
|
||||
const shouldHugContent =
|
||||
node.children.length === 1 &&
|
||||
node.firstChild.type === "interpolation" &&
|
||||
(node.firstChild.isLeadingSpaceSensitive &&
|
||||
!node.firstChild.hasLeadingSpaces) &&
|
||||
(node.lastChild.isTrailingSpaceSensitive &&
|
||||
!node.lastChild.hasTrailingSpaces);
|
||||
node.firstChild.isLeadingSpaceSensitive &&
|
||||
!node.firstChild.hasLeadingSpaces &&
|
||||
node.lastChild.isTrailingSpaceSensitive &&
|
||||
!node.lastChild.hasTrailingSpaces;
|
||||
const attrGroupId = Symbol("element-attr-group-id");
|
||||
return concat([
|
||||
group(
|
||||
|
||||
@@ -276,9 +276,9 @@ function forceBreakContent(node) {
|
||||
node.children.some(child => hasNonTextChild(child)))) ||
|
||||
(node.firstChild &&
|
||||
node.firstChild === node.lastChild &&
|
||||
(hasLeadingLineBreak(node.firstChild) &&
|
||||
(!node.lastChild.isTrailingSpaceSensitive ||
|
||||
hasTrailingLineBreak(node.lastChild))))
|
||||
hasLeadingLineBreak(node.firstChild) &&
|
||||
(!node.lastChild.isTrailingSpaceSensitive ||
|
||||
hasTrailingLineBreak(node.lastChild)))
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -428,7 +428,8 @@ function handleClassComments(
|
||||
enclosingNode &&
|
||||
(enclosingNode.type === "ClassDeclaration" ||
|
||||
enclosingNode.type === "ClassExpression") &&
|
||||
(enclosingNode.decorators && enclosingNode.decorators.length > 0) &&
|
||||
enclosingNode.decorators &&
|
||||
enclosingNode.decorators.length > 0 &&
|
||||
!(followingNode && followingNode.type === "Decorator")
|
||||
) {
|
||||
if (!enclosingNode.decorators || enclosingNode.decorators.length === 0) {
|
||||
@@ -573,8 +574,8 @@ function handleCommentInEmptyParens(text, enclosingNode, comment, options) {
|
||||
}
|
||||
if (
|
||||
enclosingNode &&
|
||||
(enclosingNode.type === "MethodDefinition" &&
|
||||
enclosingNode.value.params.length === 0)
|
||||
enclosingNode.type === "MethodDefinition" &&
|
||||
enclosingNode.value.params.length === 0
|
||||
) {
|
||||
addDanglingComment(enclosingNode.value, comment);
|
||||
return true;
|
||||
|
||||
@@ -161,11 +161,10 @@ function embed(path, print, textToDoc, options) {
|
||||
*/
|
||||
if (
|
||||
parentParent &&
|
||||
(parentParent.type === "TaggedTemplateExpression" &&
|
||||
parent.quasis.length === 1 &&
|
||||
(parentParent.tag.type === "Identifier" &&
|
||||
(parentParent.tag.name === "md" ||
|
||||
parentParent.tag.name === "markdown")))
|
||||
parentParent.type === "TaggedTemplateExpression" &&
|
||||
parent.quasis.length === 1 &&
|
||||
parentParent.tag.type === "Identifier" &&
|
||||
(parentParent.tag.name === "md" || parentParent.tag.name === "markdown")
|
||||
) {
|
||||
const text = parent.quasis[0].value.raw.replace(
|
||||
/((?:\\\\)*)\\`/g,
|
||||
|
||||
@@ -597,9 +597,9 @@ function printPathNoParens(path, options, print, args) {
|
||||
(n === parent.body && parent.type === "ArrowFunctionExpression") ||
|
||||
(n !== parent.body && parent.type === "ForStatement") ||
|
||||
(parent.type === "ConditionalExpression" &&
|
||||
(parentParent.type !== "ReturnStatement" &&
|
||||
parentParent.type !== "CallExpression" &&
|
||||
parentParent.type !== "OptionalCallExpression"));
|
||||
parentParent.type !== "ReturnStatement" &&
|
||||
parentParent.type !== "CallExpression" &&
|
||||
parentParent.type !== "OptionalCallExpression");
|
||||
|
||||
const shouldIndentIfInlining =
|
||||
parent.type === "AssignmentExpression" ||
|
||||
@@ -3601,10 +3601,10 @@ function printPathNoParens(path, options, print, args) {
|
||||
isNgForOf(n, index, parentNode) ||
|
||||
(((index === 1 && (n.key.name === "then" || n.key.name === "else")) ||
|
||||
(index === 2 &&
|
||||
(n.key.name === "else" &&
|
||||
parentNode.body[index - 1].type ===
|
||||
"NGMicrosyntaxKeyedExpression" &&
|
||||
parentNode.body[index - 1].key.name === "then"))) &&
|
||||
n.key.name === "else" &&
|
||||
parentNode.body[index - 1].type ===
|
||||
"NGMicrosyntaxKeyedExpression" &&
|
||||
parentNode.body[index - 1].key.name === "then")) &&
|
||||
parentNode.body[0].type === "NGMicrosyntaxExpression");
|
||||
return concat([
|
||||
path.call(print, "key"),
|
||||
@@ -4450,12 +4450,12 @@ function printExportDeclaration(path, options, print) {
|
||||
|
||||
if (
|
||||
isDefault &&
|
||||
(decl.declaration.type !== "ClassDeclaration" &&
|
||||
decl.declaration.type !== "FunctionDeclaration" &&
|
||||
decl.declaration.type !== "TSInterfaceDeclaration" &&
|
||||
decl.declaration.type !== "DeclareClass" &&
|
||||
decl.declaration.type !== "DeclareFunction" &&
|
||||
decl.declaration.type !== "TSDeclareFunction")
|
||||
decl.declaration.type !== "ClassDeclaration" &&
|
||||
decl.declaration.type !== "FunctionDeclaration" &&
|
||||
decl.declaration.type !== "TSInterfaceDeclaration" &&
|
||||
decl.declaration.type !== "DeclareClass" &&
|
||||
decl.declaration.type !== "DeclareFunction" &&
|
||||
decl.declaration.type !== "TSDeclareFunction"
|
||||
) {
|
||||
parts.push(semi);
|
||||
}
|
||||
@@ -5140,7 +5140,7 @@ function separatorNoWhitespace(
|
||||
|
||||
if (
|
||||
(childNode.type === "JSXElement" && !childNode.closingElement) ||
|
||||
(nextNode && (nextNode.type === "JSXElement" && !nextNode.closingElement))
|
||||
(nextNode && nextNode.type === "JSXElement" && !nextNode.closingElement)
|
||||
) {
|
||||
return child.length === 1 ? softline : hardline;
|
||||
}
|
||||
|
||||
@@ -217,8 +217,13 @@ function getFlowScalarLineContents(nodeType, content, options) {
|
||||
index !== 0 &&
|
||||
rawLineContents[index - 1].length !== 0 &&
|
||||
lineContentWords.length !== 0 &&
|
||||
!// trailing backslash in quoteDouble should be preserved
|
||||
(nodeType === "quoteDouble" && getLast(getLast(reduced)).endsWith("\\"))
|
||||
!(
|
||||
// trailing backslash in quoteDouble should be preserved
|
||||
(
|
||||
nodeType === "quoteDouble" &&
|
||||
getLast(getLast(reduced)).endsWith("\\")
|
||||
)
|
||||
)
|
||||
? reduced.concat([reduced.pop().concat(lineContentWords)])
|
||||
: reduced.concat([lineContentWords]),
|
||||
[]
|
||||
|
||||
@@ -165,9 +165,11 @@ describe("--write and --list-different with unknown path and no parser", () => {
|
||||
});
|
||||
|
||||
describe("multiple files", () => {
|
||||
runPrettier("cli/infer-parser/", ["--list-different", "--write", "*"]).test(
|
||||
{ status: 0 }
|
||||
);
|
||||
runPrettier("cli/infer-parser/", [
|
||||
"--list-different",
|
||||
"--write",
|
||||
"*"
|
||||
]).test({ status: 0 });
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -468,10 +468,10 @@ In 1.0, we made class be inline inside of arrow functions. It turns out that it
|
||||
|
||||
```js
|
||||
// Before
|
||||
export default (ViewComponent: Function, ContainerComponent: Function) => class
|
||||
extends React.Component {
|
||||
static propTypes = {};
|
||||
};
|
||||
export default (ViewComponent: Function, ContainerComponent: Function) =>
|
||||
class extends React.Component {
|
||||
static propTypes = {};
|
||||
};
|
||||
|
||||
// After
|
||||
export default (ViewComponent: Function, ContainerComponent: Function) =>
|
||||
|
||||
@@ -5479,10 +5479,10 @@ prettier-linter-helpers@^1.0.0:
|
||||
dependencies:
|
||||
fast-diff "^1.1.2"
|
||||
|
||||
prettier@1.18.2:
|
||||
version "1.18.2"
|
||||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.18.2.tgz#6823e7c5900017b4bd3acf46fe9ac4b4d7bda9ea"
|
||||
integrity sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw==
|
||||
prettier@1.19.0:
|
||||
version "1.19.0"
|
||||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.0.tgz#3bec4489d5eebcd52b95ddd2c22467b5c852fde1"
|
||||
integrity sha512-GlAIjk6DjkNT6u/Bw5QCWrbzh9YlLKwwmJT//1YiCR3WDpZDnyss64aXHQZgF8VKeGlWnX6+tGsKSVxsZT/gtA==
|
||||
|
||||
pretty-format@^23.0.1, pretty-format@^23.2.0:
|
||||
version "23.2.0"
|
||||
|
||||
Reference in new issue
Block a user