Skip to content

Commit 40a9027

Browse files
authored
fix(eslint): use eslint-import-resolver-typescript to fix import/no-unresolved (#12016)
1 parent eb5b7d3 commit 40a9027

File tree

4 files changed

+25
-2
lines changed

4 files changed

+25
-2
lines changed

.eslintrc.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -485,5 +485,8 @@ module.exports = {
485485
'import/internal-regex': new RegExp(
486486
internalPackages.map(pkg => `^${pkg}$`).join('|'),
487487
).source,
488+
'import/resolver': {
489+
typescript: {},
490+
},
488491
},
489492
};

e2e/native-esm/__tests__/native-esm.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@ import staticImportedStatefulFromCjs from '../fromCjs.mjs';
1818
import {double} from '../index';
1919
import defaultFromCjs, {half, namedFunction} from '../namedExport.cjs';
2020
import {bag} from '../namespaceExport.js';
21+
/* eslint-disable import/no-duplicates */
2122
import staticImportedStateful from '../stateful.mjs';
2223
import staticImportedStatefulWithQuery from '../stateful.mjs?query=1';
2324
import staticImportedStatefulWithAnotherQuery from '../stateful.mjs?query=2';
25+
/* eslint-enable import/no-duplicates */
2426

2527
test('should have correct import.meta', () => {
2628
expect(typeof require).toBe('undefined');

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
"dedent": "^0.7.0",
3434
"eslint": "^7.7.0",
3535
"eslint-config-prettier": "^8.1.0",
36+
"eslint-import-resolver-typescript": "^2.5.0",
3637
"eslint-plugin-eslint-comments": "^3.1.2",
3738
"eslint-plugin-import": "^2.6.0",
3839
"eslint-plugin-jest": "^24.0.0",

yarn.lock

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2584,6 +2584,7 @@ __metadata:
25842584
dedent: ^0.7.0
25852585
eslint: ^7.7.0
25862586
eslint-config-prettier: ^8.1.0
2587+
eslint-import-resolver-typescript: ^2.5.0
25872588
eslint-plugin-eslint-comments: ^3.1.2
25882589
eslint-plugin-import: ^2.6.0
25892590
eslint-plugin-jest: ^24.0.0
@@ -9211,6 +9212,22 @@ __metadata:
92119212
languageName: node
92129213
linkType: hard
92139214

9215+
"eslint-import-resolver-typescript@npm:^2.5.0":
9216+
version: 2.5.0
9217+
resolution: "eslint-import-resolver-typescript@npm:2.5.0"
9218+
dependencies:
9219+
debug: ^4.3.1
9220+
glob: ^7.1.7
9221+
is-glob: ^4.0.1
9222+
resolve: ^1.20.0
9223+
tsconfig-paths: ^3.9.0
9224+
peerDependencies:
9225+
eslint: "*"
9226+
eslint-plugin-import: "*"
9227+
checksum: c13542b1f6283ac354c151f11f5e6e6fb69471ed66c6b6491a72a1ead3504404bf3dca830c9b093e26d419c89ee48433ba45cab1e3a1c3fb968fc7ffa9454cad
9228+
languageName: node
9229+
linkType: hard
9230+
92149231
"eslint-module-utils@npm:^2.6.2":
92159232
version: 2.6.2
92169233
resolution: "eslint-module-utils@npm:2.6.2"
@@ -10743,7 +10760,7 @@ fsevents@^1.2.7:
1074310760
languageName: node
1074410761
linkType: hard
1074510762

10746-
"glob@npm:^7.0.0, glob@npm:^7.0.3, glob@npm:^7.1.1, glob@npm:^7.1.2, glob@npm:^7.1.3, glob@npm:^7.1.4, glob@npm:^7.1.6":
10763+
"glob@npm:^7.0.0, glob@npm:^7.0.3, glob@npm:^7.1.1, glob@npm:^7.1.2, glob@npm:^7.1.3, glob@npm:^7.1.4, glob@npm:^7.1.6, glob@npm:^7.1.7":
1074710764
version: 7.2.0
1074810765
resolution: "glob@npm:7.2.0"
1074910766
dependencies:
@@ -21002,7 +21019,7 @@ [email protected]:
2100221019
languageName: node
2100321020
linkType: hard
2100421021

21005-
"tsconfig-paths@npm:^3.11.0":
21022+
"tsconfig-paths@npm:^3.11.0, tsconfig-paths@npm:^3.9.0":
2100621023
version: 3.11.0
2100721024
resolution: "tsconfig-paths@npm:3.11.0"
2100821025
dependencies:

0 commit comments

Comments
 (0)