summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorKitson Kelly <me@kitsonkelly.com>2019-06-02 01:13:36 +1000
committerRyan Dahl <ry@tinyclouds.org>2019-06-01 11:13:36 -0400
commitd438a6d259f79d1dd98d50ada01debbe24ca5a29 (patch)
tree04484b78fa46915c25d23547b7beb9f544091a2e /js
parent79f770b178da2d74f10eaa5668b3c3521ab6bb59 (diff)
Upgrade TypeScript to 3.5.1 (#2437)
Diffstat (limited to 'js')
-rw-r--r--js/assets.ts8
-rw-r--r--js/compiler.ts1
-rw-r--r--js/console.ts3
-rwxr-xr-xjs/unit_test_runner.ts12
-rw-r--r--js/url.ts5
5 files changed, 22 insertions, 7 deletions
diff --git a/js/assets.ts b/js/assets.ts
index b3a6e00db..89ca7ac86 100644
--- a/js/assets.ts
+++ b/js/assets.ts
@@ -34,8 +34,12 @@ import libEs2018PromiseDts from "/third_party/node_modules/typescript/lib/lib.es
import libEs2018RegexpDts from "/third_party/node_modules/typescript/lib/lib.es2018.regexp.d.ts!string";
import libEs2019Dts from "/third_party/node_modules/typescript/lib/lib.es2019.d.ts!string";
import libEs2019ArrayDts from "/third_party/node_modules/typescript/lib/lib.es2019.array.d.ts!string";
+import libEs2019ObjectDts from "/third_party/node_modules/typescript/lib/lib.es2019.object.d.ts!string";
import libEs2019StringDts from "/third_party/node_modules/typescript/lib/lib.es2019.string.d.ts!string";
import libEs2019SymbolDts from "/third_party/node_modules/typescript/lib/lib.es2019.symbol.d.ts!string";
+import libEs2020Dts from "/third_party/node_modules/typescript/lib/lib.es2020.d.ts!string";
+import libEs2020String from "/third_party/node_modules/typescript/lib/lib.es2020.string.d.ts!string";
+import libEs2020SymbolWellknownDts from "/third_party/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts!string";
import libEs5Dts from "/third_party/node_modules/typescript/lib/lib.es5.d.ts!string";
import libEsnextArrayDts from "/third_party/node_modules/typescript/lib/lib.esnext.array.d.ts!string";
import libEsnextAsynciterablesDts from "/third_party/node_modules/typescript/lib/lib.esnext.asynciterable.d.ts!string";
@@ -71,8 +75,12 @@ const defaultAssets: { [key: string]: string } = {
"lib.es2018.regexp.d.ts": libEs2018RegexpDts,
"lib.es2019.d.ts": libEs2019Dts,
"lib.es2019.array.d.ts": libEs2019ArrayDts,
+ "lib.es2019.object.d.ts": libEs2019ObjectDts,
"lib.es2019.string.d.ts": libEs2019StringDts,
"lib.es2019.symbol.d.ts": libEs2019SymbolDts,
+ "lib.es2020.d.ts": libEs2020Dts,
+ "lib.es2020.string.d.ts": libEs2020String,
+ "lib.es2020.symbol.wellknown.d.ts": libEs2020SymbolWellknownDts,
"lib.es5.d.ts": libEs5Dts,
"lib.esnext.d.ts": libEsnextDts,
"lib.esnext.array.d.ts": libEsnextArrayDts,
diff --git a/js/compiler.ts b/js/compiler.ts
index 928fa09d8..fed592fa0 100644
--- a/js/compiler.ts
+++ b/js/compiler.ts
@@ -389,7 +389,6 @@ window.compilerMain = function compilerMain(): void {
.concat(emitResult.diagnostics)
.filter(
({ code }): boolean => {
- if (code === 2649) return false;
// TS2691: An import path cannot end with a '.ts' extension. Consider
// importing 'bad-module' instead.
if (code === 2691) return false;
diff --git a/js/console.ts b/js/console.ts
index 9b38e1b49..1a963558a 100644
--- a/js/console.ts
+++ b/js/console.ts
@@ -612,7 +612,8 @@ export class Console {
stringifyValue(value)
];
- let resultData: { [key: string]: unknown };
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ let resultData: any;
const isSet = data instanceof Set;
const isMap = data instanceof Map;
const valuesKey = "Values";
diff --git a/js/unit_test_runner.ts b/js/unit_test_runner.ts
index 7810e3f45..3a34df742 100755
--- a/js/unit_test_runner.ts
+++ b/js/unit_test_runner.ts
@@ -3,6 +3,12 @@
import "./unit_tests.ts";
import { permissionCombinations, parseUnitTestOutput } from "./test_util.ts";
+interface TestResult {
+ perms: string;
+ output: string;
+ result: number;
+}
+
function permsToCliFlags(perms: Deno.Permissions): string[] {
return Object.keys(perms)
.map(
@@ -39,7 +45,7 @@ async function main(): Promise<void> {
console.log("\t" + fmtPerms(perms));
}
- const testResults = new Set();
+ const testResults = new Set<TestResult>();
for (const perms of permissionCombinations.values()) {
const permsFmt = fmtPerms(perms);
@@ -84,10 +90,10 @@ async function main(): Promise<void> {
// run should fail
let testsFailed = false;
- for (const testResult of testResults.values()) {
+ for (const testResult of testResults) {
console.log(`Summary for ${testResult.perms}`);
console.log(testResult.output + "\n");
- testsFailed = testsFailed || testResult.result;
+ testsFailed = testsFailed || Boolean(testResult.result);
}
if (testsFailed) {
diff --git a/js/url.ts b/js/url.ts
index 5badaa6ea..8701f1930 100644
--- a/js/url.ts
+++ b/js/url.ts
@@ -71,12 +71,13 @@ export class URL {
const searchParams = new urlSearchParams.URLSearchParams(this.search);
for (const methodName of searchParamsMethods) {
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ /* eslint-disable @typescript-eslint/no-explicit-any */
const method: (...args: any[]) => any = searchParams[methodName];
- searchParams[methodName] = (...args: unknown[]): void => {
+ searchParams[methodName] = (...args: unknown[]): any => {
method.apply(searchParams, args);
this.search = searchParams.toString();
};
+ /* eslint-enable */
}
this._searchParams = searchParams;
}