Skip to content

Commit 1e9947c

Browse files
committed
add: eslint and editorconfig
1 parent bad53bf commit 1e9947c

File tree

5 files changed

+117
-17
lines changed

5 files changed

+117
-17
lines changed

.editorconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2
6+
charset = utf-8
7+
trim_trailing_whitespace = true
8+
insert_final_newline = true

.eslintrc

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"parser": "babel-eslint",
3+
"extends": "airbnb",
4+
"env": {
5+
"browser": true,
6+
"jest": true
7+
},
8+
"plugins": ["react", "jsx-a11y", "import"],
9+
"rules": {
10+
"react/jsx-filename-extension": [
11+
"error",
12+
{
13+
"extensions": [".js", ".jsx"]
14+
}
15+
],
16+
"global-require": "off",
17+
"import/prefer-default-export": "off"
18+
}
19+
}

package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,11 @@
2121
"not dead",
2222
"not ie <= 11",
2323
"not op_mini all"
24-
]
24+
],
25+
"devDependencies": {
26+
"eslint-config-airbnb": "^17.1.0",
27+
"eslint-plugin-import": "^2.16.0",
28+
"eslint-plugin-jsx-a11y": "^6.2.1",
29+
"eslint-plugin-react": "^7.12.4"
30+
}
2531
}

src/App.js

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
1-
import React, { Component } from 'react';
1+
import React from 'react';
22

3-
class App extends Component {
4-
render() {
5-
return (
6-
<div className="App">
7-
<h1>Hello World</h1>
8-
</div>
9-
);
10-
}
11-
}
3+
const App = () => (
4+
<div className="App">
5+
<h1>Hello World</h1>
6+
</div>
7+
);
128

139
export default App;

yarn.lock

Lines changed: 77 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1655,7 +1655,7 @@ aws4@^1.8.0:
16551655
resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f"
16561656
integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==
16571657

1658-
axobject-query@^2.0.1:
1658+
axobject-query@^2.0.1, axobject-query@^2.0.2:
16591659
version "2.0.2"
16601660
resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-2.0.2.tgz#ea187abe5b9002b377f925d8bf7d1c561adf38f9"
16611661
integrity sha512-MCeek8ZH7hKyO1rWUbKNQBbl4l2eY0ntk7OGi+q0RlafrCnfPxC06WZA+uebCfmYp4mNU9jRBP1AhGyf8+W3ww==
@@ -3467,7 +3467,7 @@ emoji-regex@^6.5.1:
34673467
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-6.5.1.tgz#9baea929b155565c11ea41c6626eaa65cef992c2"
34683468
integrity sha512-PAHp6TxrCy7MGMFidro8uikr+zlJJKJ/Q6mm2ExZ7HwkyR9lSVFfE3kt36qcwa24BQL7y0G9axycGjK1A/0uNQ==
34693469

3470-
emoji-regex@^7.0.1:
3470+
emoji-regex@^7.0.1, emoji-regex@^7.0.2:
34713471
version "7.0.3"
34723472
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156"
34733473
integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==
@@ -3571,14 +3571,32 @@ escodegen@^1.9.1:
35713571
optionalDependencies:
35723572
source-map "~0.6.1"
35733573

3574+
eslint-config-airbnb-base@^13.1.0:
3575+
version "13.1.0"
3576+
resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-13.1.0.tgz#b5a1b480b80dfad16433d6c4ad84e6605052c05c"
3577+
integrity sha512-XWwQtf3U3zIoKO1BbHh6aUhJZQweOwSt4c2JrPDg9FP3Ltv3+YfEv7jIDB8275tVnO/qOHbfuYg3kzw6Je7uWw==
3578+
dependencies:
3579+
eslint-restricted-globals "^0.1.1"
3580+
object.assign "^4.1.0"
3581+
object.entries "^1.0.4"
3582+
3583+
eslint-config-airbnb@^17.1.0:
3584+
version "17.1.0"
3585+
resolved "https://registry.yarnpkg.com/eslint-config-airbnb/-/eslint-config-airbnb-17.1.0.tgz#3964ed4bc198240315ff52030bf8636f42bc4732"
3586+
integrity sha512-R9jw28hFfEQnpPau01NO5K/JWMGLi6aymiF6RsnMURjTk+MqZKllCqGK/0tOvHkPi/NWSSOU2Ced/GX++YxLnw==
3587+
dependencies:
3588+
eslint-config-airbnb-base "^13.1.0"
3589+
object.assign "^4.1.0"
3590+
object.entries "^1.0.4"
3591+
35743592
eslint-config-react-app@^3.0.8:
35753593
version "3.0.8"
35763594
resolved "https://registry.yarnpkg.com/eslint-config-react-app/-/eslint-config-react-app-3.0.8.tgz#6f606828ba30bafee7d744c41cd07a3fea8f3035"
35773595
integrity sha512-Ovi6Bva67OjXrom9Y/SLJRkrGqKhMAL0XCH8BizPhjEVEhYczl2ZKiNZI2CuqO5/CJwAfMwRXAVGY0KToWr1aA==
35783596
dependencies:
35793597
confusing-browser-globals "^1.0.6"
35803598

