diff --git a/src/printer.js b/src/printer.js index e8336fa57..e617415e5 100644 --- a/src/printer.js +++ b/src/printer.js @@ -1625,6 +1625,9 @@ function genericPrintNoParens(path, options, print, args) { requiresHardline ? hardline : "" ]); } + case "Keyword": { + return n.name; + } case "TypeAnnotatedIdentifier": return concat([ path.call(print, "annotation"), diff --git a/tests/typescript_tsx/__snapshots__/jsfmt.spec.js.snap b/tests/typescript_tsx/__snapshots__/jsfmt.spec.js.snap index dcb1db90b..7198f12e3 100644 --- a/tests/typescript_tsx/__snapshots__/jsfmt.spec.js.snap +++ b/tests/typescript_tsx/__snapshots__/jsfmt.spec.js.snap @@ -1,5 +1,14 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`keyword.tsx 1`] = ` +; + +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +; +; + +`; + exports[`not-react.ts 1`] = ` /// diff --git a/tests/typescript_tsx/keyword.tsx b/tests/typescript_tsx/keyword.tsx new file mode 100644 index 000000000..473b78f58 --- /dev/null +++ b/tests/typescript_tsx/keyword.tsx @@ -0,0 +1,2 @@ +; +