Skip to content

Commit

Permalink
Update ignored files for eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
Veeck committed Apr 20, 2020
1 parent b56a930 commit fb557b9
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 24 deletions.
4 changes: 1 addition & 3 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
modules/default/alert/notificationFx.js
modules/default/alert/modernizr.custom.js
modules/default/alert/classie.js
modules/default/calendar/vendor/*
8 changes: 4 additions & 4 deletions modules/default/weather/providers/darksky.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ WeatherProvider.register("darksky", {
providerName: "Dark Sky",

units: {
imperial: 'us',
metric: 'si'
imperial: "us",
metric: "si"
},

fetchCurrentWeather() {
Expand All @@ -33,7 +33,7 @@ WeatherProvider.register("darksky", {
}).catch(function(request) {
Log.error("Could not load data ... ", request);
})
.finally(() => this.updateAvailable())
.finally(() => this.updateAvailable());
},

fetchWeatherForecast() {
Expand All @@ -49,7 +49,7 @@ WeatherProvider.register("darksky", {
}).catch(function(request) {
Log.error("Could not load data ... ", request);
})
.finally(() => this.updateAvailable())
.finally(() => this.updateAvailable());
},

// Create a URL from the config and base URL.
Expand Down
6 changes: 3 additions & 3 deletions modules/default/weather/providers/openweathermap.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ WeatherProvider.register("openweathermap", {
.catch(function(request) {
Log.error("Could not load data ... ", request);
})
.finally(() => this.updateAvailable())
.finally(() => this.updateAvailable());
},

// Overwrite the fetchCurrentWeather method.
Expand All @@ -55,7 +55,7 @@ WeatherProvider.register("openweathermap", {
.catch(function(request) {
Log.error("Could not load data ... ", request);
})
.finally(() => this.updateAvailable())
.finally(() => this.updateAvailable());
},

/** OpenWeatherMap Specific Methods - These are not part of the default provider methods */
Expand Down Expand Up @@ -223,7 +223,7 @@ WeatherProvider.register("openweathermap", {
days.push(weather);
}

return days;
return days;
},

/*
Expand Down
19 changes: 8 additions & 11 deletions modules/default/weather/providers/ukmetoffice.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
* This class is a provider for UK Met Office Datapoint.
*/


WeatherProvider.register("ukmetoffice", {

// Set the name of the provider.
Expand Down Expand Up @@ -41,7 +40,7 @@ WeatherProvider.register("ukmetoffice", {
.catch(function(request) {
Log.error("Could not load data ... ", request);
})
.finally(() => this.updateAvailable())
.finally(() => this.updateAvailable());
},

// Overwrite the fetchCurrentWeather method.
Expand All @@ -63,11 +62,9 @@ WeatherProvider.register("ukmetoffice", {
.catch(function(request) {
Log.error("Could not load data ... ", request);
})
.finally(() => this.updateAvailable())
.finally(() => this.updateAvailable());
},



/** UK Met Office Specific Methods - These are not part of the default provider methods */
/*
* Gets the complete url for the request
Expand All @@ -83,13 +80,13 @@ WeatherProvider.register("ukmetoffice", {
const currentWeather = new WeatherObject(this.config.units, this.config.tempUnits, this.config.windUnits);

// data times are always UTC
let nowUtc = moment.utc()
let midnightUtc = nowUtc.clone().startOf("day")
let nowUtc = moment.utc();
let midnightUtc = nowUtc.clone().startOf("day");
let timeInMins = nowUtc.diff(midnightUtc, "minutes");

// loop round each of the (5) periods, look for today (the first period may be yesterday)
for (i in currentWeatherData.SiteRep.DV.Location.Period) {
let periodDate = moment.utc(currentWeatherData.SiteRep.DV.Location.Period[i].value.substr(0,10), "YYYY-MM-DD")
let periodDate = moment.utc(currentWeatherData.SiteRep.DV.Location.Period[i].value.substr(0,10), "YYYY-MM-DD");

// ignore if period is before today
if (periodDate.isSameOrAfter(moment.utc().startOf("day"))) {
Expand All @@ -116,7 +113,7 @@ WeatherProvider.register("ukmetoffice", {
}

// determine the sunrise/sunset times - not supplied in UK Met Office data
let times = this.calcAstroData(currentWeatherData.SiteRep.DV.Location)
let times = this.calcAstroData(currentWeatherData.SiteRep.DV.Location);
currentWeather.sunrise = times[0];
currentWeather.sunset = times[1];

Expand All @@ -136,8 +133,8 @@ WeatherProvider.register("ukmetoffice", {
const weather = new WeatherObject(this.config.units, this.config.tempUnits, this.config.windUnits);

// data times are always UTC
dateStr = forecasts.SiteRep.DV.Location.Period[j].value
let periodDate = moment.utc(dateStr.substr(0,10), "YYYY-MM-DD")
dateStr = forecasts.SiteRep.DV.Location.Period[j].value;
let periodDate = moment.utc(dateStr.substr(0,10), "YYYY-MM-DD");

// ignore if period is before today
if (periodDate.isSameOrAfter(moment.utc().startOf("day"))) {
Expand Down
6 changes: 3 additions & 3 deletions modules/default/weather/providers/weathergov.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ WeatherProvider.register("weathergov", {
.catch(function(request) {
Log.error("Could not load data ... ", request);
})
.finally(() => this.updateAvailable())
.finally(() => this.updateAvailable());
},

// Overwrite the fetchCurrentWeather method.
Expand All @@ -54,7 +54,7 @@ WeatherProvider.register("weathergov", {
.catch(function(request) {
Log.error("Could not load data ... ", request);
})
.finally(() => this.updateAvailable())
.finally(() => this.updateAvailable());
},

/** Weather.gov Specific Methods - These are not part of the default provider methods */
Expand All @@ -77,7 +77,7 @@ WeatherProvider.register("weathergov", {
currentWeather.weatherType = this.convertWeatherType(currentWeatherData.shortForecast, currentWeatherData.isDaytime);

// determine the sunrise/sunset times - not supplied in weather.gov data
let times = this.calcAstroData(this.config.lat, this.config.lon)
let times = this.calcAstroData(this.config.lat, this.config.lon);
currentWeather.sunrise = times[0];
currentWeather.sunset = times[1];

Expand Down

0 comments on commit fb557b9

Please sign in to comment.