3581-
eslint-import-resolver-node@^0.3.1:
3599+
eslint-import-resolver-node@^0.3.1, eslint-import-resolver-node@^0.3.2:
35823600
version "0.3.2"
35833601
resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz#58f15fb839b8d0576ca980413476aab2472db66a"
35843602
integrity sha512-sfmTqJfPSizWu4aymbPr4Iidp5yKm8yDkHp+Ir3YiTHiiDfxh69mOUsmiqW6RZ9zRXFaF64GtYmN7e+8GHBv6Q==
@@ -3605,6 +3623,14 @@ eslint-module-utils@^2.2.0:
36053623
debug "^2.6.8"
36063624
pkg-dir "^1.0.0"
36073625

3626+
eslint-module-utils@^2.3.0:
3627+
version "2.3.0"
3628+
resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.3.0.tgz#546178dab5e046c8b562bbb50705e2456d7bda49"
3629+
integrity sha512-lmDJgeOOjk8hObTysjqH7wyMi+nsHwwvfBykwfhjR1LNdd7C2uFJBvx4OpWYpXOw4df1yE1cDEVd1yLHitk34w==
3630+
dependencies:
3631+
debug "^2.6.8"
3632+
pkg-dir "^2.0.0"
3633+
36083634
eslint-plugin-flowtype@2.50.1:
36093635
version "2.50.1"
36103636
resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.50.1.tgz#36d4c961ac8b9e9e1dc091d3fba0537dad34ae8a"
@@ -3628,6 +3654,22 @@ eslint-plugin-import@2.14.0:
36283654
read-pkg-up "^2.0.0"
36293655
resolve "^1.6.0"
36303656

3657+
eslint-plugin-import@^2.16.0:
3658+
version "2.16.0"
3659+
resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.16.0.tgz#97ac3e75d0791c4fac0e15ef388510217be7f66f"
3660+
integrity sha512-z6oqWlf1x5GkHIFgrSvtmudnqM6Q60KM4KvpWi5ubonMjycLjndvd5+8VAZIsTlHC03djdgJuyKG6XO577px6A==
3661+
dependencies:
3662+
contains-path "^0.1.0"
3663+
debug "^2.6.9"
3664+
doctrine "1.5.0"
3665+
eslint-import-resolver-node "^0.3.2"
3666+
eslint-module-utils "^2.3.0"
3667+
has "^1.0.3"
3668+
lodash "^4.17.11"
3669+
minimatch "^3.0.4"
3670+
read-pkg-up "^2.0.0"
3671+
resolve "^1.9.0"
3672+
36313673
eslint-plugin-jsx-a11y@6.1.2:
36323674
version "6.1.2"
36333675
resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.1.2.tgz#69bca4890b36dcf0fe16dd2129d2d88b98f33f88"
@@ -3642,7 +3684,21 @@ eslint-plugin-jsx-a11y@6.1.2:
36423684
has "^1.0.3"
36433685
jsx-ast-utils "^2.0.1"
36443686

