add { module: "nodenext" } to compilerOptions to generate ESM javascript, then typescript requires file import and throws error TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path.
Not planning on touching imports — I think I'm going to take the same stance as TS and say your imports in TS should be written the way you want them to appear in the output JS.
typescript input
actual javascript output: in ESM, this throws ERR_UNSUPPORTED_DIR_IMPORT
expected javascript output: resolve directory import to file import
in commonjs, the directory import would work
ideally, ts-to-jsdoc would support converting an input directory, so it can resolve file paths
related issues
possible solutions
resolveFullPaths
option of tsc-alias{ module: "nodenext" }
to compilerOptions to generate ESM javascript, then typescript requires file import and throwserror TS2834: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Consider adding an extension to the import path.
tsc-esm-fix --target='target/es6'
tsc-esm-fix --src='src/main/ts' --ext='.js'