From 5feb76f13f6bb7f184e2c889a7c53574ad0c0c09 Mon Sep 17 00:00:00 2001 From: James Henry Date: Thu, 14 Dec 2017 06:44:59 +0000 Subject: [PATCH] Update tsep to v11 and update snapshot (#3471) * Update tsep to v11 and update snapshot * Remove unneeded TSNamespaceFunctionDeclaration --- package.json | 2 +- src/fast-path.js | 1 - src/printer.js | 4 +--- tests/typescript/compiler/__snapshots__/jsfmt.spec.js.snap | 3 +-- yarn.lock | 6 +++--- 5 files changed, 6 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index 56810be1..93a14f2d 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,7 @@ "semver": "5.4.1", "string-width": "2.1.1", "typescript": "2.6.2", - "typescript-eslint-parser": "10.0.0", + "typescript-eslint-parser": "11.0.0", "unicode-regex": "1.0.1", "unified": "6.1.6" }, diff --git a/src/fast-path.js b/src/fast-path.js index e9006509..b5a0f7c0 100644 --- a/src/fast-path.js +++ b/src/fast-path.js @@ -661,7 +661,6 @@ function isStatement(node) { node.type === "TSInterfaceDeclaration" || node.type === "TSModuleDeclaration" || node.type === "TSNamespaceExportDeclaration" || - node.type === "TSNamespaceFunctionDeclaration" || node.type === "TypeAlias" || node.type === "VariableDeclaration" || node.type === "WhileStatement" || diff --git a/src/printer.js b/src/printer.js index 431eda7b..79d6a557 100644 --- a/src/printer.js +++ b/src/printer.js @@ -473,7 +473,6 @@ function genericPrintNoParens(path, options, print, args) { ]); case "FunctionDeclaration": case "FunctionExpression": - case "TSNamespaceFunctionDeclaration": if (isNodeStartingWithDeclare(n, options)) { parts.push("declare "); } @@ -3486,8 +3485,7 @@ function printExportDeclaration(path, options, print) { decl.type === "ExportDefaultDeclaration" && (decl.declaration.type !== "ClassDeclaration" && decl.declaration.type !== "FunctionDeclaration" && - decl.declaration.type !== "TSAbstractClassDeclaration" && - decl.declaration.type !== "TSNamespaceFunctionDeclaration") + decl.declaration.type !== "TSAbstractClassDeclaration") ) { parts.push(semi); } diff --git a/tests/typescript/compiler/__snapshots__/jsfmt.spec.js.snap b/tests/typescript/compiler/__snapshots__/jsfmt.spec.js.snap index 897b49b0..252ca4cf 100644 --- a/tests/typescript/compiler/__snapshots__/jsfmt.spec.js.snap +++ b/tests/typescript/compiler/__snapshots__/jsfmt.spec.js.snap @@ -201,8 +201,7 @@ exports[`commentInNamespaceDeclarationWithIdentifierPathName.ts 1`] = ` } ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ namespace hello.hi.world { - function foo() { - } + function foo() {} } `; diff --git a/yarn.lock b/yarn.lock index 923f1695..e0885e84 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4411,9 +4411,9 @@ typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" -typescript-eslint-parser@10.0.0: - version "10.0.0" - resolved "https://registry.yarnpkg.com/typescript-eslint-parser/-/typescript-eslint-parser-10.0.0.tgz#82b550253659c311c2e4a4d18311b94dd08a36d7" +typescript-eslint-parser@11.0.0: + version "11.0.0" + resolved "https://registry.yarnpkg.com/typescript-eslint-parser/-/typescript-eslint-parser-11.0.0.tgz#37dba6a0130dd307504aa4b4b21b0d3dc7d4e9f2" dependencies: lodash.unescape "4.0.1" semver "5.4.1"