Skip to content

Commit 0beb29d

Browse files
committed
Fix eslint errors
1 parent 104a215 commit 0beb29d

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

src/js/dom.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ const dom = function dom() {
3333
helpers().addInnerText('wind', `<i class="fas fa-wind text-warning my-2"></i> ${data.wind.speed} meter/sec`);
3434
helpers().addInnerText('windDir', `<i class="fas fa-compass text-warning my-2"></i> ${data.wind.deg} degrees`);
3535
helpers().addInnerText('clouds', `<i class="fas fa-cloud text-warning my-2"></i> Clouds: ${data.clouds.all}%`);
36-
helpers().addInnerText('sunrise', '<i class="fas fa-sun text-warning my-2"></i> ' + `Sunrise: ${new Date((data.sys.sunrise + data.timezone) * 1000).toUTCString().slice(-11, -7)} AM`);
37-
helpers().addInnerText('sunset', '<i class="fas fa-sun text-warning my-2"></i> ' + `Sunset: ${new Date((data.sys.sunset + data.timezone) * 1000).toUTCString().slice(-11, -7)} PM`);
36+
helpers().addInnerText('sunrise', `<i class="fas fa-sun text-warning my-2"></i> Sunrise: ${new Date((data.sys.sunrise + data.timezone) * 1000).toUTCString().slice(-11, -7)} AM`);
37+
helpers().addInnerText('sunset', `<i class="fas fa-sun text-warning my-2"></i> Sunset: ${new Date((data.sys.sunset + data.timezone) * 1000).toUTCString().slice(-11, -7)} PM`);
3838
}
3939

4040
function imageSwitch(data, id) {
@@ -126,7 +126,7 @@ const dom = function dom() {
126126
cont.appendChild(card);
127127
row.appendChild(cont);
128128

129-
for (let i = 0; i < color.length; i++) {
129+
for (let i = 0; i < color.length; i += 1) {
130130
color[i].style = 'background-color: rgba(255,255,255,0.1);';
131131
}
132132

src/js/events.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1+
/* eslint-disable no-alert */
2+
/* eslint-disable no-console */
13
import dom from './dom';
2-
import helpers from './helpers';
34

45
const events = function events() {
56
function showFlow(data) {
@@ -33,7 +34,6 @@ const events = function events() {
3334
function getLocation(searchBar) {
3435
const city = (document.getElementById(searchBar).value).toLowerCase();
3536
getSearch(city);
36-
helpers().getFahrenheit(city);
3737
}
3838

3939
async function getForecast() {

src/js/helpers.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
/* eslint-disable consistent-return */
2+
/* eslint-disable no-alert */
3+
/* eslint-disable no-console */
14

25
const helpers = function helpers() {
36
const createElement = function createElement(tag, className) {
@@ -15,7 +18,8 @@ const helpers = function helpers() {
1518

1619
const addInnerText = function addInnerText(className, text) {
1720
const element = document.getElementById(className);
18-
return element.innerHTML = text;
21+
element.innerHTML = text;
22+
return element.innerHTML;
1923
};
2024

2125
async function getFahrenheit(city) {

0 commit comments

Comments
 (0)