Skip to content

Commit d89c9a1

Browse files
Use Airbnb's ESLint rules
Configure import linter to work with TypeScript.
1 parent d9248ea commit d89c9a1

File tree

3 files changed

+163
-14
lines changed

3 files changed

+163
-14
lines changed

.eslintrc.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
11
{
22
"parser": "@typescript-eslint/parser",
33
"extends": [
4-
"eslint:recommended",
4+
"airbnb-base",
55
"plugin:@typescript-eslint/eslint-recommended",
66
"plugin:@typescript-eslint/recommended",
77
"prettier",
88
"prettier/@typescript-eslint"
99
],
1010
"parserOptions": {
1111
"ecmaVersion": 2018
12+
},
13+
"settings": {
14+
"import/parsers": {
15+
"@typescript-eslint/parser": [
16+
".ts"
17+
]
18+
},
19+
"import/resolver": {
20+
"typescript": {}
21+
}
1222
}
1323
}

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,11 @@
5252
"@types/jest": "^23.3.1",
5353
"@typescript-eslint/eslint-plugin": "^2.2.0",
5454
"@typescript-eslint/parser": "^2.2.0",
55-
"eslint": "^6.3.0",
55+
"eslint": "6.1.0",
56+
"eslint-config-airbnb-base": "14.0.0",
5657
"eslint-config-prettier": "^6.3.0",
58+
"eslint-import-resolver-typescript": "^1.1.1",
59+
"eslint-plugin-import": "^2.18.2",
5760
"husky": "^0.14.3",
5861
"jest": "^23.4.1",
5962
"prettier": "^1.13.7",

yarn.lock

Lines changed: 148 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,11 @@
711711
resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.3.tgz#bdfd69d61e464dcc81b25159c270d75a73c1a636"
712712
integrity sha512-Il2DtDVRGDcqjDtE+rF8iqg1CArehSK84HZJCT7AMITlyXRBpuPhqGLDQMowraqqu1coEaimg4ZOqggt6L6L+A==
713713

714+
"@types/json5@^0.0.29":
715+
version "0.0.29"
716+
resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee"
717+
integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4=
718+
714719
"@typescript-eslint/eslint-plugin@^2.2.0":
715720
version "2.2.0"
716721
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-2.2.0.tgz#cba8caa6ad8df544c46bca674125a31af8c9ac2f"
@@ -1108,6 +1113,14 @@ array-find-index@^1.0.1:
11081113
resolved "https://registry.yarnpkg.com/array-find-index/-/array-find-index-1.0.2.tgz#df010aa1287e164bbda6f9723b0a96a1ec4187a1"
11091114
integrity sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=
11101115

1116+
array-includes@^3.0.3:
1117+
version "3.0.3"
1118+
resolved "https://registry.yarnpkg.com/array-includes/-/array-includes-3.0.3.tgz#184b48f62d92d7452bb31b323165c7f8bd02266d"
1119+
integrity sha1-GEtI9i2S10UrsxsyMWXH+L0CJm0=
1120+
dependencies:
1121+
define-properties "^1.1.2"
1122+
es-abstract "^1.7.0"
1123+
11111124
array-union@^1.0.2:
11121125
version "1.0.2"
11131126
resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39"
@@ -1893,6 +1906,11 @@ configstore@^3.0.0:
18931906
write-file-atomic "^2.0.0"
18941907
xdg-basedir "^3.0.0"
18951908

1909+
confusing-browser-globals@^1.0.7:
1910+
version "1.0.8"
1911+
resolved "https://registry.yarnpkg.com/confusing-browser-globals/-/confusing-browser-globals-1.0.8.tgz#93ffec1f82a6e2bf2bc36769cc3a92fa20e502f3"
1912+
integrity sha512-lI7asCibVJ6Qd3FGU7mu4sfG4try4LX3+GVS+Gv8UlrEf2AeW57piecapnog2UHZSbcX/P/1UDWVaTsblowlZg==
1913+
18961914
console-browserify@^1.1.0:
18971915
version "1.1.0"
18981916
resolved "https://registry.yarnpkg.com/console-browserify/-/console-browserify-1.1.0.tgz#f0241c45730a9fc6323b206dbf38edc741d0bb10"
@@ -1910,6 +1928,11 @@ constants-browserify@^1.0.0:
19101928
resolved "https://registry.yarnpkg.com/constants-browserify/-/constants-browserify-1.0.0.tgz#c20b96d8c617748aaf1c16021760cd27fcb8cb75"
19111929
integrity sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=
19121930

