diff --git a/.eslintrc.json b/.eslintrc.json index 65b99e6e..c49c0cd6 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -14,6 +14,7 @@ } }, "rules": { + "eqeqeq": "error", "no-prototype-builtins": "off", "no-undef": "off", "no-unused-vars": "off" diff --git a/modules/default/calendar/calendarfetcher.js b/modules/default/calendar/calendarfetcher.js index 1e629a28..95263182 100644 --- a/modules/default/calendar/calendarfetcher.js +++ b/modules/default/calendar/calendarfetcher.js @@ -199,7 +199,7 @@ var CalendarFetcher = function(url, reloadInterval, excludedEvents, maximumEntri // because the logic below will filter out any recurrences that don"t actually belong within // our display range. // Would be great if there was a better way to handle this. - if (event.recurrences != undefined) + if (event.recurrences !== undefined) { var pastMoment = moment(past); var futureMoment = moment(future); @@ -208,7 +208,7 @@ var CalendarFetcher = function(url, reloadInterval, excludedEvents, maximumEntri { // Only add dates that weren't already in the range we added from the rrule so that // we don"t double-add those events. - if (moment(new Date(r)).isBetween(pastMoment, futureMoment) != true) + if (moment(new Date(r)).isBetween(pastMoment, futureMoment) !== true) { dates.push(new Date(r)); } @@ -234,7 +234,7 @@ var CalendarFetcher = function(url, reloadInterval, excludedEvents, maximumEntri startDate = moment(date); // For each date that we"re checking, it"s possible that there is a recurrence override for that one day. - if ((curEvent.recurrences != undefined) && (curEvent.recurrences[dateKey] != undefined)) + if ((curEvent.recurrences !== undefined) && (curEvent.recurrences[dateKey] !== undefined)) { // We found an override, so for this recurrence, use a potentially different title, start date, and duration. curEvent = curEvent.recurrences[dateKey]; @@ -242,14 +242,14 @@ var CalendarFetcher = function(url, reloadInterval, excludedEvents, maximumEntri duration = parseInt(moment(curEvent.end).format("x")) - parseInt(startDate.format("x")); } // If there"s no recurrence override, check for an exception date. Exception dates represent exceptions to the rule. - else if ((curEvent.exdate != undefined) && (curEvent.exdate[dateKey] != undefined)) + else if ((curEvent.exdate !== undefined) && (curEvent.exdate[dateKey] !== undefined)) { // This date is an exception date, which means we should skip it in the recurrence pattern. showRecurrence = false; } endDate = moment(parseInt(startDate.format("x")) + duration, "x"); - if (startDate.format("x") == endDate.format("x")) { + if (startDate.format("x") === endDate.format("x")) { endDate = endDate.endOf("day"); } diff --git a/modules/default/updatenotification/updatenotification.js b/modules/default/updatenotification/updatenotification.js index c0757b5a..28c5f4e4 100644 --- a/modules/default/updatenotification/updatenotification.js +++ b/modules/default/updatenotification/updatenotification.js @@ -41,16 +41,16 @@ Module.register("updatenotification", { var self = this; if (payload && payload.behind > 0) { // if we haven't seen info for this module - if(this.moduleList[payload.module] == undefined){ + if(this.moduleList[payload.module] === undefined){ // save it this.moduleList[payload.module]=payload; self.updateDom(2); } //self.show(1000, { lockString: self.identifier }); - } else if (payload && payload.behind == 0){ + } else if (payload && payload.behind === 0){ // if the module WAS in the list, but shouldn't be - if(this.moduleList[payload.module] != undefined){ + if(this.moduleList[payload.module] !== undefined){ // remove it delete this.moduleList[payload.module]; self.updateDom(2); @@ -72,7 +72,7 @@ Module.register("updatenotification", { // Override dom generator. getDom: function () { var wrapper = document.createElement("div"); - if(this.suspended==false){ + if(this.suspended === false){ // process the hash of module info found for(key of Object.keys(this.moduleList)){ let m= this.moduleList[key]; @@ -85,7 +85,7 @@ Module.register("updatenotification", { icon.innerHTML = " "; message.appendChild(icon); - var updateInfoKeyName = m.behind == 1 ? "UPDATE_INFO_SINGLE" : "UPDATE_INFO_MULTIPLE"; + var updateInfoKeyName = m.behind === 1 ? "UPDATE_INFO_SINGLE" : "UPDATE_INFO_MULTIPLE"; var subtextHtml = this.translate(updateInfoKeyName, { COMMIT_COUNT: m.behind, @@ -93,7 +93,7 @@ Module.register("updatenotification", { }); var text = document.createElement("span"); - if (m.module == "default") { + if (m.module === "default") { text.innerHTML = this.translate("UPDATE_NOTIFICATION"); subtextHtml = this.diffLink(m,subtextHtml); } else { diff --git a/modules/default/weatherforecast/weatherforecast.js b/modules/default/weatherforecast/weatherforecast.js index e496771a..4265de02 100644 --- a/modules/default/weatherforecast/weatherforecast.js +++ b/modules/default/weatherforecast/weatherforecast.js @@ -456,7 +456,7 @@ Module.register("weatherforecast",{ }); //If no rain this day return undefined so it wont be displayed for this day - if (daysForecasts.length == 0) { + if (daysForecasts.length === 0) { return undefined; }