Skip to content

Commit 800239f

Browse files
author
my
committed
Weather app builded on rendering components commit #1
1 parent 420f376 commit 800239f

34 files changed

+27601
-8246
lines changed

.eslintignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/node_modules
2+
/dist
3+
/.cache
4+
/.git
5+
/coverage

.eslintrc.js

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,35 @@
11
module.exports = {
2+
parser: "@typescript-eslint/parser",
3+
plugins: ["@typescript-eslint"],
24
env: {
35
browser: true,
46
es2021: true,
57
jest: true,
68
node: true,
79
},
8-
extends: ["eslint:recommended", "prettier"],
10+
extends: [
11+
"plugin:jest/recommended",
12+
"plugin:@typescript-eslint/eslint-recommended",
13+
"plugin:@typescript-eslint/recommended",
14+
"eslint:recommended",
15+
"prettier",
16+
],
917
parserOptions: {
1018
ecmaVersion: "latest",
1119
sourceType: "module",
1220
},
1321
rules: {
14-
indent: ["error", "tab"],
22+
"@typescript-eslint/ban-types": 0,
23+
"@typescript-eslint/no-explicit-any": 0,
24+
"@typescript-eslint/no-var-requires": 0,
25+
"@typescript-eslint/no-empty-function": 0,
26+
"@typescript-eslint/no-unused-vars": 0,
27+
"no-import-assign": 0,
28+
"no-unused-vars": 0,
29+
"jest/no-done-callback": 0,
30+
"jest/no-conditional-expect": 0,
31+
// indent: ["error", 2],
32+
indent: 0,
1533
"linebreak-style": ["error", "unix"],
1634
quotes: ["error", "double"],
1735
semi: ["error", "always"],

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
11
node_modules
2+
coverage/*
3+
!coverage/badges.svg
4+
dist
5+
.cache

.prettierignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/node_modules
2+
/dist
3+
/.cache
4+
/.git
5+
/coverage
6+

.stylelintrc.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": [
3+
"stylelint-config-standard-scss",
4+
"stylelint-config-standard",
5+
"stylelint-config-prettier"
6+
]
7+
}

babel.config.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
module.exports = {
2-
presets: [["@babel/preset-env", { targets: { node: "current" } }]],
2+
presets: [
3+
"@babel/preset-typescript",
4+
["@babel/preset-env", { targets: { node: "current" } }],
5+
],
6+
plugins: ["@babel/plugin-transform-runtime"],
37
};

coverage/badges.svg

Lines changed: 14 additions & 0 deletions
Loading

index.html

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>Templater</title>
7+
</head>
8+
<body>
9+
<section id="#forecast">
10+
<div id="#search-div" class="search-div">
11+
<label>Мой город</label>
12+
<input type="checkbox" id="#cbxId" class="cbx" />
13+
<input type="text" id="#edtId" class="edt" />
14+
<input type="button" value="Поиск" id="#btnId" class="btn" />
15+
</div>
16+
17+
<div id="#forecast-div-id" class="flex-div">
18+
{{for list as listItem}} {{if index == First}}
19+
<div class="now-div">
20+
<p class="bold-p">Сейчас:</p>
21+
<p>{{listItem.weather.0.description}}</p>
22+
<div class="txt-div">
23+
<p>Температура: {{listItem.main.temp}} &#8451;</p>
24+
<p>Влажность: {{listItem.main.humidity}} %</p>
25+
<p>Скорость ветра: {{listItem.wind.speed}} м/с</p>
26+
</div>
27+
{{and listItem.weather.0.icon}}
28+
<div class="inline-img">
29+
<img
30+
src="http://openweathermap.org/img/wn/{{listItem.weather.0.icon}}@2x.png"
31+
/>
32+
</div>
33+
</div>
34+
<div class="big-border-div"></div>
35+
{{endif}} {{if index != 1}} {{and {Part}listItem.dt_txt == 00:00:00}}
36+
<div class="small-border-div"></div>
37+
{{endif}} {{if index != First}}
38+
<div class="forecast-el">
39+
<p>{{listItem.dt_txt}}</p>
40+
<img
41+
src="http://openweathermap.org/img/wn/{{listItem.weather.0.icon}}@2x.png"
42+
/>
43+
<p>{{listItem.main.temp}} &#8451;</p>
44+
</div>
45+
{{endif}} {{endfor}}
46+
</div>
47+
<div id="#world-map" class="map-div">
48+
<iframe
49+
src="https://www.openstreetmap.org/export/embed.html?bbox={{lonS}}%2C{{latS}}%2C{{lonE}}%2C{{latE}}&amp;layer=mapnik"
50+
></iframe>
51+
</div>
52+
<div id="#history-div" class="hist-div">
53+
<p>История</p>
54+
{{for cities as city}}
55+
<a href="#" class="aClass">{{city}}</a>
56+
{{endfor}}
57+
</div>
58+
</section>
59+
</body>
60+
<script src="src/bundle.ts"></script>
61+
</html>

jest.config.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,7 @@ module.exports = {
3434
// coverageProvider: "babel",
3535

3636
// A list of reporter names that Jest uses when writing coverage reports
37-
// coverageReporters: [
38-
// "json",
39-
// "text",
40-
// "lcov",
41-
// "clover"
42-
// ],
37+
coverageReporters: ["json", "text", "lcov", "json-summary", "clover"],
4338

4439
// An object that configures minimum threshold enforcement for coverage results
4540
// coverageThreshold: undefined,
@@ -99,6 +94,8 @@ module.exports = {
9994
// An enum that specifies notification mode. Requires { notify: true }
10095
// notifyMode: "failure-change",
10196

97+
preset: "ts-jest",
98+
10299
// A preset that is used as a base for Jest's configuration
103100
// preset: undefined,
104101

@@ -174,6 +171,9 @@ module.exports = {
174171

175172
// A map from regular expressions to paths to transformers
176173
// transform: undefined,
174+
transform: {
175+
"^.+\\.jsx?$": "babel-jest",
176+
},
177177

178178
// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
179179
// transformIgnorePatterns: [

0 commit comments

Comments
 (0)