1931+
contains-path@^0.1.0:
1932+
version "0.1.0"
1933+
resolved "https://registry.yarnpkg.com/contains-path/-/contains-path-0.1.0.tgz#fe8cf184ff6670b6baef01a9d4861a5cbec4120a"
1934+
integrity sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=
1935+
19131936
convert-source-map@^1.1.0, convert-source-map@^1.4.0, convert-source-map@^1.5.1:
19141937
version "1.6.0"
19151938
resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.6.0.tgz#51b537a8c43e0f04dec1993bffcdd504e758ac20"
@@ -2243,6 +2266,14 @@ diffie-hellman@^5.0.0:
22432266
miller-rabin "^4.0.0"
22442267
randombytes "^2.0.0"
22452268

2269+
doctrine@1.5.0:
2270+
version "1.5.0"
2271+
resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-1.5.0.tgz#379dce730f6166f76cefa4e6707a159b02c5a6fa"
2272+
integrity sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=
2273+
dependencies:
2274+
esutils "^2.0.2"
2275+
isarray "^1.0.0"
2276+
22462277
doctrine@^3.0.0:
22472278
version "3.0.0"
22482279
resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961"
@@ -2350,7 +2381,7 @@ error-ex@^1.2.0, error-ex@^1.3.1:
23502381
dependencies:
23512382
is-arrayish "^0.2.1"
23522383

2353-
es-abstract@^1.12.0, es-abstract@^1.5.1:
2384+
es-abstract@^1.12.0, es-abstract@^1.5.1, es-abstract@^1.7.0:
23542385
version "1.14.2"
23552386
resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.14.2.tgz#7ce108fad83068c8783c3cdf62e504e084d8c497"
23562387
integrity sha512-DgoQmbpFNOofkjJtKwr87Ma5EW4Dc8fWhD0R+ndq7Oc456ivUfGOOP6oAZTTKl5/CcNMP+EN+e3/iUzgE0veZg==
@@ -2418,13 +2449,64 @@ escodegen@^1.9.1:
24182449
optionalDependencies:
24192450
source-map "~0.6.1"
24202451

2452+
eslint-config-airbnb-base@14.0.0:
2453+
version "14.0.0"
2454+
resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-14.0.0.tgz#8a7bcb9643d13c55df4dd7444f138bf4efa61e17"
2455+
integrity sha512-2IDHobw97upExLmsebhtfoD3NAKhV4H0CJWP3Uprd/uk+cHuWYOczPVxQ8PxLFUAw7o3Th1RAU8u1DoUpr+cMA==
2456+
dependencies:
2457+
confusing-browser-globals "^1.0.7"
2458+
object.assign "^4.1.0"
2459+
object.entries "^1.1.0"
2460+
24212461
eslint-config-prettier@^6.3.0:
24222462
version "6.3.0"
24232463
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-6.3.0.tgz#e73b48e59dc49d950843f3eb96d519e2248286a3"
24242464
integrity sha512-EWaGjlDAZRzVFveh2Jsglcere2KK5CJBhkNSa1xs3KfMUGdRiT7lG089eqPdvlzWHpAqaekubOsOMu8W8Yk71A==
24252465
dependencies:
24262466
get-stdin "^6.0.0"
24272467

