Skip to content

Commit b767c3d

Browse files
committed
🔧(eslint) update eslint configuration to resolve aliased paths
Finally, we have to update our eslint configuration to be able to resolve those aliased paths. To ease this process and maintenance, we decided to install eslint-import-resolver-typescript package to tell eslint to resolve paths according to the typescript configuration.
1 parent da7703e commit b767c3d

File tree

7 files changed

+129
-3
lines changed

7 files changed

+129
-3
lines changed

.eslintignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
**/node_modules
2-
dist
2+
**/dist

.eslintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
"jsx": true
3737
}
3838
},
39+
"root": true,
3940
"env": {
4041
"browser": true,
4142
"es6": true,

examples/playground/.eslintrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,10 @@
33
{
44
"rules": {
55
"no-console": "off"
6+
},
7+
"settings": {
8+
"import/resolver": {
9+
"typescript": {}
10+
}
611
}
712
}

examples/playground/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
"@vitejs/plugin-react": "2.0.0",
2828
"eslint": "8.20.0",
2929
"eslint-config-prettier": "8.5.0",
30+
"eslint-import-resolver-typescript": "3.3.0",
3031
"eslint-plugin-compat": "4.0.2",
3132
"eslint-plugin-import": "2.26.0",
3233
"eslint-plugin-jsx-a11y": "6.6.0",

lib/.eslintrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"settings": {
3+
"import/resolver": {
4+
"typescript": {}
5+
}
6+
}
7+
}

lib/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
"@vitejs/plugin-react": "2.0.0",
7272
"eslint": "8.20.0",
7373
"eslint-config-prettier": "8.5.0",
74+
"eslint-import-resolver-typescript": "3.3.0",
7475
"eslint-plugin-compat": "4.0.2",
7576
"eslint-plugin-import": "2.26.0",
7677
"eslint-plugin-jsx-a11y": "6.6.0",

yarn.lock

Lines changed: 113 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1412,6 +1412,18 @@
14121412
"@nodelib/fs.scandir" "2.1.5"
14131413
fastq "^1.6.0"
14141414

1415+
"@pkgr/utils@^2.3.0":
1416+
version "2.3.0"
1417+
resolved "https://registry.yarnpkg.com/@pkgr/utils/-/utils-2.3.0.tgz#3b8491f112a80839450498816767eb03b7db6139"
1418+
integrity sha512-7dIJ9CRVzBnqyEl7diUHPUFJf/oty2SeoVzcMocc5PeOUDK9KGzvgIBjGRRzzlRDaOjh3ADwH0WeibQvi3ls2Q==
1419+
dependencies:
1420+
cross-spawn "^7.0.3"
1421+
is-glob "^4.0.3"
1422+
open "^8.4.0"
1423+
picocolors "^1.0.0"
1424+
tiny-glob "^0.2.9"
1425+
tslib "^2.4.0"
1426+
14151427
14161428
version "4.2.2"
14171429
resolved "https://registry.yarnpkg.com/@rjsf/core/-/core-4.2.2.tgz#cd8ee65f0c87cba05d7dd978282141ca97df003d"
@@ -2550,6 +2562,11 @@ deepmerge@^4.2.2:
25502562
resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.2.2.tgz#44d2ea3679b8f4d4ffba33f03d865fc1e7bf4955"
25512563
integrity sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==
25522564

2565+
define-lazy-prop@^2.0.0:
2566+
version "2.0.0"
2567+
resolved "https://registry.yarnpkg.com/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz#3f7ae421129bcaaac9bc74905c98a0009ec9ee7f"
2568+
integrity sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==
2569+
25532570
define-properties@^1.1.3, define-properties@^1.1.4:
25542571
version "1.1.4"
25552572
resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.4.tgz#0b14d7bd7fbeb2f3572c3a7eda80ea5d57fb05b1"
@@ -2626,6 +2643,14 @@ emoji-regex@^9.2.2:
26262643
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-9.2.2.tgz#840c8803b0d8047f4ff0cf963176b32d4ef3ed72"
26272644
integrity sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==
26282645

2646+
enhanced-resolve@^5.10.0:
2647+
version "5.10.0"
2648+
resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.10.0.tgz#0dc579c3bb2a1032e357ac45b8f3a6f3ad4fb1e6"
2649+
integrity sha512-T0yTFjdpldGY8PmuXXR0PyQ1ufZpEGiHVrp7zHKB7jdR4qlmZHhONVM5AQOAWXuF/w3dnHbEQVrNptJgt7F+cQ==
2650+
dependencies:
2651+
graceful-fs "^4.2.4"
2652+
tapable "^2.2.0"
2653+
26292654
error-ex@^1.3.1:
26302655
version "1.3.2"
26312656
resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf"
@@ -2849,6 +2874,19 @@ eslint-import-resolver-node@^0.3.6:
28492874
debug "^3.2.7"
28502875
resolve "^1.20.0"
28512876

