Skip to content

Content mapper ignore directives need diagnostic-code selectors #65516

Description

@ubugeeei

Problem

A mapped diagnostic ignore directive currently selects diagnostics by generated range and policy only. Framework-generated code can place an excess-property diagnostic (TS2353) in a range that also contains unrelated assignability, event, slot, accessibility, or nested object-literal diagnostics. A range-only ignore therefore cannot suppress the intended framework compatibility diagnostic without hiding real errors.

This blocks a Vue content-mapper fix originally reported by miyaoka (@miyaoka) in ubugeeei-prod/vize#13021 and tracked in ubugeeei-prod/vize#13057.

Proposed protocol extension

  • Advertise diagnosticDirectiveCodeSelectors in host initialize.params.capabilities.
  • When advertised, interpret an ignore tuple optional sixth element as a TypeScript diagnostic code.
  • Keep legacy five-element ignores and expect tuples byte-for-byte unchanged.
  • Filter only when both the virtual range and diagnostic code match.

This makes unsupported hosts safe: a mapper does not emit the selected tuple unless the host explicitly advertises support, so it never degrades to range-only suppression.

Activity

  1. andrewbranch commented on Nov 20, 2026

    @andrewbranch
    Member

    If this is primarily about excess property checking, why not change the code generation to include an index signature?

    I'm torn on this. The use case here is pretty reasonable, but this functionality would make it really easy for any content mapper to disable, file-wide if desired, any TypeScript error they want, which makes me a little uneasy.

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

Metadata

Metadata

Labels

Needs InvestigationThis issue needs a team member to investigate its status.

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions