From a9b05fee98400c2f86a5e2f31012a8de40b90f48 Mon Sep 17 00:00:00 2001 From: Klaus Meinhardt Date: Mon, 22 Oct 2018 18:48:37 +0200 Subject: [PATCH] update typescript to latest version --- .wotanrc.yaml | 2 ++ package.json | 2 +- rules/noUnnecessaryTypeAnnotationRule.ts | 4 ++-- yarn.lock | 8 ++++---- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.wotanrc.yaml b/.wotanrc.yaml index 1adf06f..e7e87ab 100644 --- a/.wotanrc.yaml +++ b/.wotanrc.yaml @@ -3,3 +3,5 @@ extends: - ./rules rules: tcc/no-unused: error + no-useless-assertion: off + no-useless-predicate: off diff --git a/package.json b/package.json index c37c888..5f6fec7 100644 --- a/package.json +++ b/package.json @@ -47,7 +47,7 @@ "nyc": "^12.0.1", "rimraf": "^2.6.2", "tslint": "^5.8.0", - "typescript": "2.9.1" + "typescript": "3.1.3" }, "peerDependencies": { "tslint": "^5.0.0", diff --git a/rules/noUnnecessaryTypeAnnotationRule.ts b/rules/noUnnecessaryTypeAnnotationRule.ts index fa3ecfd..6abd6c1 100644 --- a/rules/noUnnecessaryTypeAnnotationRule.ts +++ b/rules/noUnnecessaryTypeAnnotationRule.ts @@ -313,7 +313,7 @@ function removeSignatureReturn(str: string): string { return sourceFile.text.substring(7, signature.parameters.end + 1); } -function getSignaturesOfType(type: ts.Type): ts.Signature[] { +function getSignaturesOfType(type: ts.Type): ReadonlyArray { if (isUnionType(type)) { const signatures = []; for (const t of type.types) @@ -321,7 +321,7 @@ function getSignaturesOfType(type: ts.Type): ts.Signature[] { return signatures; } if (isIntersectionType(type)) { - let signatures: ts.Signature[] | undefined; + let signatures; for (const t of type.types) { const sig = getSignaturesOfType(t); if (sig.length !== 0) { diff --git a/yarn.lock b/yarn.lock index 6024030..0e8b4ab 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2628,10 +2628,10 @@ tweetnacl@^0.14.3, tweetnacl@~0.14.0: resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= -typescript@2.9.1: - version "2.9.1" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.9.1.tgz#fdb19d2c67a15d11995fd15640e373e09ab09961" - integrity sha512-h6pM2f/GDchCFlldnriOhs1QHuwbnmj6/v7499eMHqPeW4V2G0elua2eIc2nu8v2NdHV0Gm+tzX83Hr6nUFjQA== +typescript@3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.1.3.tgz#01b70247a6d3c2467f70c45795ef5ea18ce191d5" + integrity sha512-+81MUSyX+BaSo+u2RbozuQk/UWx6hfG0a5gHu4ANEM4sU96XbuIyAB+rWBW1u70c6a5QuZfuYICn3s2UjuHUpA== uglify-js@^2.6: version "2.8.29"