Skip to content

Commit 9b5878b

Browse files
committed
Applied linter
1 parent 409c12b commit 9b5878b

File tree

8 files changed

+186
-34
lines changed

8 files changed

+186
-34
lines changed

.eslintrc.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
module.exports = {
2+
parser: '@typescript-eslint/parser',
3+
plugins: ['@typescript-eslint'],
4+
extends: ['airbnb'],
5+
env: {
6+
browser: true,
7+
node: true,
8+
},
9+
rules: {
10+
'no-underscore-dangle': 0,
11+
'linebreak-style': 0,
12+
'import/no-unresolved': 0,
13+
'react/jsx-filename-extension': [
14+
1,
15+
{
16+
extensions: ['.js', '.jsx', '.ts', '.tsx'],
17+
},
18+
],
19+
},
20+
};

.prettierrc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
singleQuote: true,
3+
};

.vscode/settings.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"editor.formatOnSave": true,
3+
"prettier.eslintIntegration": true,
4+
"eslint.enable": true,
5+
"prettier.useTabs": false,
6+
"prettier.tabWidth": 2,
7+
"eslint.validate": [
8+
"javascript",
9+
"javascriptreact",
10+
"html",
11+
"typescript",
12+
"typescriptreact"
13+
]
14+
}

custom.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
declare module '*.svg' {
2+
const content: any;
3+
export default content;
4+
}

package.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,14 @@
3232
"last 1 firefox version",
3333
"last 1 safari version"
3434
]
35+
},
36+
"devDependencies": {
37+
"@typescript-eslint/eslint-plugin": "^1.10.2",
38+
"@typescript-eslint/parser": "^1.10.2",
39+
"eslint": "^5.16.0",
40+
"eslint-config-airbnb": "^17.1.0",
41+
"eslint-plugin-import": "^2.17.3",
42+
"eslint-plugin-jsx-a11y": "^6.2.1",
43+
"eslint-plugin-react": "^7.13.0"
3544
}
3645
}

src/App.tsx

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,22 @@
11
import React from 'react';
2+
23
import logo from './logo.svg';
34
import './App.css';
45

5-
const App: React.FC = () => {
6-
return (
7-
<div className="App">
8-
<header className="App-header">
9-
<img src={logo} className="App-logo" alt="logo" />
10-
<p>
11-
Edit <code>src/App.tsx</code> and save to reload.
12-
</p>
13-
<a
14-
className="App-link"
15-
href="https://reactjs.org"
16-
target="_blank"
17-
rel="noopener noreferrer"
18-
>
19-
Learn React
20-
</a>
21-
</header>
22-
</div>
23-
);
24-
}
6+
const App: React.FC = (): JSX.Element => (
7+
<div className="App">
8+
<header className="App-header">
9+
<img src={logo} className="App-logo" alt="logo" />
10+
<p>
11+
{'Edit'}
12+
<code>src/App.tsx</code>
13+
{'and save to reload.'}
14+
</p>
15+
<a className="App-link" href="https://reactjs.org" target="_blank" rel="noopener noreferrer">
16+
{'Learn React'}
17+
</a>
18+
</header>
19+
</div>
20+
);
2521

2622
export default App;

tsconfig.json

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
{
22
"compilerOptions": {
33
"target": "es5",
4-
"lib": [
5-
"dom",
6-
"dom.iterable",
7-
"esnext"
8-
],
4+
"lib": ["dom", "dom.iterable", "esnext"],
95
"allowJs": true,
106
"skipLibCheck": true,
117
"esModuleInterop": true,
@@ -19,7 +15,5 @@
1915
"noEmit": true,
2016
"jsx": "preserve"
2117
},
22-
"include": [
23-
"src"
24-
]
18+
"include": ["src", "custom.d.ts"]
2519
}

yarn.lock

Lines changed: 118 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1233,6 +1233,11 @@
12331233
dependencies:
12341234
"@babel/types" "^7.3.0"
12351235

1236+
"@types/eslint-visitor-keys@^1.0.0":
1237+
version "1.0.0"
1238+
resolved "https://registry.yarnpkg.com/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#1ee30d79544ca84d68d4b3cdb0af4f205663dd2d"
1239+
integrity sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag==
1240+
12361241
"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0":
12371242
version "2.0.1"
12381243
resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz#42995b446db9a48a11a07ec083499a860e9138ff"
@@ -1342,6 +1347,25 @@
13421347
requireindex "^1.2.0"
13431348
tsutils "^3.7.0"
13441349

