better-docs icon indicating copy to clipboard operation
better-docs copied to clipboard

Add support for ".cts" and ".mts" files

Open cowwoc opened this issue 1 year ago • 1 comments

Please update the code to accept ".cts" and ".mts" files as discussed at https://github.com/microsoft/TypeScript/issues/27957#issuecomment-926932331

Currently, I am getting the following error:

ERROR: Unable to parse C:\Users\Gili\Documents\requirements.js\src\ArrayAsserter.mts: Unexpected token, expected "from" (2:0)

in a project that used to work just fine when the extension was .ts. I cannot use a .ts extension for reasons discussed in that other GitHub ticket.

Thank you.

cowwoc avatar Jul 04 '23 02:07 cowwoc

As a workaround, I configured my build script to copy all .mts files into a temporary directory, rename their extension to .ts and run better-docs against the temporary directory. This works fine.

cowwoc avatar Jul 04 '23 03:07 cowwoc