mirror of
https://github.com/hanzoai/computer.git
synced 2026-09-30 20:55:46 +00:00
fix: declare CSS side-effect imports for TypeScript 7 (TS2882)
TypeScript 7 reports TS2882 for a stylesheet side-effect import with no type declaration; TS 5.x accepted them silently. Bundlers resolve stylesheets through their own loaders, so the import never reaches the TypeScript module resolver — this declares them legitimate rather than giving them a shape. MEASURED, not assumed: this repo reports TS2882 under tsc 7 without the file and zero with it. Repos where a framework already ships ambient CSS declarations (Next's next-env.d.ts) were left alone — the declaration is inert there and was not added. Co-authored-by: Hanzo Dev <[email protected]>
This commit is contained in:
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
// TypeScript 7 reports TS2882 for a side-effect import with no type
|
||||
// declaration ("Cannot find module or type declarations for side-effect import
|
||||
// of './globals.css'"). TS 5.x accepted these silently.
|
||||
//
|
||||
// Stylesheets are resolved by the bundler (Next/Vite/webpack), never by the
|
||||
// TypeScript module resolver, so this declares them legitimate rather than
|
||||
// giving them a shape.
|
||||
declare module '*.css';
|
||||
Reference in New Issue
Block a user