1350+
"@typescript-eslint/eslint-plugin@^1.10.2":
1351+
version "1.10.2"
1352+
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-1.10.2.tgz#552fc64cfcb19c6162190360217c945e8faa330a"
1353+
integrity sha512-7449RhjE1oLFIy5E/5rT4wG5+KsfPzakJuhvpzXJ3C46lq7xywY0/Rjo9ZBcwrfbk0nRZ5xmUHkk7DZ67tSBKw==
1354+
dependencies:
1355+
"@typescript-eslint/experimental-utils" "1.10.2"
1356+
eslint-utils "^1.3.1"
1357+
functional-red-black-tree "^1.0.1"
1358+
regexpp "^2.0.1"
1359+
tsutils "^3.7.0"
1360+
1361+
"@typescript-eslint/[email protected]":
1362+
version "1.10.2"
1363+
resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-1.10.2.tgz#cd548c03fc1a2b3ba5c136d1599001a1ede24215"
1364+
integrity sha512-Hf5lYcrnTH5Oc67SRrQUA7KuHErMvCf5RlZsyxXPIT6AXa8fKTyfFO6vaEnUmlz48RpbxO4f0fY3QtWkuHZNjg==
1365+
dependencies:
1366+
"@typescript-eslint/typescript-estree" "1.10.2"
1367+
eslint-scope "^4.0.0"
1368+
13451369
"@typescript-eslint/[email protected]":
13461370
version "1.6.0"
13471371
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-1.6.0.tgz#f01189c8b90848e3b8e45a6cdad27870529d1804"
@@ -1351,6 +1375,24 @@
13511375
eslint-scope "^4.0.0"
13521376
eslint-visitor-keys "^1.0.0"
13531377

1378+
"@typescript-eslint/parser@^1.10.2":
1379+
version "1.10.2"
1380+
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-1.10.2.tgz#36cfe8c6bf1b6c1dd81da56f88c8588f4b1a852b"
1381+
integrity sha512-xWDWPfZfV0ENU17ermIUVEVSseBBJxKfqBcRCMZ8nAjJbfA5R7NWMZmFFHYnars5MjK4fPjhu4gwQv526oZIPQ==
1382+
dependencies:
1383+
"@types/eslint-visitor-keys" "^1.0.0"
1384+
"@typescript-eslint/experimental-utils" "1.10.2"
1385+
"@typescript-eslint/typescript-estree" "1.10.2"
1386+
eslint-visitor-keys "^1.0.0"
1387+
1388+
"@typescript-eslint/[email protected]":
1389+
version "1.10.2"
1390+
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-1.10.2.tgz#8403585dd74b6cfb6f78aa98b6958de158b5897b"
1391+
integrity sha512-Kutjz0i69qraOsWeI8ETqYJ07tRLvD9URmdrMoF10bG8y8ucLmPtSxROvVejWvlJUGl2et/plnMiKRDW+rhEhw==
1392+
dependencies:
1393+
lodash.unescape "4.0.1"
1394+
semver "5.5.0"
1395+
13541396
"@typescript-eslint/[email protected]":
13551397
version "1.6.0"
13561398
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-1.6.0.tgz#6cf43a07fee08b8eb52e4513b428c8cdc9751ef0"
@@ -3503,6 +3545,24 @@ escodegen@^1.11.0, escodegen@^1.9.1:
35033545
optionalDependencies:
35043546
source-map "~0.6.1"
35053547

