diff --git a/types/bricks.js/bricks.js-tests.ts b/types/bricks.js/bricks.js-tests.ts index b916e97aca..dbef221df0 100644 --- a/types/bricks.js/bricks.js-tests.ts +++ b/types/bricks.js/bricks.js-tests.ts @@ -1,7 +1,7 @@ import Bricks from 'bricks.js'; const bricks = Bricks({ - container: document.body!.firstChild!, + container: document.body.firstChild!, packed: 'packed', sizes: [ { columns: 2, gutter: 10 }, diff --git a/types/clipboard-js/clipboard-js-tests.ts b/types/clipboard-js/clipboard-js-tests.ts index bcc576b7c9..ef1bfbdf5d 100644 --- a/types/clipboard-js/clipboard-js-tests.ts +++ b/types/clipboard-js/clipboard-js-tests.ts @@ -1,4 +1,4 @@ clipboard.copy("Hello World"); -clipboard.copy(document.body!).then(() => console.log("success")); +clipboard.copy(document.body).then(() => console.log("success")); clipboard.paste().then(val => console.log(val)); diff --git a/types/d3-dispatch/d3-dispatch-tests.ts b/types/d3-dispatch/d3-dispatch-tests.ts index b4f44ad4d2..4e8d2cfb31 100644 --- a/types/d3-dispatch/d3-dispatch-tests.ts +++ b/types/d3-dispatch/d3-dispatch-tests.ts @@ -47,12 +47,12 @@ undef = dispatch.on('unknown') as undefined; dispatch.on('bar', dispatch.on('bar')!); dispatch.call('foo'); -dispatch.call('foo', document.body!); -dispatch.call('foo', document.body!, { a: 3, b: 'test' }, 1); +dispatch.call('foo', document.body); +dispatch.call('foo', document.body, { a: 3, b: 'test' }, 1); dispatch.apply('bar'); -dispatch.apply('bar', document.body!); -dispatch.apply('bar', document.body!, [{ a: 3, b: 'test' }, 1]); +dispatch.apply('bar', document.body); +dispatch.apply('bar', document.body, [{ a: 3, b: 'test' }, 1]); dispatch.on('bar', null); diff --git a/types/deku/deku-tests.ts b/types/deku/deku-tests.ts index d0467adead..d123c7b8f7 100644 --- a/types/deku/deku-tests.ts +++ b/types/deku/deku-tests.ts @@ -24,7 +24,7 @@ }) } - let render = createApp(document.body!) + let render = createApp(document.body) function main(state: any){ let vnode = view(state, (action: any) => main({ count: 0 })) @@ -43,7 +43,7 @@ return element('div', { class: `size-${ props.size }` }) } - const render = createApp(document.body!) + const render = createApp(document.body) render(element(App, { size: 'small' })) @@ -82,11 +82,11 @@ (function (){ const { createApp, element } = deku - let render: Function = createApp(document.body!) + let render: Function = createApp(document.body) render(element('div')) - render = createApp(document.body!, (action: any) => { + render = createApp(document.body, (action: any) => { render(element('div')) }) diff --git a/types/jquery.notify/jquery.notify-tests.ts b/types/jquery.notify/jquery.notify-tests.ts index 1d872e92fa..1af31996a1 100644 --- a/types/jquery.notify/jquery.notify-tests.ts +++ b/types/jquery.notify/jquery.notify-tests.ts @@ -1,4 +1,4 @@ -let $container: JQueryNotifyWidget = $("").appendTo(document.body!).notify(); +let $container: JQueryNotifyWidget = $("").appendTo(document.body).notify(); let notification: JQueryNotifyInstance = $container.notify( "create", diff --git a/types/jsdom/jsdom-tests.ts b/types/jsdom/jsdom-tests.ts index 24b136e5ad..2dbbdca601 100644 --- a/types/jsdom/jsdom-tests.ts +++ b/types/jsdom/jsdom-tests.ts @@ -17,7 +17,7 @@ function test_executing_scripts1() { `); // The script will not be executed, by default: - dom.window.document.body!.children.length === 1; + dom.window.document.body.children.length === 1; } function test_executing_scripts2() { @@ -26,14 +26,14 @@ function test_executing_scripts2() { `, { runScripts: 'dangerously' }); // The script will be executed and modify the DOM: - dom.window.document.body!.children.length === 2; + dom.window.document.body.children.length === 2; } function test_executing_scripts3() { const window = (new JSDOM(``, { runScripts: 'outside-only' })).window; window.eval(`document.body.innerHTML = "

Hello, world!

";`); - window.document.body!.children.length === 1; + window.document.body.children.length === 1; } function test_virtualConsole() { @@ -86,7 +86,7 @@ function test_nodeLocation() { ); const document = dom.window.document; - const bodyEl = document.body!; // implicitly created + const bodyEl = document.body; // implicitly created const pEl = document.querySelector('p')!; const textNode = pEl.firstChild!; const imgEl = document.querySelector('img')!; diff --git a/types/mark.js/mark.js-tests.ts b/types/mark.js/mark.js-tests.ts index 2f4bb62d9a..a979990521 100644 --- a/types/mark.js/mark.js-tests.ts +++ b/types/mark.js/mark.js-tests.ts @@ -3,7 +3,7 @@ import * as Mark from 'mark.js'; /* test instance */ const mark = new Mark(document.querySelectorAll('div')); const markBySelector = new Mark('div'); -const markByElement = new Mark(document.body!); +const markByElement = new Mark(document.body); mark.mark('keyword'); mark.mark('keyword', { diff --git a/types/marko/marko-tests.ts b/types/marko/marko-tests.ts index e43f61d8b5..623ad12e5f 100644 --- a/types/marko/marko-tests.ts +++ b/types/marko/marko-tests.ts @@ -18,7 +18,7 @@ const template: Template = require('template.marko'); // $ExpectType RenderResult template .renderSync({ name: 'Marko' }) - .appendTo(document.body!); + .appendTo(document.body); createServer((req, res) => { res.setHeader('content-type', 'text/html'); @@ -30,12 +30,12 @@ const template: Template = require('template.marko'); .render({ $global: { flags: ['mobile'] } }) .then((result) => { // $ExpectType RenderResult - result.appendTo(document.body!); + result.appendTo(document.body); }); template.render({}, (err: Error | null, result: RenderResult) => { // $ExpectType RenderResult - result.appendTo(document.body!); + result.appendTo(document.body); }); }; diff --git a/types/mithril/test/test-api.ts b/types/mithril/test/test-api.ts index 66c026f47d..73e03edeae 100644 --- a/types/mithril/test/test-api.ts +++ b/types/mithril/test/test-api.ts @@ -142,7 +142,7 @@ const FRAME_BUDGET = 100; }); }; - m.render(document.body!, userInputs(users)); + m.render(document.body, userInputs(users)); } //////////////////////////////////////////////////////////////////////////////// @@ -246,7 +246,7 @@ const FRAME_BUDGET = 100; }; // example 1 - m.route(document.body!, "/", { + m.route(document.body, "/", { "/": { view() { return m(Layout, m(Home)); @@ -260,7 +260,7 @@ const FRAME_BUDGET = 100; }); // example 2 - m.route(document.body!, "/", { + m.route(document.body, "/", { "/": { render() { return m(Layout, m(Home)); @@ -285,7 +285,7 @@ const FRAME_BUDGET = 100; }, }; - m.route(document.body!, "/", { + m.route(document.body, "/", { "/": { render() { return m(Anon1); @@ -313,7 +313,7 @@ const FRAME_BUDGET = 100; } }; - m.route(document.body!, "/user/list", { + m.route(document.body, "/user/list", { "/user/list": { onmatch: state.loadUsers, render() { @@ -330,7 +330,7 @@ const FRAME_BUDGET = 100; { let progress = 0; - m.mount(document.body!, { + m.mount(document.body, { view() { return [ m("input[type=file]", { onchange: upload }), @@ -396,7 +396,7 @@ const FRAME_BUDGET = 100; deserialize: value => value }) .then(svg => { - m.render(document.body!, m.trust(svg)); + m.render(document.body, m.trust(svg)); }); } diff --git a/types/mithril/test/test-class-component.ts b/types/mithril/test/test-class-component.ts index 44c81a8b56..0b70773c9e 100644 --- a/types/mithril/test/test-class-component.ts +++ b/types/mithril/test/test-class-component.ts @@ -112,7 +112,7 @@ class Comp4 implements ClassComponent { // // Test that all are mountable components // -m.route(document.body!, '/', { +m.route(document.body, '/', { '/comp0': Comp0, '/comp1': Comp1, '/comp2': Comp2, diff --git a/types/mithril/test/test-factory-component.ts b/types/mithril/test/test-factory-component.ts index b53619fbf1..6d0102fe38 100644 --- a/types/mithril/test/test-factory-component.ts +++ b/types/mithril/test/test-factory-component.ts @@ -148,7 +148,7 @@ function comp5(): Component { // // Test that all are mountable components // -m.route(document.body!, '/', { +m.route(document.body, '/', { '/comp0': comp0, '/comp1': comp1, '/comp2': comp2, diff --git a/types/mithril/test/test-misc.ts b/types/mithril/test/test-misc.ts index 548811247d..3f377fec60 100644 --- a/types/mithril/test/test-misc.ts +++ b/types/mithril/test/test-misc.ts @@ -10,9 +10,9 @@ const params = parseQueryString('?id=123'); const qstr = buildQueryString({id: 123}); -render(document.body!, 'Hello'); -render(document.body!, h('h1', 'Test')); -render(document.body!, [ +render(document.body, 'Hello'); +render(document.body, h('h1', 'Test')); +render(document.body, [ h('h1', 'Test'), "abc", null, 123, false, h('p', 'Vnode array'), ['a', 123, undefined, h('div', 'Nested')] ]); diff --git a/types/mithril/test/test-route.ts b/types/mithril/test/test-route.ts index 63f10e510e..7f82c9fa40 100644 --- a/types/mithril/test/test-route.ts +++ b/types/mithril/test/test-route.ts @@ -66,7 +66,7 @@ const routeResolver: RouteResolver & RRState = { } }; -route(document.body!, '/', { +route(document.body, '/', { '/': component1, '/test1': { onmatch(args, path) { diff --git a/types/webcomponents.js/webcomponents.js-tests.ts b/types/webcomponents.js/webcomponents.js-tests.ts index 8fb40bd824..2ed224ef23 100644 --- a/types/webcomponents.js/webcomponents.js-tests.ts +++ b/types/webcomponents.js/webcomponents.js-tests.ts @@ -16,7 +16,7 @@ const XFoo = document.registerElement("x-foo", { const xFoo = new XFoo(); xFoo.textContent = ""; -document.body!.appendChild(xFoo); +document.body.appendChild(xFoo); window.CustomElements.hasNative; window.CustomElements.flags; diff --git a/types/webtorrent/webtorrent-tests.ts b/types/webtorrent/webtorrent-tests.ts index d8ffba389d..63a9647902 100644 --- a/types/webtorrent/webtorrent-tests.ts +++ b/types/webtorrent/webtorrent-tests.ts @@ -31,7 +31,7 @@ client.add(magnetURI, {}, torrent => { a.href = url; } a.textContent = 'Download ' + file.name; - document.body!.appendChild(a); + document.body.appendChild(a); }); });