3645-
eslint-plugin-react@7.12.4:
3687+
eslint-plugin-jsx-a11y@^6.2.1:
3688+
version "6.2.1"
3689+
resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.2.1.tgz#4ebba9f339b600ff415ae4166e3e2e008831cf0c"
3690+
integrity sha512-cjN2ObWrRz0TTw7vEcGQrx+YltMvZoOEx4hWU8eEERDnBIU00OTq7Vr+jA7DFKxiwLNv4tTh5Pq2GUNEa8b6+w==
3691+
dependencies:
3692+
aria-query "^3.0.0"
3693+
array-includes "^3.0.3"
3694+
ast-types-flow "^0.0.7"
3695+
axobject-query "^2.0.2"
3696+
damerau-levenshtein "^1.0.4"
3697+
emoji-regex "^7.0.2"
3698+
has "^1.0.3"
3699+
jsx-ast-utils "^2.0.1"
3700+
3701+
eslint-plugin-react@7.12.4, eslint-plugin-react@^7.12.4:
36463702
version "7.12.4"
36473703
resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.12.4.tgz#b1ecf26479d61aee650da612e425c53a99f48c8c"
36483704
integrity sha512-1puHJkXJY+oS1t467MjbqjvX53uQ05HXwjqDgdbGBqf5j9eeydI54G3KwiJmWciQ0HTBacIKw2jgwSBSH3yfgQ==
@@ -3655,6 +3711,11 @@ eslint-plugin-react@7.12.4:
36553711
prop-types "^15.6.2"
36563712
resolve "^1.9.0"
36573713

3714+
eslint-restricted-globals@^0.1.1:
3715+
version "0.1.1"
3716+
resolved "https://registry.yarnpkg.com/eslint-restricted-globals/-/eslint-restricted-globals-0.1.1.tgz#35f0d5cbc64c2e3ed62e93b4b1a7af05ba7ed4d7"
3717+
integrity sha1-NfDVy8ZMLj7WLpO0saevBbp+1Nc=
3718+
36583719
eslint-scope@3.7.1:
36593720
version "3.7.1"
36603721
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8"
@@ -6808,6 +6869,16 @@ object.assign@^4.1.0:
68086869
has-symbols "^1.0.0"
68096870
object-keys "^1.0.11"
68106871

6872+
object.entries@^1.0.4:
6873+
version "1.1.0"
6874+
resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.0.tgz#2024fc6d6ba246aee38bdb0ffd5cfbcf371b7519"
6875+
integrity sha512-l+H6EQ8qzGRxbkHOd5I/aHRhHDKoQXQ8g0BYt4uSweQU1/J6dZUOyWh9a2Vky35YCKjzmgxOzta2hH6kf9HuXA==
6876+
dependencies:
6877+
define-properties "^1.1.3"
6878+
es-abstract "^1.12.0"
6879+
function-bind "^1.1.1"
6880+
has "^1.0.3"
6881+
68116882
object.fromentries@^2.0.0:
68126883
version "2.0.0"
68136884
resolved "https://registry.yarnpkg.com/object.fromentries/-/object.fromentries-2.0.0.tgz#49a543d92151f8277b3ac9600f1e930b189d30ab"
@@ -8205,7 +8276,7 @@ react-dev-utils@^8.0.0:
82058276
strip-ansi "5.0.0"
82068277
text-table "0.2.0"
82078278

8208-
react-dom@16.8.5:
8279+
react-dom@^16.8.5:
82098280
version "16.8.5"
82108281
resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-16.8.5.tgz#b3e37d152b49e07faaa8de41fdf562be3463335e"
82118282
integrity sha512-VIEIvZLpFafsfu4kgmftP5L8j7P1f0YThfVTrANMhZUFMDOsA6e0kfR6wxw/8xxKs4NB59TZYbxNdPCDW34x4w==
@@ -8274,7 +8345,7 @@ react-scripts@2.1.8:
82748345
optionalDependencies:
82758346
fsevents "1.2.4"
82768347

8277-
react@16.8.5:
8348+
react@^16.8.5:
82788349
version "16.8.5"
82798350
resolved "https://registry.yarnpkg.com/react/-/react-16.8.5.tgz#49be3b655489d74504ad994016407e8a0445de66"
82808351
integrity sha512-daCb9TD6FZGvJ3sg8da1tRAtIuw29PbKZW++NN4wqkbEvxL+bZpaaYb4xuftW/SpXmgacf1skXl/ddX6CdOlDw==

0 commit comments

Comments
 (0)