We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e5d7f46 commit 0de32d9Copy full SHA for 0de32d9
lib/loader.ts
@@ -11,6 +11,10 @@ export function TypeScriptLoader(options?: JitiOptions): LoaderAsync {
11
const loader: Jiti = createJiti("", { interopDefault: true, ...options });
12
return async (path: string, _content: string): Promise<LoaderResult> => {
13
try {
14
+ // Because the import resolved as `unknown`, in the union of `unknown & { default?: unknown }`
15
+ // `unknown` is the loosest type, however, we know it's an imported module possibly with a
16
+ // default export set.
17
+ // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
18
const result = (await loader.import(path)) as { default?: unknown };
19
20
// `default` is used when exporting using export default, some modules
0 commit comments