Enable TS strict mode by default (#3899)

Fixes #3324 

Co-authored-by: Kitson Kelly <me@kitsonkelly.com>
This commit is contained in:
Maximilien Mellen 2020-02-19 21:36:18 +01:00 committed by GitHub
parent 852823fa50
commit 90125566bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
56 changed files with 314 additions and 179 deletions

View file

@ -1,5 +1,5 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
import { test, assertEquals, assertNotEquals } from "./test_util.ts";
import { test, assertEquals, assert } from "./test_util.ts";
test(function eventInitializedWithType(): void {
const type = "click";
@ -70,7 +70,8 @@ test(function eventPreventDefaultSuccess(): void {
});
test(function eventInitializedWithNonStringType(): void {
const type = undefined;
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const type: any = undefined;
const event = new Event(type);
assertEquals(event.isTrusted, false);
@ -84,12 +85,12 @@ test(function eventInitializedWithNonStringType(): void {
// ref https://github.com/web-platform-tests/wpt/blob/master/dom/events/Event-isTrusted.any.js
test(function eventIsTrusted(): void {
const desc1 = Object.getOwnPropertyDescriptor(new Event("x"), "isTrusted");
assertNotEquals(desc1, undefined);
assert(desc1);
assertEquals(typeof desc1.get, "function");
const desc2 = Object.getOwnPropertyDescriptor(new Event("x"), "isTrusted");
assertNotEquals(desc2, undefined);
assertEquals(typeof desc2.get, "function");
assert(desc2);
assertEquals(typeof desc2!.get, "function");
assertEquals(desc1.get, desc2.get);
assertEquals(desc1!.get, desc2!.get);
});