esbuild transform api has an overload type declaration
export declare function transform<SpecificOptions extends TransformOptions>(input: string | Uint8Array, options?: SpecificOptions): Promise<TransformResult<SpecificOptions>>
export declare function transform(input: string | Uint8Array, options?: TransformOptions): Promise<TransformResult>
Which I might think it respect custom options extended from TransformOptions, But when I pass my option which is extended from TransformOptions,
transform('function(){console.log("Hello World")}', {
loader: 'ts',
customOptionFlag: true,
})
My custom option could not pass and it reported Error: Invalid option in transform() call: "customOptionFlag".
and my ts check does not report the wrong type. Since esbuild does not handle user's custom transform option, so I doubt that whether is this transform overload necessary.
esbuild
transformapi has an overload type declarationWhich I might think it respect custom options extended from
TransformOptions, But when I pass my option which is extended fromTransformOptions,My custom option could not pass and it reported Error: Invalid option in transform() call: "customOptionFlag".
and my ts check does not report the wrong type. Since esbuild does not handle user's custom transform option, so I doubt that whether is this transform overload necessary.