From 07258ff2ccb9367200faf6a340444831764660bd Mon Sep 17 00:00:00 2001 From: Xinyan Chen Date: Wed, 7 Sep 2022 20:47:15 +0800 Subject: [PATCH 1/2] perf: use throwIfNoEntry on Node 14+ --- src/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 } } From 8c3dff09d9985cfafff69a2eed6fb6ac84333a3c Mon Sep 17 00:00:00 2001 From: JounQin Date: Wed, 7 Sep 2022 21:15:49 +0800 Subject: [PATCH 2/2] Create cyan-parrots-act.md --- .changeset/cyan-parrots-act.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/cyan-parrots-act.md 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+