3548+
eslint-config-airbnb-base@^13.1.0:
3549+
version "13.1.0"
3550+
resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-13.1.0.tgz#b5a1b480b80dfad16433d6c4ad84e6605052c05c"
3551+
integrity sha512-XWwQtf3U3zIoKO1BbHh6aUhJZQweOwSt4c2JrPDg9FP3Ltv3+YfEv7jIDB8275tVnO/qOHbfuYg3kzw6Je7uWw==
3552+
dependencies:
3553+
eslint-restricted-globals "^0.1.1"
3554+
object.assign "^4.1.0"
3555+
object.entries "^1.0.4"
3556+
3557+
eslint-config-airbnb@^17.1.0:
3558+
version "17.1.0"
3559+
resolved "https://registry.yarnpkg.com/eslint-config-airbnb/-/eslint-config-airbnb-17.1.0.tgz#3964ed4bc198240315ff52030bf8636f42bc4732"
3560+
integrity sha512-R9jw28hFfEQnpPau01NO5K/JWMGLi6aymiF6RsnMURjTk+MqZKllCqGK/0tOvHkPi/NWSSOU2Ced/GX++YxLnw==
3561+
dependencies:
3562+
eslint-config-airbnb-base "^13.1.0"
3563+
object.assign "^4.1.0"
3564+
object.entries "^1.0.4"
3565+
35063566
eslint-config-react-app@^4.0.1:
35073567
version "4.0.1"
35083568
resolved "https://registry.yarnpkg.com/eslint-config-react-app/-/eslint-config-react-app-4.0.1.tgz#23fd0fd7ea89442ef1e733f66a7207674b23c8db"
@@ -3529,7 +3589,7 @@ [email protected]:
35293589
object-hash "^1.1.4"
35303590
rimraf "^2.6.1"
35313591

3532-
eslint-module-utils@^2.3.0:
3592+
eslint-module-utils@^2.3.0, eslint-module-utils@^2.4.0:
35333593
version "2.4.0"
35343594
resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.4.0.tgz#8b93499e9b00eab80ccb6614e69f03678e84e09a"
35353595
integrity sha512-14tltLm38Eu3zS+mt0KvILC3q8jyIAH518MlG+HO0p+yK885Lb1UHTY/UgR91eOyGdmxAPb+OLoW4znqIT6Ndw==
@@ -3560,7 +3620,24 @@ [email protected]:
35603620
read-pkg-up "^2.0.0"
35613621
resolve "^1.9.0"
35623622

3563-
3623+
eslint-plugin-import@^2.17.3:
3624+
version "2.17.3"
3625+
resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.17.3.tgz#00548b4434c18faebaba04b24ae6198f280de189"
3626+
integrity sha512-qeVf/UwXFJbeyLbxuY8RgqDyEKCkqV7YC+E5S5uOjAp4tOc8zj01JP3ucoBM8JcEqd1qRasJSg6LLlisirfy0Q==
3627+
dependencies:
3628+
array-includes "^3.0.3"
3629+
contains-path "^0.1.0"
3630+
debug "^2.6.9"
3631+
doctrine "1.5.0"
3632+
eslint-import-resolver-node "^0.3.2"
3633+
eslint-module-utils "^2.4.0"
3634+
has "^1.0.3"
3635+
lodash "^4.17.11"
3636+
minimatch "^3.0.4"
3637+
read-pkg-up "^2.0.0"
3638+
resolve "^1.11.0"
3639+
3640+
[email protected], eslint-plugin-jsx-a11y@^6.2.1:
35643641
version "6.2.1"
35653642
resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.2.1.tgz#4ebba9f339b600ff415ae4166e3e2e008831cf0c"
35663643
integrity sha512-cjN2ObWrRz0TTw7vEcGQrx+YltMvZoOEx4hWU8eEERDnBIU00OTq7Vr+jA7DFKxiwLNv4tTh5Pq2GUNEa8b6+w==
@@ -3592,6 +3669,24 @@ [email protected]:
35923669
prop-types "^15.6.2"
35933670
resolve "^1.9.0"
35943671

3672+
eslint-plugin-react@^7.13.0:
3673+
version "7.13.0"
3674+
resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.13.0.tgz#bc13fd7101de67996ea51b33873cd9dc2b7e5758"
3675+
integrity sha512-uA5LrHylu8lW/eAH3bEQe9YdzpPaFd9yAJTwTi/i/BKTD7j6aQMKVAdGM/ML72zD6womuSK7EiGtMKuK06lWjQ==
3676+
dependencies:
3677+
array-includes "^3.0.3"
3678+
doctrine "^2.1.0"
3679+
has "^1.0.3"
3680+
jsx-ast-utils "^2.1.0"
3681+
object.fromentries "^2.0.0"
3682+
prop-types "^15.7.2"
3683+
resolve "^1.10.1"
3684+
3685+
eslint-restricted-globals@^0.1.1:
3686+
version "0.1.1"
3687+
resolved "https://registry.yarnpkg.com/eslint-restricted-globals/-/eslint-restricted-globals-0.1.1.tgz#35f0d5cbc64c2e3ed62e93b4b1a7af05ba7ed4d7"
3688+
integrity sha1-NfDVy8ZMLj7WLpO0saevBbp+1Nc=
3689+
35953690
35963691
version "3.7.1"
35973692
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8"
@@ -5714,7 +5809,7 @@ jsprim@^1.2.2:
57145809
json-schema "0.2.3"
57155810
verror "1.10.0"
57165811

