Support the Keyword type (#2056)

This is an issue in https://github.com/eslint/typescript-eslint-parser/issues/315

Fixes #2049
master
Christopher Chedeau 2017-06-08 09:25:28 -07:00 committed by GitHub
parent e9045e4bcf
commit 883e637fa9
3 changed files with 14 additions and 0 deletions

View File

@ -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"),

View File

@ -1,5 +1,14 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`keyword.tsx 1`] = `
<try />;
<object />
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
<try />;
<object />;
`;
exports[`not-react.ts 1`] = `
/// <reference types="node" />

View File

@ -0,0 +1,2 @@
<try />;
<object />