Skip to content

Commit 23e2e8c

Browse files
committed
fix: only check alwaysTryTypes if foundNodePath is null
1 parent fe0aa6f commit 23e2e8c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ function resolveFile(source, file, config) {
6565
// naive attempt at @types/* resolution,
6666
// if path is neither absolute nor relative
6767
if (
68-
(config.alwaysTryTypes || /\.jsx?$/.test(foundNodePath)) &&
68+
(/\.jsx?$/.test(foundNodePath) ||
69+
(config.alwaysTryTypes && !foundNodePath)) &&
6970
!/^@types[/\\]/.test(source) &&
7071
!path.isAbsolute(source) &&
7172
source[0] !== '.'

0 commit comments

Comments
 (0)