@@ -8,12 +8,10 @@ import { TypeScriptCompileError } from "./typescript-compile-error.js";
88type LoaderAsync = ( filepath : string , content : string ) => Promise < LoaderResult > ;
99
1010export function TypeScriptLoader ( options ?: JitiOptions ) : LoaderAsync {
11- // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-assignment
1211 const loader : Jiti = createJiti ( "" , { interopDefault : true , ...options } ) ;
13- return async ( path : string ) : Promise < unknown > => {
12+ return async ( path : string , _content : string ) : Promise < LoaderResult > => {
1413 try {
15- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any
16- const result : { default ?: unknown } = ( await loader . import ( path ) ) as any ;
14+ const result = ( await loader . import ( path ) ) as { default ?: unknown } ;
1715
1816 // `default` is used when exporting using export default, some modules
1917 // may still use `module.exports` or if in TS `export = `
@@ -32,12 +30,11 @@ export function TypeScriptLoader(options?: JitiOptions): LoaderAsync {
3230 * @deprecated use `TypeScriptLoader`
3331 */
3432export function TypeScriptLoaderSync ( options ?: JitiOptions ) : LoaderSync {
35- // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-assignment
3633 const loader : Jiti = createJiti ( "" , { interopDefault : true , ...options } ) ;
37- return ( path : string ) : unknown => {
34+ return ( path : string , _content : string ) : LoaderResult => {
3835 try {
39- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no- deprecated
40- const result : { default ?: unknown } = loader ( path ) ;
36+ // eslint-disable-next-line @typescript-eslint/no-deprecated
37+ const result = loader ( path ) as { default ?: unknown } ;
4138
4239 // `default` is used when exporting using export default, some modules
4340 // may still use `module.exports` or if in TS `export = `
0 commit comments