Skip to content

Commit a8b9145

Browse files
committed
Add microverse config to eslint
1 parent 08c20d5 commit a8b9145

File tree

3 files changed

+29
-21
lines changed

3 files changed

+29
-21
lines changed

.eslintrc.json

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,19 @@
11
{
2-
"env": {
3-
"browser": true,
4-
"es6": true
5-
},
6-
"extends": [
7-
"airbnb-base"
8-
],
9-
"globals": {
10-
"Atomics": "readonly",
11-
"SharedArrayBuffer": "readonly"
12-
},
13-
"parserOptions": {
14-
"ecmaVersion": 2018,
15-
"sourceType": "module"
16-
},
17-
"rules": {},
18-
"ignorePatterns": [
19-
"dist/app.bundle.js",
20-
"node_modules/"
21-
]
22-
}
2+
"env": {
3+
"browser": true,
4+
"es6": true,
5+
"jest": true
6+
},
7+
"parserOptions": {
8+
"ecmaVersion": 2018,
9+
"sourceType": "module"
10+
},
11+
"extends": ["airbnb-base"],
12+
"rules": {
13+
"no-shadow": "off",
14+
"no-param-reassign": "off",
15+
"eol-last": "off",
16+
"arrow-parens": "off"
17+
},
18+
"ignorePatterns": ["dist/app.bundle.js", "node_modules/"]
19+
}

src/assets/style.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,8 @@ h5 {
5151
font-weight: bolder;
5252
border: none;
5353
box-shadow: none;
54+
}
55+
56+
#img-container {
57+
text-transform: capitalize;
5458
}

src/views/renderCard.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ async function renderCard(data) {
66
const p1 = document.createElement('p');
77
const p2 = document.createElement('p');
88
const parent = document.getElementById('container');
9+
const imgCont = document.createElement('div');
10+
const img = new Image();
911

1012
if (data.error) {
1113
card.className = 'card';
@@ -31,12 +33,17 @@ async function renderCard(data) {
3133
p2.textContent = `Max: ${data.main.temp_max} ${data.units}, Min: ${data.main.temp_min} ${data.units}`;
3234
p1.classList = 'card-text';
3335
p2.classList = 'card-text';
36+
imgCont.id = 'img-container';
37+
imgCont.textContent = data.weather[0].description;
38+
img.src = `https://openweathermap.org/img/wn/${data.weather[0].icon}@2x.png`;
3439

3540
card.appendChild(cardBody);
3641
cardBody.appendChild(h5);
3742
cardBody.appendChild(h6);
3843
cardBody.appendChild(p1);
3944
cardBody.appendChild(p2);
45+
cardBody.appendChild(imgCont);
46+
imgCont.appendChild(img);
4047

4148
if (parent.lastChild) {
4249
parent.removeChild(parent.lastChild);

0 commit comments

Comments
 (0)