fix: lint errors

This commit is contained in:
Baptiste Grob
2021-01-22 11:52:24 +01:00
parent 5d65364885
commit a0909399f8
25 changed files with 74 additions and 75 deletions

View File

@@ -50,7 +50,9 @@ export function dateToLocalizedString(date: Date) {
export function debounce(this: any, func: any, wait: number, immediate = false) {
let timeout: any;
return () => {
// eslint-disable-next-line @typescript-eslint/no-this-alias
const context = this;
// eslint-disable-next-line prefer-rest-params
const args = arguments;
const later = function () {
timeout = null;
@@ -61,7 +63,7 @@ export function debounce(this: any, func: any, wait: number, immediate = false)
timeout = setTimeout(later, wait);
if (callNow) func.apply(context, args);
};
};
}
// https://tc39.github.io/ecma262/#sec-array.prototype.includes
if (!Array.prototype.includes) {
@@ -73,10 +75,10 @@ if (!Array.prototype.includes) {
}
// 1. Let O be ? ToObject(this value).
var o = Object(this);
const o = Object(this);
// 2. Let len be ? ToLength(? Get(O, "length")).
var len = o.length >>> 0;
const len = o.length >>> 0;
// 3. If len is 0, return false.
if (len === 0) {
@@ -85,14 +87,14 @@ if (!Array.prototype.includes) {
// 4. Let n be ? ToInteger(fromIndex).
// (If fromIndex is undefined, this step produces the value 0.)
var n = fromIndex | 0;
const n = fromIndex | 0;
// 5. If n ≥ 0, then
// a. Let k be n.
// 6. Else n < 0,
// a. Let k be len + n.
// b. If k < 0, let k be 0.
var k = Math.max(n >= 0 ? n : len - Math.abs(n), 0);
let k = Math.max(n >= 0 ? n : len - Math.abs(n), 0);
function sameValueZero(x: number, y: number) {
return (