flatbuffers icon indicating copy to clipboard operation
flatbuffers copied to clipboard

Extension `.js` apears in TS files when importing a schima [TypeScript, OS X, FlatBuffers 23.5.26]

Open surdu opened this issue 2 years ago • 5 comments

Hello!

Even though I generate the TS files using the --ts-no-import-ext, when you have an import in one of your schemas, the TS file will still contain an export with a .js extension:

If I have the following schemas:

// color.fbs

enum Color:byte { Red = 0, Green, Blue = 2 }
// monster.fbs

include "color.fbs";

namespace Sample;

table Monster {
  color:Color = Blue; // Enum.
}

root_type Monster;

After running flatc --ts --ts-no-import-ext -o monsters_generated monster.fbs we get a file monster.ts with the following content:

// automatically generated by the FlatBuffers compiler, do not modify

export { Color } from './color';
export * as Sample from './sample.js';

Thank you!

surdu avatar Oct 02 '23 15:10 surdu

Any progress on this issue?

stephanemagnenat avatar Feb 23 '24 10:02 stephanemagnenat