2877+
2878+
version "3.3.0"
2879+
resolved "https://registry.yarnpkg.com/eslint-import-resolver-typescript/-/eslint-import-resolver-typescript-3.3.0.tgz#c2b9f420563bdcb4b84d550d81e579f8dc867d5b"
2880+
integrity sha512-vlooCGKfDX59rH5TbtluOekinPlIS5Ab+dyQUoCCJoE1IV11R/kn6J+RoMBuBkJhzJEIKJ4myQJhw6lGIXfkRA==
2881+
dependencies:
2882+
debug "^4.3.4"
2883+
enhanced-resolve "^5.10.0"
2884+
get-tsconfig "^4.2.0"
2885+
globby "^13.1.2"
2886+
is-core-module "^2.9.0"
2887+
is-glob "^4.0.3"
2888+
synckit "^0.8.1"
2889+
28522890
eslint-module-utils@^2.7.3:
28532891
version "2.7.3"
28542892
resolved "https://registry.yarnpkg.com/eslint-module-utils/-/eslint-module-utils-2.7.3.tgz#ad7e3a10552fdd0642e1e55292781bd6e34876ee"
@@ -3282,6 +3320,11 @@ get-symbol-description@^1.0.0:
32823320
call-bind "^1.0.2"
32833321
get-intrinsic "^1.1.1"
32843322

3323+
get-tsconfig@^4.2.0:
3324+
version "4.2.0"
3325+
resolved "https://registry.yarnpkg.com/get-tsconfig/-/get-tsconfig-4.2.0.tgz#ff368dd7104dab47bf923404eb93838245c66543"
3326+
integrity sha512-X8u8fREiYOE6S8hLbq99PeykTDoLVnxvF4DjWKJmz9xy2nNRdUcV8ZN9tniJFeKyTU3qnC9lL8n4Chd6LmVKHg==
3327+
32853328
glob-parent@^5.1.2, glob-parent@~5.1.2:
32863329
version "5.1.2"
32873330
resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4"
@@ -3336,6 +3379,11 @@ globals@^13.15.0:
33363379
dependencies:
33373380
type-fest "^0.20.2"
33383381

3382+
3383+
version "0.1.0"
3384+
resolved "https://registry.yarnpkg.com/globalyzer/-/globalyzer-0.1.0.tgz#cb76da79555669a1519d5a8edf093afaa0bf1465"
3385+
integrity sha512-40oNTM9UfG6aBmuKxk/giHn5nQ8RVz/SS4Ir6zgzOv9/qC3kKZ9v4etGTcJbEl/NyVQH7FGU7d+X1egr57Md2Q==
3386+
33393387
globby@^11.1.0:
33403388
version "11.1.0"
33413389
resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b"
@@ -3348,12 +3396,28 @@ globby@^11.1.0:
33483396
merge2 "^1.4.1"
33493397
slash "^3.0.0"
33503398

3399+
globby@^13.1.2:
3400+
version "13.1.2"
3401+
resolved "https://registry.yarnpkg.com/globby/-/globby-13.1.2.tgz#29047105582427ab6eca4f905200667b056da515"
3402+
integrity sha512-LKSDZXToac40u8Q1PQtZihbNdTYSNMuWe+K5l+oa6KgDzSvVrHXlJy40hUP522RjAIoNLJYBJi7ow+rbFpIhHQ==
3403+
dependencies:
3404+
dir-glob "^3.0.1"
3405+
fast-glob "^3.2.11"
3406+
ignore "^5.2.0"
3407+
merge2 "^1.4.1"
3408+
slash "^4.0.0"
3409+
33513410
globjoin@^0.1.4:
33523411
version "0.1.4"
33533412
resolved "https://registry.yarnpkg.com/globjoin/-/globjoin-0.1.4.tgz#2f4494ac8919e3767c5cbb691e9f463324285d43"
33543413
integrity sha512-xYfnw62CKG8nLkZBfWbhWwDw02CHty86jfPcc2cr3ZfeuK9ysoVPPEUxf21bAD/rWAgk52SuBrLJlefNy8mvFg==
33553414

3356-
graceful-fs@^4.2.9:
3415+
globrex@^0.1.2:
3416+
version "0.1.2"
3417+
resolved "https://registry.yarnpkg.com/globrex/-/globrex-0.1.2.tgz#dd5d9ec826232730cd6793a5e33a9302985e6098"
3418+
integrity sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==
3419+
3420+
graceful-fs@^4.2.4, graceful-fs@^4.2.9:
33573421
version "4.2.10"
33583422
resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c"
33593423
integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==
@@ -3593,6 +3657,11 @@ is-date-object@^1.0.1:
35933657
dependencies:
35943658
has-tostringtag "^1.0.0"
35953659

3660+
is-docker@^2.0.0, is-docker@^2.1.1:
3661+
version "2.2.1"
3662+
resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.2.1.tgz#33eeabe23cfe86f14bde4408a02c0cfb853acdaa"
3663+
integrity sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==
3664+
35963665
is-extglob@^2.1.1:
35973666
version "2.1.1"
35983667
resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2"
@@ -3693,6 +3762,13 @@ is-weakref@^1.0.2:
36933762
dependencies:
36943763
call-bind "^1.0.2"
36953764

