Files
console/css-modules.d.ts
T
zeekayandHanzo Dev 95d5f0bbaa fix: declare CSS side-effect imports for TypeScript 7 (TS2882)
TypeScript 7 reports TS2882 for a side-effect import with no type
declaration; TS 5.x accepted them silently. Next.js resolves stylesheets
through its own loader, so `import './globals.css'` never reaches the
TypeScript module resolver — the ambient declaration tells the checker
they are legitimate rather than giving them a shape.

Closes the entire TS7 gap for this app:

    before   ts5.9 25 errors   ts7 32 errors   (7 unique to TS7, all TS2882)
    after    ts5.9 25 errors   ts7 25 errors   (0 unique to TS7)

No regression on 5.9. The remaining 25 are pre-existing on both compilers.

Co-Authored-By: Hanzo Dev <dev@hanzo.ai>
2026-07-27 17:49:52 -07:00

10 lines
520 B
TypeScript

// 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 let these pass silently.
//
// Next.js resolves stylesheet imports through its own loader pipeline, so these
// specifiers never reach the TypeScript module resolver at build time. The
// ambient declaration exists to tell the checker they are legitimate, not to
// give them a shape — hence no exported members.
declare module '*.css';