deno/tests/specs/check/ambient_modules/modules.d.ts
Yoshiya Hinosawa 637bcffea7
fix(check): ignore errors on ambient modules (#29135)
This commit makes `deno check` ignore `Cannot find module` diagnostic if the
missing module specifier matches one of ambient module pattern. (For
example if there's `declare module "*.svg" { ... }` declaration in one
of d.ts files, importing of `<any>.svg` doesn't cause type error with
this change. This is necessary for passing the type checking of default
vite template.)

---------

Co-authored-by: David Sherret <dsherret@gmail.com>
2025-05-16 15:06:34 +09:00

9 lines
217 B
TypeScript

declare module "*.svg" {
const content: string;
export default content;
}
declare module "*.module.css" {
const classes: { readonly [key: string]: string };
export default classes;
}
declare module "*.css" {}