2468+
eslint-import-resolver-node@^0.3.2:
2469+
version "0.3.2"
2470+
resolved "https://registry.yarnpkg.com/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz#58f15fb839b8d0576ca980413476aab2472db66a"
2471+
integrity sha512-sfmTqJfPSizWu4aymbPr4Iidp5yKm8yDkHp+Ir3YiTHiiDfxh69mOUsmiqW6RZ9zRXFaF64GtYmN7e+8GHBv6Q==
2472+
dependencies:
2473+
debug "^2.6.9"
2474+
resolve "^1.5.0"
2475+
2476+
eslint-import-resolver-typescript@^1.1.1:
2477+
version "1.1.1"
2478+
resolved "https://registry.yarnpkg.com/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-1.1.1.tgz#e6d42172b95144ef16610fe104ef38340edea591"
2479+
integrity sha512-jqSfumQ+H5y3FUJ6NjRkbOQSUOlbBucGTN3ELymOtcDBbPjVdm/luvJuCfCaIXGh8sEF26ma1qVdtDgl9ndhUg==
2480+
dependencies:
2481+
debug "^4.0.1"
2482+
resolve "^1.4.0"
2483+
tsconfig-paths "^3.6.0"
2484+
2485+
eslint-module-utils@^2.4.0:
2486+
version "2.4.1"
2487+
resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.4.1.tgz#7b4675875bf96b0dbf1b21977456e5bb1f5e018c"
2488+
integrity sha512-H6DOj+ejw7Tesdgbfs4jeS4YMFrT8uI8xwd1gtQqXssaR0EQ26L+2O/w6wkYFy2MymON0fTwHmXBvvfLNZVZEw==
2489+
dependencies:
2490+
debug "^2.6.8"
2491+
pkg-dir "^2.0.0"
2492+
2493+
eslint-plugin-import@^2.18.2:
2494+
version "2.18.2"
2495+
resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.18.2.tgz#02f1180b90b077b33d447a17a2326ceb400aceb6"
2496+
integrity sha512-5ohpsHAiUBRNaBWAF08izwUGlbrJoJJ+W9/TBwsGoR1MnlgfwMIKrFeSjWbt6moabiXW9xNvtFz+97KHRfI4HQ==
2497+
dependencies:
2498+
array-includes "^3.0.3"
2499+
contains-path "^0.1.0"
2500+
debug "^2.6.9"
2501+
doctrine "1.5.0"
2502+
eslint-import-resolver-node "^0.3.2"
2503+
eslint-module-utils "^2.4.0"
2504+
has "^1.0.3"
2505+
minimatch "^3.0.4"
2506+
object.values "^1.1.0"
2507+
read-pkg-up "^2.0.0"
2508+
resolve "^1.11.0"
2509+
24282510
eslint-scope@^4.0.3:
24292511
version "4.0.3"
24302512
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-4.0.3.tgz#ca03833310f6889a3264781aa82e63eb9cfe7848"
@@ -2441,7 +2523,7 @@ eslint-scope@^5.0.0:
24412523
esrecurse "^4.1.0"
24422524
estraverse "^4.1.1"
24432525

2444-
eslint-utils@^1.4.2:
2526+
eslint-utils@^1.3.1, eslint-utils@^1.4.2:
24452527
version "1.4.2"
24462528
resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-1.4.2.tgz#166a5180ef6ab7eb462f162fd0e6f2463d7309ab"
24472529
integrity sha512-eAZS2sEUMlIeCjBeubdj45dmBHQwPHWyBcT1VSYB7o9x9WRRqKxyUoiXlRjyAwzN7YEzHJlYg0NmzDRWx6GP4Q==
@@ -2453,10 +2535,10 @@ eslint-visitor-keys@^1.0.0, eslint-visitor-keys@^1.1.0:
24532535
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.1.0.tgz#e2a82cea84ff246ad6fb57f9bde5b46621459ec2"
24542536
integrity sha512-8y9YjtM1JBJU/A9Kc+SbaOV4y29sSWckBwMHa+FGtVj5gN/sbnKDf6xJUl+8g7FAij9LVaP8C24DUiH/f/2Z9A==
24552537

