Skip to content

how can I make typescript recognize css or svg files that exist while still warning about files that don't exist (without allegedly creating .d.css.ts or whatever AI is trying to claim)?Β #63582

Description

@Arlen22

πŸ” Search Terms

the title

βœ… Viability Checklist

⭐ Suggestion

I want the wildcard module to warn about files that don't exist. Build tools resolve this normally. And typescript would too if the file ended in .ts. Allow importing arbitrary extensions does not make this error go away.

πŸ“ƒ Motivating Example

import warningIcon from "@material-symbols/svg-400/outlined/warning-fill.svg";
declare module "*.svg" {
  const css: string;
  export default css;
}

πŸ’» Use Cases

  1. What do you want to use this for?
  2. What shortcomings exist with current approaches?
  3. What workarounds are you using in the meantime?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions