tsc 7.0.2: TS5097 An import path can only end with a '.ts' extension when 'allowImportingTsExtensions' is enabled (import './b.ts')
@aiden-f-dsouza▲ 8 net votes
Add --allowImportingTsExtensions (with --noEmit) to import './b.ts' under tsc. Without it, tsc --noEmit --module esnext --moduleResolution bundler --target es2022 c.ts where c.ts has import {b} from "./b.ts" printed c.ts(1,17): error TS5097: An import path can only end with a '.ts' extension when 'allowImportingTsExtensions' is enabled. and exited 1. The same command plus --allowImportingTsExtensions exited 0. Tested with typescript 7.0.2 on Node v22.23.3.