5717-
jsx-ast-utils@^2.0.1:
5812+
jsx-ast-utils@^2.0.1, jsx-ast-utils@^2.1.0:
57185813
version "2.1.0"
57195814
resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-2.1.0.tgz#0ee4e2c971fb9601c67b5641b71be80faecf0b36"
57205815
integrity sha512-yDGDG2DS4JcqhA6blsuYbtsT09xL8AoLuUR2Gb5exrw7UEM19sBcOTq+YBBhrNbl0PUC4R4LnFu+dHg2HKeVvA==
@@ -6516,6 +6611,16 @@ object.assign@^4.1.0:
65166611
has-symbols "^1.0.0"
65176612
object-keys "^1.0.11"
65186613

6614+
object.entries@^1.0.4:
6615+
version "1.1.0"
6616+
resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.0.tgz#2024fc6d6ba246aee38bdb0ffd5cfbcf371b7519"
6617+
integrity sha512-l+H6EQ8qzGRxbkHOd5I/aHRhHDKoQXQ8g0BYt4uSweQU1/J6dZUOyWh9a2Vky35YCKjzmgxOzta2hH6kf9HuXA==
6618+
dependencies:
6619+
define-properties "^1.1.3"
6620+
es-abstract "^1.12.0"
6621+
function-bind "^1.1.1"
6622+
has "^1.0.3"
6623+
65196624
object.fromentries@^2.0.0:
65206625
version "2.0.0"
65216626
resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.0.tgz#49a543d92151f8277b3ac9600f1e930b189d30ab"
@@ -7687,7 +7792,7 @@ prompts@^2.0.1:
76877792
kleur "^3.0.2"
76887793
sisteransi "^1.0.0"
76897794

7690-
prop-types@^15.6.2:
7795+
prop-types@^15.6.2, prop-types@^15.7.2:
76917796
version "15.7.2"
76927797
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5"
76937798
integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==
@@ -7888,7 +7993,7 @@ react-dev-utils@^9.0.1:
78887993
strip-ansi "5.2.0"
78897994
text-table "0.2.0"
78907995

7891-
7996+
react-dom@^16.8.6:
78927997
version "16.8.6"
78937998
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.8.6.tgz#71d6303f631e8b0097f56165ef608f051ff6e10f"
78947999
integrity sha512-1nL7PIq9LTL3fthPqwkvr2zY7phIPjYrT0jp4HjyEQrEROnw4dG41VVwi/wfoCneoleqrNX7iAD+pXebJZwrwA==
@@ -7968,7 +8073,7 @@ [email protected]:
79688073
optionalDependencies:
79698074
fsevents "2.0.6"
79708075

7971-
8076+
react@^16.8.6:
79728077
version "16.8.6"
79738078
resolved "https://registry.yarnpkg.com/react/-/react-16.8.6.tgz#ad6c3a9614fd3a4e9ef51117f54d888da01f2bbe"
79748079
integrity sha512-pC0uMkhLaHm11ZSJULfOBqV4tIZkx87ZLvbbQYunNixAAvjnC+snJCg0XQXn9VIsttVsbZP/H/ewzgsd5fxKXw==
@@ -8286,6 +8391,13 @@ resolve@^1.10.0, resolve@^1.3.2, resolve@^1.5.0, resolve@^1.8.1, resolve@^1.9.0:
82868391
dependencies:
82878392
path-parse "^1.0.6"
82888393

8394+
resolve@^1.10.1, resolve@^1.11.0:
8395+
version "1.11.0"
8396+
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.11.0.tgz#4014870ba296176b86343d50b60f3b50609ce232"
8397+
integrity sha512-WL2pBDjqT6pGUNSUzMw00o4T7If+z4H2x3Gz893WoUQ5KW8Vr9txp00ykiP16VBaZF5+j/OcXJHZ9+PCvdiDKw==
8398+
dependencies:
8399+
path-parse "^1.0.6"
8400+
82898401
restore-cursor@^2.0.0:
82908402
version "2.0.0"
82918403
resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf"

0 commit comments

Comments
 (0)