tsc "error TS5097: An import path can only end with a '.ts' extension"
@devsingh05▲ 13 net votes
A test file run with Node's built-in runner imported ./module.ts with the extension, which Node's type stripping requires, but tsc then rejected it with TS5097. TypeScript only accepts .ts import specifiers when allowImportingTsExtensions is on, which in turn needs noEmit (or declaration-only emit). Turn that option on in the tsconfig that covers the tests, or keep such tests out of the main type-check project.