Skip to content

Commit

Permalink
Add ESLint typescript resolver to fix exports issue
Browse files Browse the repository at this point in the history
ESLint's import plugin doesn't support package.json `exports` definitions
out of the box. There's a longstanding issue to fix it but the recommendation
is to use the eslint typescript resolver that solves the problem. This repo
doesn't use typescript but adding the resolver with zero configuration
fixes things and adds minimal bloat.

See import-js/eslint-plugin-import#1810
See https://github.com/import-js/eslint-import-resolver-typescript
  • Loading branch information
contolini committed Dec 4, 2024
1 parent ad2f631 commit e85a73c
Show file tree
Hide file tree
Showing 11 changed files with 85 additions and 1 deletion.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export default [
paths: ['src'],
extensions: ['.js', '.ts', '.d.ts', '.tsx'],
},
typescript: {},
},
react: {
version: 'detect',
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
"esbuild-plugin-liquid": "0.2.0",
"eslint": "9.16.0",
"eslint-config-prettier": "9.1.0",
"eslint-import-resolver-typescript": "3.7.0",
"eslint-plugin-cypress": "4.1.0",
"eslint-plugin-import": "2.31.0",
"eslint-plugin-jsdoc": "50.6.0",
Expand Down
84 changes: 83 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1528,6 +1528,13 @@ __metadata:
languageName: node
linkType: hard

"@nolyfill/is-core-module@npm:1.0.39":
version: 1.0.39
resolution: "@nolyfill/is-core-module@npm:1.0.39"
checksum: 10c0/34ab85fdc2e0250879518841f74a30c276bca4f6c3e13526d2d1fe515e1adf6d46c25fcd5989d22ea056d76f7c39210945180b4859fc83b050e2da411aa86289
languageName: node
linkType: hard

"@npmcli/agent@npm:^2.0.0":
version: 2.2.2
resolution: "@npmcli/agent@npm:2.2.2"
Expand Down Expand Up @@ -3495,6 +3502,7 @@ __metadata:
esbuild-plugin-liquid: "npm:0.2.0"
eslint: "npm:9.16.0"
eslint-config-prettier: "npm:9.1.0"
eslint-import-resolver-typescript: "npm:3.7.0"
eslint-plugin-cypress: "npm:4.1.0"
eslint-plugin-import: "npm:2.31.0"
eslint-plugin-jsdoc: "npm:50.6.0"
Expand Down Expand Up @@ -5536,6 +5544,16 @@ __metadata:
languageName: node
linkType: hard

"enhanced-resolve@npm:^5.15.0":
version: 5.17.1
resolution: "enhanced-resolve@npm:5.17.1"
dependencies:
graceful-fs: "npm:^4.2.4"
tapable: "npm:^2.2.0"
checksum: 10c0/81a0515675eca17efdba2cf5bad87abc91a528fc1191aad50e275e74f045b41506167d420099022da7181c8d787170ea41e4a11a0b10b7a16f6237daecb15370
languageName: node
linkType: hard

"enquirer@npm:^2.3.6":
version: 2.4.1
resolution: "enquirer@npm:2.4.1"
Expand Down Expand Up @@ -5896,6 +5914,31 @@ __metadata:
languageName: node
linkType: hard

"eslint-import-resolver-typescript@npm:3.7.0":
version: 3.7.0
resolution: "eslint-import-resolver-typescript@npm:3.7.0"
dependencies:
"@nolyfill/is-core-module": "npm:1.0.39"
debug: "npm:^4.3.7"
enhanced-resolve: "npm:^5.15.0"
fast-glob: "npm:^3.3.2"
get-tsconfig: "npm:^4.7.5"
is-bun-module: "npm:^1.0.2"
is-glob: "npm:^4.0.3"
stable-hash: "npm:^0.0.4"
peerDependencies:
eslint: "*"
eslint-plugin-import: "*"
eslint-plugin-import-x: "*"
peerDependenciesMeta:
eslint-plugin-import:
optional: true
eslint-plugin-import-x:
optional: true
checksum: 10c0/b1dec542a31486b3b5730f71f08a8ee2ac4915dbc4aa1493fd15bc8fcadcb029772ab39a425824c235045b3a7e629290a339d4a7e7f3dd32b24e715106352d40
languageName: node
linkType: hard

"eslint-module-utils@npm:^2.12.0":
version: 2.12.0
resolution: "eslint-module-utils@npm:2.12.0"
Expand Down Expand Up @@ -6838,6 +6881,15 @@ __metadata:
languageName: node
linkType: hard

"get-tsconfig@npm:^4.7.5":
version: 4.8.1
resolution: "get-tsconfig@npm:4.8.1"
dependencies:
resolve-pkg-maps: "npm:^1.0.0"
checksum: 10c0/536ee85d202f604f4b5fb6be81bcd6e6d9a96846811e83e9acc6de4a04fb49506edea0e1b8cf1d5ee7af33e469916ec2809d4c5445ab8ae015a7a51fbd1572f9
languageName: node
linkType: hard

"get-uri@npm:^6.0.1":
version: 6.0.3
resolution: "get-uri@npm:6.0.3"
Expand Down Expand Up @@ -7159,7 +7211,7 @@ __metadata:
languageName: node
linkType: hard

"graceful-fs@npm:^4.1.2, graceful-fs@npm:^4.1.6, graceful-fs@npm:^4.2.0, graceful-fs@npm:^4.2.11, graceful-fs@npm:^4.2.6, graceful-fs@npm:^4.2.9":
"graceful-fs@npm:^4.1.2, graceful-fs@npm:^4.1.6, graceful-fs@npm:^4.2.0, graceful-fs@npm:^4.2.11, graceful-fs@npm:^4.2.4, graceful-fs@npm:^4.2.6, graceful-fs@npm:^4.2.9":
version: 4.2.11
resolution: "graceful-fs@npm:4.2.11"
checksum: 10c0/386d011a553e02bc594ac2ca0bd6d9e4c22d7fa8cfbfc448a6d148c59ea881b092db9dbe3547ae4b88e55f1b01f7c4a2ecc53b310c042793e63aa44cf6c257f2
Expand Down Expand Up @@ -7907,6 +7959,15 @@ __metadata:
languageName: node
linkType: hard

"is-bun-module@npm:^1.0.2":
version: 1.3.0
resolution: "is-bun-module@npm:1.3.0"
dependencies:
semver: "npm:^7.6.3"
checksum: 10c0/2966744188fcd28e0123c52158c7073973f88babfa9ab04e2846ec5862d6b0f8f398df6413429d930f7c5ee6111ce2cbfb3eb8652d9ec42d4a37dc5089a866fb
languageName: node
linkType: hard

"is-callable@npm:^1.1.3, is-callable@npm:^1.1.4, is-callable@npm:^1.2.7":
version: 1.2.7
resolution: "is-callable@npm:1.2.7"
Expand Down Expand Up @@ -12532,6 +12593,13 @@ __metadata:
languageName: node
linkType: hard

"resolve-pkg-maps@npm:^1.0.0":
version: 1.0.0
resolution: "resolve-pkg-maps@npm:1.0.0"
checksum: 10c0/fb8f7bbe2ca281a73b7ef423a1cbc786fb244bd7a95cbe5c3fba25b27d327150beca8ba02f622baea65919a57e061eb5005204daa5f93ed590d9b77463a567ab
languageName: node
linkType: hard

"resolve-protobuf-schema@npm:^2.1.0":
version: 2.1.0
resolution: "resolve-protobuf-schema@npm:2.1.0"
Expand Down Expand Up @@ -13346,6 +13414,13 @@ __metadata:
languageName: node
linkType: hard

"stable-hash@npm:^0.0.4":
version: 0.0.4
resolution: "stable-hash@npm:0.0.4"
checksum: 10c0/53d010d2a1b014fb60d398c095f43912c353b7b44774e55222bb26fd428bc75b73d7bdfcae509ce927c23ca9c5aff2dc1bc82f191d30e57a879550bc2952bdb0
languageName: node
linkType: hard

"stack-utils@npm:^2.0.3":
version: 2.0.6
resolution: "stack-utils@npm:2.0.6"
Expand Down Expand Up @@ -13883,6 +13958,13 @@ __metadata:
languageName: node
linkType: hard

"tapable@npm:^2.2.0":
version: 2.2.1
resolution: "tapable@npm:2.2.1"
checksum: 10c0/bc40e6efe1e554d075469cedaba69a30eeb373552aaf41caeaaa45bf56ffacc2674261b106245bd566b35d8f3329b52d838e851ee0a852120acae26e622925c9
languageName: node
linkType: hard

"tar-fs@npm:^3.0.6":
version: 3.0.6
resolution: "tar-fs@npm:3.0.6"
Expand Down

0 comments on commit e85a73c

Please sign in to comment.