2456-
eslint@^6.3.0:
2457-
version "6.3.0"
2458-
resolved "https://registry.yarnpkg.com/eslint/-/eslint-6.3.0.tgz#1f1a902f67bfd4c354e7288b81e40654d927eb6a"
2459-
integrity sha512-ZvZTKaqDue+N8Y9g0kp6UPZtS4FSY3qARxBs7p4f0H0iof381XHduqVerFWtK8DPtKmemqbqCFENWSQgPR/Gow==
2538+
eslint@6.1.0:
2539+
version "6.1.0"
2540+
resolved "https://registry.yarnpkg.com/eslint/-/eslint-6.1.0.tgz#06438a4a278b1d84fb107d24eaaa35471986e646"
2541+
integrity sha512-QhrbdRD7ofuV09IuE2ySWBz0FyXCq0rriLTZXZqaWSI79CVtHVRdkFuFTViiqzZhkCgfOh9USpriuGN2gIpZDQ==
24602542
dependencies:
24612543
"@babel/code-frame" "^7.0.0"
24622544
ajv "^6.10.0"
@@ -2465,9 +2547,9 @@ eslint@^6.3.0:
24652547
debug "^4.0.1"
24662548
doctrine "^3.0.0"
24672549
eslint-scope "^5.0.0"
2468-
eslint-utils "^1.4.2"
2469-
eslint-visitor-keys "^1.1.0"
2470-
espree "^6.1.1"
2550+
eslint-utils "^1.3.1"
2551+
eslint-visitor-keys "^1.0.0"
2552+
espree "^6.0.0"
24712553
esquery "^1.0.1"
24722554
esutils "^2.0.2"
24732555
file-entry-cache "^5.0.1"
@@ -2496,7 +2578,7 @@ eslint@^6.3.0:
24962578
text-table "^0.2.0"
24972579
v8-compile-cache "^2.0.3"
24982580

2499-
espree@^6.1.1:
2581+
espree@^6.0.0:
25002582
version "6.1.1"
25012583
resolved "https://registry.yarnpkg.com/espree/-/espree-6.1.1.tgz#7f80e5f7257fc47db450022d723e356daeb1e5de"
25022584
integrity sha512-EYbr8XZUhWbYCqQRW0duU5LxzL5bETN6AjKBGy1302qqzPaCH10QbRg3Wvco79Z8x9WbiE8HYB4e75xl6qUYvQ==
@@ -4228,6 +4310,16 @@ load-json-file@^1.0.0:
42284310
pinkie-promise "^2.0.0"
42294311
strip-bom "^2.0.0"
42304312

4313+
load-json-file@^2.0.0:
4314+
version "2.0.0"
4315+
resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-2.0.0.tgz#7947e42149af80d696cbf797bcaabcfe1fe29ca8"
4316+
integrity sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=
4317+
dependencies:
4318+
graceful-fs "^4.1.2"
4319+
parse-json "^2.2.0"
4320+
pify "^2.0.0"
4321+
strip-bom "^3.0.0"
4322+
42314323
load-json-file@^4.0.0:
42324324
version "4.0.0"
42334325
resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-4.0.0.tgz#2f5f45ab91e33216234fd53adab668eb4ec0993b"
@@ -4886,6 +4978,16 @@ object.assign@^4.1.0:
48864978
has-symbols "^1.0.0"
48874979
object-keys "^1.0.11"
48884980

4981+
object.entries@^1.1.0:
4982+
version "1.1.0"
4983+
resolved "https://registry.yarnpkg.com/object.entries/-/object.entries-1.1.0.tgz#2024fc6d6ba246aee38bdb0ffd5cfbcf371b7519"
4984+
integrity sha512-l+H6EQ8qzGRxbkHOd5I/aHRhHDKoQXQ8g0BYt4uSweQU1/J6dZUOyWh9a2Vky35YCKjzmgxOzta2hH6kf9HuXA==
4985+
dependencies:
4986+
define-properties "^1.1.3"
4987+
es-abstract "^1.12.0"
4988+
function-bind "^1.1.1"
4989+
has "^1.0.3"
4990+
48894991
object.getownpropertydescriptors@^2.0.3:
48904992
version "2.0.3"
48914993
resolved "https://registry.yarnpkg.com/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz#8758c846f5b407adab0f236e0986f14b051caa16"
@@ -4909,7 +5011,7 @@ object.pick@^1.3.0:
49095011
dependencies:
49105012
isobject "^3.0.1"
49115013

