src/language-js/print/member.js/printMemberExpression
function printMemberExpression(path, options, print) {
  const n = path.getValue();

  const parent = path.getParentNode();
  let firstNonMemberParent;
  let i = 0;
  do {
    firstNonMemberParent = path.getParentNode(i);
    i++;
  } while (
    firstNonMemberParent &&
    (firstNonMemberParent.type === "MemberExpression" ||
      firstNonMemberParent.type === "OptionalMemberExpression" ||
      firstNonMemberParent.type === "TSNonNullExpression")
  );

  const shouldInline =
    (firstNonMemberParent &&
      (firstNonMemberParent.type === "NewExpression" ||
        firstNonMemberParent.type === "BindExpression" ||
        (firstNonMemberParent.type === "VariableDeclarator" &&
          firstNonMemberParent.id.type !== "Identifier") ||
        (firstNonMemberParent.type === "AssignmentExpression" &&
          firstNonMemberParent.left.type !== "Identifier"))) ||
    n.computed ||
    (n.object.type === "Identifier" &&
      n.property.type === "Identifier" &&
      parent.type !== "MemberExpression" &&
      parent.type !== "OptionalMemberExpression");

  return concat([
    path.call(print, "object"),
    shouldInline
      ? printMemberLookup(path, options, print)
      : group(
          indent(concat([softline, printMemberLookup(path, options, print)]))
        ),
  ]);
}