Open
Description
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 ofapp.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 namedapp.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
ornodenext
.
Metadata
Metadata
Assignees
Labels
No labels