4912-
object.values@^1.0.4:
5014+
object.values@^1.0.4, object.values@^1.1.0:
49135015
version "1.1.0"
49145016
resolved "https://registry.yarnpkg.com/object.values/-/object.values-1.1.0.tgz#bf6810ef5da3e5325790eaaa2be213ea84624da9"
49155017
integrity sha512-8mf0nKLAoFX6VlNVdhGj31SVYpaNFtUnuoOXWyFEstsWRgU837AK+JYM0iAxwkSzGRbwn8cbFmgbyxj1j4VbXg==
@@ -5185,6 +5287,13 @@ path-type@^1.0.0:
51855287
pify "^2.0.0"
51865288
pinkie-promise "^2.0.0"
51875289

5290+
path-type@^2.0.0:
5291+
version "2.0.0"
5292+
resolved "https://registry.yarnpkg.com/path-type/-/path-type-2.0.0.tgz#f012ccb8415b7096fc2daa1054c3d72389594c73"
5293+
integrity sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=
5294+
dependencies:
5295+
pify "^2.0.0"
5296+
51885297
path-type@^3.0.0:
51895298
version "3.0.0"
51905299
resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f"
@@ -5473,6 +5582,14 @@ read-pkg-up@^1.0.1:
54735582
find-up "^1.0.0"
54745583
read-pkg "^1.0.0"
54755584

5585+
read-pkg-up@^2.0.0:
5586+
version "2.0.0"
5587+
resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-2.0.0.tgz#6b72a8048984e0c41e79510fd5e9fa99b3b549be"
5588+
integrity sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=
5589+
dependencies:
5590+
find-up "^2.0.0"
5591+
read-pkg "^2.0.0"
5592+
54765593
read-pkg-up@^3.0.0:
54775594
version "3.0.0"
54785595
resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-3.0.0.tgz#3ed496685dba0f8fe118d0691dc51f4a1ff96f07"
@@ -5490,6 +5607,15 @@ read-pkg@^1.0.0:
54905607
normalize-package-data "^2.3.2"
54915608
path-type "^1.0.0"
54925609

5610+
read-pkg@^2.0.0:
5611+
version "2.0.0"
5612+
resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-2.0.0.tgz#8ef1c0623c6a6db0dc6713c4bfac46332b2368f8"
5613+
integrity sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=
5614+
dependencies:
5615+
load-json-file "^2.0.0"
5616+
normalize-package-data "^2.3.2"
5617+
path-type "^2.0.0"
5618+
54935619
read-pkg@^3.0.0:
54945620
version "3.0.0"
54955621
resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-3.0.0.tgz#9cbc686978fee65d16c00e2b19c237fcf6e38389"
@@ -5725,7 +5851,7 @@ resolve@1.1.7:
57255851
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b"
57265852
integrity sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=
57275853

5728-
resolve@1.x, resolve@^1.10.0, resolve@^1.3.2, resolve@^1.6.0:
5854+
resolve@1.x, resolve@^1.10.0, resolve@^1.11.0, resolve@^1.3.2, resolve@^1.4.0, resolve@^1.5.0, resolve@^1.6.0:
57295855
version "1.12.0"
57305856
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.12.0.tgz#3fc644a35c84a48554609ff26ec52b66fa577df6"
57315857
integrity sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w==
@@ -6489,6 +6615,16 @@ ts-loader@^5.0.0:
64896615
micromatch "^3.1.4"
64906616
semver "^5.0.1"
64916617

6618+
tsconfig-paths@^3.6.0:
6619+
version "3.9.0"
6620+
resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.9.0.tgz#098547a6c4448807e8fcb8eae081064ee9a3c90b"
6621+
integrity sha512-dRcuzokWhajtZWkQsDVKbWyY+jgcLC5sqJhg2PSgf4ZkH2aHPvaOY8YWGhmjb68b5qqTfasSsDO9k7RUiEmZAw==
6622+
dependencies:
6623+
"@types/json5" "^0.0.29"
6624+
json5 "^1.0.1"
6625+
minimist "^1.2.0"
6626+
strip-bom "^3.0.0"
6627+
64926628
tslib@^1.8.1, tslib@^1.9.0:
64936629
version "1.10.0"
64946630
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a"

0 commit comments

Comments
 (0)