Sortablejs: Enable strict null checks.

This commit is contained in:
Maarten Staa
2018-09-20 15:55:29 +02:00
parent 05fa0c611d
commit f4285b8087
2 changed files with 7 additions and 7 deletions
+5 -5
View File
@@ -2,9 +2,9 @@
import Sortable = require("sortablejs");
var simpleList = document.getElementById('list');
var simpleList = document.createElement('ul');
var list = simpleList;
var el = document.getElementById('el');
var el = document.createElement('div');
var sortable = new Sortable(simpleList, {});
var order = sortable.toArray();
var angular: any;
@@ -86,7 +86,7 @@ simpleList.innerHTML = Array.apply(null, new Array(100)).map(function(value: any
(function() {
'use strict';
var byId = function(id: string) { return document.getElementById(id); },
var byId = function(id: string) { return document.getElementById(id)!; },
loadScripts = function(desc: any, callback: any) {
var deps: string[] = [];
@@ -172,7 +172,7 @@ simpleList.innerHTML = Array.apply(null, new Array(100)).map(function(value: any
animation: 150,
filter: '.js-remove',
onFilter: function(evt) {
evt.item.parentNode.removeChild(evt.item);
evt.item.parentNode!.removeChild(evt.item);
}
});
@@ -279,7 +279,7 @@ simpleList.innerHTML = Array.apply(null, new Array(100)).map(function(value: any
document.addEventListener("DOMContentLoaded", function() {
function setNoiseBackground(el: any, width: number, height: number, opacity: number) {
var canvas = document.createElement("canvas");
var context = canvas.getContext("2d");
var context = canvas.getContext("2d")!;
canvas.width = width;
canvas.height = height;
+2 -2
View File
@@ -7,7 +7,7 @@
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": false,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
@@ -21,4 +21,4 @@
"index.d.ts",
"sortablejs-tests.ts"
]
}
}