From 95a1aa8dff68c332f24da635b53887458f25e79d Mon Sep 17 00:00:00 2001 From: lijifei Date: Fri, 18 Aug 2023 11:15:43 +0800 Subject: [PATCH] chore: import module with extension, avoid ts check issue --- examples/mocks/src/{dynamic-module.ts => dynamic-module.js} | 0 examples/mocks/src/retry-dynamic-import.ts | 5 ++--- 2 files changed, 2 insertions(+), 3 deletions(-) rename examples/mocks/src/{dynamic-module.ts => dynamic-module.js} (100%) diff --git a/examples/mocks/src/dynamic-module.ts b/examples/mocks/src/dynamic-module.js similarity index 100% rename from examples/mocks/src/dynamic-module.ts rename to examples/mocks/src/dynamic-module.js diff --git a/examples/mocks/src/retry-dynamic-import.ts b/examples/mocks/src/retry-dynamic-import.ts index 727699adbf5c..4c4c34685397 100644 --- a/examples/mocks/src/retry-dynamic-import.ts +++ b/examples/mocks/src/retry-dynamic-import.ts @@ -1,9 +1,8 @@ export async function retryDynamicImport() { let retryTimes = 0 const load = async () => { - try { // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-expect-error - return await import('./dynamic-module') + try { + return await import('./dynamic-module.js') } catch (e) { if (retryTimes === 3)