Skip to content

Allow content mappers emit diagnostics with different severity levels #64932

Open

Description

@blt-r

🔍 Search Terms

content mappers, diagnostics, warning

✅ Viability Checklist

⭐ Suggestion

Currently, all diagnostics returned by a content mappers are treated as errors. It would be nice if content mappers could also produce warnings.

📃 Motivating Example

For example, a Svelte content mapper could emit warnings for the svelte's compiler warnings.

💻 Use Cases

  • Compiler warnings in compiled languages
  • Flagging duplicate keys in simple formats that allow them
  • Flagging trailing commas in json.

Activity

  1. RyanCavanaugh commented on Oct 26, 2026

    @RyanCavanaugh
    Member

    Notably, TS itself does not have a 'warning' concept, so this is a heavy lift on its own

  2. blt-r commented on Oct 26, 2026

    @blt-r
    Author

    Warnings kinda do exists in tsc though, the compiler just never produces them. There is diagnostic.category and it's properly handled by the cli and lsp. The pipeline sometimes assumes that all diagnostics are errors, but that's an easy fix.

    Adding this will add the new semantics of "errors fail the build, warnings don't" which is not a concept that existed before, but I think it's the most normal thing ever.

    Also, it might be a little weird that the compiler itself never produces warnings but content mappers can. Although the weird part is really that the typescript compiler doesn't have warnings.

    I can make a PR, this is a small change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    SuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions