Skip to content

Commit

Permalink
fix: only check alwaysTryTypes if foundNodePath is null
Browse files Browse the repository at this point in the history
  • Loading branch information
JounQin committed Jul 25, 2019
1 parent fe0aa6f commit 23e2e8c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@ function resolveFile(source, file, config) {
// naive attempt at @types/* resolution,
// if path is neither absolute nor relative
if (
(config.alwaysTryTypes || /\.jsx?$/.test(foundNodePath)) &&
(/\.jsx?$/.test(foundNodePath) ||
(config.alwaysTryTypes && !foundNodePath)) &&
!/^@types[/\\]/.test(source) &&
!path.isAbsolute(source) &&
source[0] !== '.'
Expand Down

0 comments on commit 23e2e8c

Please sign in to comment.