TypeScript now supports an allowArbitraryExtensions setting, which allows it to properly find definitions for app.css in app.d.css.ts. From their docs:
Note that historically, a similar effect has often been achievable by adding a declaration file named app.css.d.ts instead of app.d.css.ts - however, this just worked through Node’s require resolution rules for CommonJS. Strictly speaking, the former is interpreted as a declaration file for a JavaScript file named app.css.js. Because relative files imports need to include extensions in Node’s ESM support, TypeScript would error on our example in an ESM file under --moduleResolution node16 or nodenext.
TypeScript now supports an
allowArbitraryExtensions
setting, which allows it to properly find definitions forapp.css
inapp.d.css.ts
. From their docs: