feat(typescript): support unknown type (#4625)

master
Ika 2018-06-10 00:12:30 +08:00 committed by GitHub
parent 3666411bd5
commit 98bfd03d93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 16 additions and 12 deletions

View File

@ -54,7 +54,7 @@
"resolve": "1.5.0",
"semver": "5.4.1",
"string-width": "2.1.1",
"typescript": "2.9.0-dev.20180421",
"typescript": "3.0.0-dev.20180602",
"typescript-eslint-parser": "16.0.0",
"unicode-regex": "1.0.1",
"unified": "6.1.6"

View File

@ -2834,6 +2834,8 @@ function printPathNoParens(path, options, print, args) {
return "string";
case "TSUndefinedKeyword":
return "undefined";
case "TSUnknownKeyword":
return "unknown";
case "TSVoidKeyword":
return "void";
case "TSAsExpression":

View File

@ -33,13 +33,6 @@ interface Q extends P {
`;
exports[`badArrayIndex.ts 1`] = `
var results = number[];
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
var results = number[];
`;
exports[`castOfAwait.ts 1`] = `
// @target: es6
async function f() {

View File

@ -1 +0,0 @@
var results = number[];

View File

@ -0,0 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`unknown.ts 1`] = `
type T00 = unknown;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
type T00 = unknown;
`;

View File

@ -0,0 +1 @@
run_spec(__dirname, ["typescript"]);

View File

@ -0,0 +1 @@
type T00 = unknown;

View File

@ -5563,9 +5563,9 @@ typescript-eslint-parser@16.0.0:
lodash.unescape "4.0.1"
semver "5.5.0"
typescript@2.9.0-dev.20180421:
version "2.9.0-dev.20180421"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.9.0-dev.20180421.tgz#b937b164ce73f833f2ed5c36571e238898b264ce"
typescript@3.0.0-dev.20180602:
version "3.0.0-dev.20180602"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.0.0-dev.20180602.tgz#ca368c199b4e3cbfd25b82ecece3f2b13349c893"
ua-parser-js@^0.7.9:
version "0.7.17"