Skip to content

Commit

Permalink
Suppress exception thrown by require.resolve if the file does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
iarroyo committed Jan 8, 2025
1 parent d8f63e9 commit 21b23d6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/core/src/config/loader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@ function loadConfigInput(ts: TypeScript, entryPath: string): GlintConfigInput |
if (currentContents.extends) {
currentPath = path.resolve(path.dirname(currentPath), currentContents.extends);
if (!fs.existsSync(currentPath)) {
currentPath = require.resolve(currentContents.extends);
try {
currentPath = require.resolve(currentContents.extends);
} catch {
// suppress the exception thrown by require.resolve for those scenarios where the file does not exist
}
}
} else {
currentPath = undefined;
Expand Down

0 comments on commit 21b23d6

Please sign in to comment.