Support typescript 3.6 (#6519)

master
fisker Cheung 2019-10-03 20:24:03 +08:00 committed by Evilebot Tnawi
parent ce65fc236b
commit 3f13d2ec1b
6 changed files with 29 additions and 10 deletions

View File

@ -19,7 +19,7 @@
"@babel/parser": "7.2.0",
"@glimmer/syntax": "0.41.0",
"@iarna/toml": "2.2.3",
"@typescript-eslint/typescript-estree": "1.11.0",
"@typescript-eslint/typescript-estree": "1.13.0",
"angular-estree-parser": "1.1.5",
"angular-html-parser": "1.2.0",
"camelcase": "5.3.1",
@ -68,7 +68,7 @@
"resolve": "1.12.0",
"semver": "6.3.0",
"string-width": "3.1.0",
"typescript": "3.4.1",
"typescript": "3.6.3",
"unicode-regex": "3.0.0",
"unified": "6.1.6",
"vnopts": "1.0.2",
@ -129,7 +129,7 @@
"lint": "cross-env EFF_NO_LINK_RULES=true eslint . --format friendly",
"lint-docs": "prettylint {.,docs,website,website/blog}/*.md",
"lint-dist": "eslint --no-eslintrc --no-ignore --env=browser \"dist/!(bin-prettier|index|third-party).js\"",
"build": "node --max-old-space-size=2048 ./scripts/build/build.js",
"build": "node --max-old-space-size=3072 ./scripts/build/build.js",
"build-docs": "node ./scripts/build-docs.js",
"check-deps": "node ./scripts/check-deps.js"
}

View File

@ -42,6 +42,12 @@ const parsers = [
replace: {
// node v4 compatibility for @typescript-eslint/typescript-estree
"(!unique.includes(raw))": "(unique.indexOf(raw) === -1)"
},
commonjs: {
ignore: [
// Optional package for TypeScript that logs ETW events (a Windows-only technology).
"@microsoft/typescript-etw"
]
}
},
{

View File

@ -65,6 +65,15 @@ function clean(ast, newObj, parent) {
return newObj.typeAnnotation;
}
// (TypeScript) Bypass `& foo` and `| foo` into `foo`
// https://github.com/microsoft/TypeScript/issues/30995
if (
(ast.type === "TSIntersectionType" || ast.type === "TSUnionType") &&
ast.types.length === 1
) {
return newObj.types[0];
}
// We convert <div></div> to <div />
if (ast.type === "JSXOpeningElement") {
delete newObj.selfClosing;

View File

@ -469,6 +469,7 @@ printWidth: 80
class C { }
class D extends C { foo() { } }
var x: C;
var x: | C;
var x : C | D;
// A | B is equivalent to B | A.
@ -491,6 +492,7 @@ class D extends C {
foo() {}
}
var x: C;
var x: C;
var x: C | D;
// A | B is equivalent to B | A.

View File

@ -2,6 +2,7 @@
class C { }
class D extends C { foo() { } }
var x: C;
var x: | C;
var x : C | D;
// A | B is equivalent to B | A.

View File

@ -933,10 +933,10 @@
dependencies:
"@types/yargs-parser" "*"
"@typescript-eslint/typescript-estree@1.11.0":
version "1.11.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-1.11.0.tgz#b7b5782aab22e4b3b6d84633652c9f41e62d37d5"
integrity sha512-fquUHF5tAx1sM2OeRCC7wVxFd1iMELWMGCzOSmJ3pLzArj9+kRixdlC4d5MncuzXpjEqc6045p3KwM0o/3FuUA==
"@typescript-eslint/typescript-estree@1.13.0":
version "1.13.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-1.13.0.tgz#8140f17d0f60c03619798f1d628b8434913dc32e"
integrity sha512-b5rCmd2e6DCC6tCTN9GSUAuxdYwCM/k/2wdjHGrIRGPSJotWMCe/dGpi66u42bhuh8q3QBzqM4TMA1GUUCJvdw==
dependencies:
lodash.unescape "4.0.1"
semver "5.5.0"
@ -7184,9 +7184,10 @@ typedarray@^0.0.6:
version "0.0.6"
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
typescript@3.4.1:
version "3.4.1"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.4.1.tgz#b6691be11a881ffa9a05765a205cb7383f3b63c6"
typescript@3.6.3:
version "3.6.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.6.3.tgz#fea942fabb20f7e1ca7164ff626f1a9f3f70b4da"
integrity sha512-N7bceJL1CtRQ2RiG0AQME13ksR7DiuQh/QehubYcghzv20tnh+MQnQIuJddTmsbqYj+dztchykemz0zFzlvdQw==
uglify-js@^3.1.4:
version "3.6.0"