Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run 0.21.0 #876

Merged
merged 1 commit into from Mar 3, 2017
Merged

Run 0.21.0 #876

merged 1 commit into from Mar 3, 2017

Conversation

vjeux
Copy link
Contributor

@vjeux vjeux commented Mar 3, 2017

No description provided.

precedingNode.type === "ObjectTypeAnnotation" &&
followingNode &&
followingNode.type === "ObjectTypeAnnotation"
) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's interesting, if I put parenthesis around to group things, it works except for the first one.

function f() {
  if (
    (precedingNode &&
    precedingNode.type === "FunctionTypeParam") &&
    (enclosingNode &&
    enclosingNode.type === "FunctionTypeAnnotation") &&
    (followingNode &&
    followingNode.type !== "FunctionTypeParam")
  ) {
    addTrailingComment(precedingNode, comment);
    return true;
  }
}

outputs

function f() {
  if (
    precedingNode &&
    precedingNode.type === "FunctionTypeParam" &&
    (enclosingNode && enclosingNode.type === "FunctionTypeAnnotation") &&
    (followingNode && followingNode.type !== "FunctionTypeParam")
  ) {
    addTrailingComment(precedingNode, comment);
    return true;
  }
}

@@ -25,7 +25,7 @@ FastPath.from = function(obj) {
// lightweight FastPath [..., name, value] stacks.
var copy = Object.create(FastPath.prototype);
var stack = [obj.value];
for (var pp; pp = obj.parentPath; obj = pp)
for (var pp; (pp = obj.parentPath); obj = pp)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

@@ -58,7 +58,7 @@ function getSortedChildNodes(node, text, resultArray) {

if (!resultArray) {
Object.defineProperty(node, childNodesCacheKey, {
value: resultArray = [],
value: (resultArray = []),
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the original code was doing some "smart" things.

@vjeux vjeux merged commit be7b5ea into prettier:master Mar 3, 2017
@lock lock bot added the locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting. label Jan 21, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Jan 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
locked-due-to-inactivity Please open a new issue and fill out the template instead of commenting.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant