From bab9b5b93a0ba19070b4507b66219f4c2ade46f8 Mon Sep 17 00:00:00 2001 From: Christopher Chedeau Date: Wed, 5 Apr 2017 13:28:02 -0700 Subject: [PATCH] Remove trailing spaces --- src/printer.js | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/printer.js b/src/printer.js index b0693c29..229c3637 100644 --- a/src/printer.js +++ b/src/printer.js @@ -655,7 +655,7 @@ function genericPrintNoParens(path, options, print) { var isTypeAnnotation = n.type === "ObjectTypeAnnotation"; var isTypeScriptTypeAnnotaion = n.type === "TSTypeLiteral"; // Leave this here because we *might* want to make this - // configurable later -- flow accepts ";" for type separators, + // configurable later -- flow accepts ";" for type separators, // typescript accepts ";" and newlines var separator = isTypeAnnotation ? "," : ","; var fields = []; @@ -1069,7 +1069,7 @@ function genericPrintNoParens(path, options, print) { case "ForOfStatement": case "ForAwaitStatement": - // Babylon 7 removed ForAwaitStatement in favor of ForOfStatement + // Babylon 7 removed ForAwaitStatement in favor of ForOfStatement // with `"await": true`: // https://github.com/estree/estree/pull/138 const isAwait = (n.type === "ForAwaitStatement" || n.await); @@ -1857,8 +1857,8 @@ function genericPrintNoParens(path, options, print) { return "void"; case "TSAsExpression": return concat([ - path.call(print, "expression"), - " as ", + path.call(print, "expression"), + " as ", path.call(print, "typeAnnotation"), ]) case "TSArrayType": @@ -1872,17 +1872,17 @@ function genericPrintNoParens(path, options, print) { return concat([path.call(print, "typeName")]); case "TSCallSignature": return concat([ - "(", - join(", ", path.map(print, "parameters")), + "(", + join(", ", path.map(print, "parameters")), "): ", - path.call(print, "typeAnnotation"), + path.call(print, "typeAnnotation"), ]); case "TSConstructSignature": return concat([ - "new (", - join(", ", path.map(print, "parameters")), + "new (", + join(", ", path.map(print, "parameters")), "): ", - path.call(print, "typeAnnotation"), + path.call(print, "typeAnnotation"), ]); case "TSTypeQuery": return concat(["typeof ", path.call(print, "exprName")]); @@ -1890,12 +1890,12 @@ function genericPrintNoParens(path, options, print) { return concat(["(", path.call(print, "typeAnnotation"), ")"]); case "TSIndexSignature": return concat([ - "[", + "[", // This should only contain a single element, however TypeScript parses // it using parseDelimitedList that uses commas as delimiter. - join(", ", path.map(print, "parameters")), + join(", ", path.map(print, "parameters")), "]: ", - path.call(print, "typeAnnotation"), + path.call(print, "typeAnnotation"), ]); // TODO case "ClassHeritage":