Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: disable throwIfNoEntry on Node 14+ #182

Merged
merged 2 commits into from Sep 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/cyan-parrots-act.md
@@ -0,0 +1,5 @@
---
"eslint-import-resolver-typescript": patch
---

perf: disable `throwIfNoEntry` on Node 14+
3 changes: 2 additions & 1 deletion src/index.ts
Expand Up @@ -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
}
}
Expand Down