mirror of
https://github.com/netbymatt/ws4kp.git
synced 2026-04-21 02:59:31 -07:00
additional eslint rules
This commit is contained in:
@@ -45,9 +45,9 @@ class TravelForecast extends WeatherDisplay {
|
||||
name: city.Name,
|
||||
icon: getWeatherRegionalIconFromIconLink(forecast.properties.periods[todayShift].icon),
|
||||
};
|
||||
} catch (e) {
|
||||
} catch (error) {
|
||||
console.error(`GetTravelWeather for ${city.Name} failed`);
|
||||
console.error(e.status, e.responseJSON);
|
||||
console.error(error.status, error.responseJSON);
|
||||
return { name: city.Name, error: true };
|
||||
}
|
||||
});
|
||||
@@ -77,10 +77,9 @@ class TravelForecast extends WeatherDisplay {
|
||||
|
||||
const lines = cities.map((city) => {
|
||||
if (city.error) return false;
|
||||
const fillValues = {};
|
||||
|
||||
// city name
|
||||
fillValues.city = city;
|
||||
const fillValues = {
|
||||
city,
|
||||
};
|
||||
|
||||
// check for forecast data
|
||||
if (city.icon) {
|
||||
@@ -94,8 +93,9 @@ class TravelForecast extends WeatherDisplay {
|
||||
|
||||
fillValues.low = lowString;
|
||||
fillValues.high = highString;
|
||||
const { icon } = city;
|
||||
|
||||
fillValues.icon = { type: 'img', src: city.icon };
|
||||
fillValues.icon = { type: 'img', src: icon };
|
||||
} else {
|
||||
fillValues.error = 'NO TRAVEL DATA AVAILABLE';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user