3765+
is-wsl@^2.2.0:
3766+
version "2.2.0"
3767+
resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-2.2.0.tgz#74a4c76e77ca9fd3f932f290c17ea326cd157271"
3768+
integrity sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==
3769+
dependencies:
3770+
is-docker "^2.0.0"
3771+
36963772
isexe@^2.0.0:
36973773
version "2.0.0"
36983774
resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"
@@ -4646,6 +4722,15 @@ onetime@^5.1.2:
46464722
dependencies:
46474723
mimic-fn "^2.1.0"
46484724

4725+
open@^8.4.0:
4726+
version "8.4.0"
4727+
resolved "https://registry.yarnpkg.com/open/-/open-8.4.0.tgz#345321ae18f8138f82565a910fdc6b39e8c244f8"
4728+
integrity sha512-XgFPPM+B28FtCCgSb9I+s9szOC1vZRSwgWsRUA5ylIxRTgKozqjOCrVOqGsYABPYK5qnfqClxZTFBa8PKt2v6Q==
4729+
dependencies:
4730+
define-lazy-prop "^2.0.0"
4731+
is-docker "^2.1.1"
4732+
is-wsl "^2.2.0"
4733+
46494734
optionator@^0.8.1:
46504735
version "0.8.3"
46514736
resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495"
@@ -5272,6 +5357,11 @@ slash@^3.0.0:
52725357
resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634"
52735358
integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==
52745359

5360+
slash@^4.0.0:
5361+
version "4.0.0"
5362+
resolved "https://registry.yarnpkg.com/slash/-/slash-4.0.0.tgz#2422372176c4c6c5addb5e2ada885af984b396a7"
5363+
integrity sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==
5364+
52755365
slice-ansi@^4.0.0:
52765366
version "4.0.0"
52775367
resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-4.0.0.tgz#500e8dd0fd55b05815086255b3195adf2a45fe6b"
@@ -5581,6 +5671,14 @@ symbol-tree@^3.2.4:
55815671
resolved "https://registry.yarnpkg.com/symbol-tree/-/symbol-tree-3.2.4.tgz#430637d248ba77e078883951fb9aa0eed7c63fa2"
55825672
integrity sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==
55835673

5674+
synckit@^0.8.1:
5675+
version "0.8.1"
5676+
resolved "https://registry.yarnpkg.com/synckit/-/synckit-0.8.1.tgz#697111240114a15a393fcb92786a4218bfead47f"
5677+
integrity sha512-rJEeygO5PNmcZICmrgnbOd2usi5zWE1ESc0Gn5tTmJlongoU8zCTwMFQtar2UgMSiR68vK9afPQ+uVs2lURSIA==
5678+
dependencies:
5679+
"@pkgr/utils" "^2.3.0"
5680+
tslib "^2.4.0"
5681+
55845682
table@^6.8.0:
55855683
version "6.8.0"
55865684
resolved "https://registry.yarnpkg.com/table/-/table-6.8.0.tgz#87e28f14fa4321c3377ba286f07b79b281a3b3ca"
@@ -5592,6 +5690,11 @@ table@^6.8.0:
55925690
string-width "^4.2.3"
55935691
strip-ansi "^6.0.1"
55945692

5693+
tapable@^2.2.0:
5694+
version "2.2.1"
5695+
resolved "https://registry.yarnpkg.com/tapable/-/tapable-2.2.1.tgz#1967a73ef4060a82f12ab96af86d52fdb76eeca0"
5696+
integrity sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==
5697+
55955698
terminal-link@^2.0.0:
55965699
version "2.1.1"
55975700
resolved "https://registry.yarnpkg.com/terminal-link/-/terminal-link-2.1.1.tgz#14a64a27ab3c0df933ea546fba55f2d078edc994"
@@ -5614,6 +5717,14 @@ text-table@^0.2.0:
56145717
resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4"
56155718
integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==
56165719

5720+
tiny-glob@^0.2.9:
5721+
version "0.2.9"
5722+
resolved "https://registry.yarnpkg.com/tiny-glob/-/tiny-glob-0.2.9.tgz#2212d441ac17928033b110f8b3640683129d31e2"
5723+
integrity sha512-g/55ssRPUjShh+xkfx9UPDXqhckHEsHr4Vd9zX55oSdGZc/MD0m3sferOkwWtp98bv+kcVfEHtRJgBVJzelrzg==
5724+
dependencies:
5725+
globalyzer "0.1.0"
5726+
globrex "^0.1.2"
5727+
56175728
56185729
version "1.0.5"
56195730
resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.5.tgz#8683e0b902bb9c20c4f726e3c0b69f36518c07cc"
@@ -5667,7 +5778,7 @@ tsconfig-paths@^3.14.1:
56675778
minimist "^1.2.6"
56685779
strip-bom "^3.0.0"
56695780

5670-
[email protected], tslib@^2.1.0:
5781+
[email protected], tslib@^2.1.0, tslib@^2.4.0:
56715782
version "2.4.0"
56725783
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.0.tgz#7cecaa7f073ce680a05847aa77be941098f36dc3"
56735784
integrity sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==

0 commit comments

Comments
 (0)