Skip to content

Commit

Permalink
Patch prettier#15514 into prettier version
Browse files Browse the repository at this point in the history
Summary:
Sync the latest version of https://github.com/pieterv/prettier/commits/hermes-v2-backport

- This includes prettier#15514 (prettier/prettier#15514)

Reviewed By: jbrown215

Differential Revision: D50662620

fbshipit-source-id: 1c189ed623acf68d509f0e9d74a92b5a5c73d654
  • Loading branch information
pieterv authored and facebook-github-bot committed Oct 25, 2023
1 parent 15b559d commit d730408
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2776,6 +2776,24 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
return true;
}
}
if (key === "expression") {
switch (node.name) {
case "await":
case "interface":
case "module":
case "using":
case "yield":
case "let":
case "type": {
const ancestorNeitherAsNorSatisfies = path.findAncestor(
(node2) => !isBinaryCastExpression(node2)
);
if (ancestorNeitherAsNorSatisfies !== parent && ancestorNeitherAsNorSatisfies.type === "ExpressionStatement") {
return true;
}
}
}
}
return false;
}
if (node.type === "ObjectExpression" || node.type === "FunctionExpression" || node.type === "ClassExpression" || node.type === "DoExpression") {
Expand Down

0 comments on commit d730408

Please sign in to comment.