AssemblyScript / assemblyscript

A TypeScript-like language for WebAssembly.
https://www.assemblyscript.org
Apache License 2.0
16.84k stars 655 forks source link

Allow `.ts` extension in imports/exports #2876

Open fabianhjr opened 3 hours ago

fabianhjr commented 3 hours ago

Feature suggestion

Eg, deno / bun allow and prefer something like

export { Parser0 } from "./parsers/Parser0.ts";
export { Parser } from "./parsers/Parser.ts";
export { ParserResult } from "./parsers/ParserResult.ts";

But AssemblyScript complains:

ERROR TS6054: File 'src/parsers/Parser0.ts.ts' not found.
   :
 1 │ export { Parser0 } from "./parsers/Parser0.ts";
   │                         ~~~~~~~~~~~~~~~~~~~~~~
   └─ in src/index.ts(1,25)

ERROR TS6054: File 'src/parsers/Parser.ts.ts' not found.
   :
 2 │ export { Parser } from "./parsers/Parser.ts";
   │                        ~~~~~~~~~~~~~~~~~~~~~
   └─ in src/index.ts(2,24)

ERROR TS6054: File 'src/parsers/ParserResult.ts.ts' not found.
   :
 3 │ export { ParserResult } from "./parsers/ParserResult.ts";
   │                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~
   └─ in src/index.ts(3,30)
fabianhjr commented 3 hours ago

Did an initial attempt but seems to be slightly more involved: https://github.com/AssemblyScript/assemblyscript/pull/2875