diff --git a/.changeset/cyan-parrots-act.md b/.changeset/cyan-parrots-act.md new file mode 100644 index 0000000..49e6f85 --- /dev/null +++ b/.changeset/cyan-parrots-act.md @@ -0,0 +1,5 @@ +--- +"eslint-import-resolver-typescript": patch +--- + +perf: disable `throwIfNoEntry` on Node 14+ diff --git a/src/index.ts b/src/index.ts index 195148b..b8e1707 100644 --- a/src/index.ts +++ b/src/index.ts @@ -243,8 +243,9 @@ function removeQuerystring(id: string) { const isFile = (path?: string | undefined): path is string => { try { - return !!path && fs.statSync(path).isFile() + return !!(path && fs.statSync(path, { throwIfNoEntry: false })?.isFile()) } catch { + // Node 12 does not support throwIfNoEntry. return false } }