Skip to content

[P3] Lexer: colon descriptions hide valid ts-expect-error and ts-ignore directives #3488

Closed

Description

@nickna

SharpTS ignores a TypeScript-valid colon description after a line directive.

// @ts-expect-error: intentional assignment for the negative control
const value: number = "wrong";

Pinned TypeScript 6.0.3 reports no diagnostic for this source; SharpTS reports TS2322 because Lexer.MatchesPragma only accepts end-of-line or whitespace after the directive name. The same source with a space instead of the colon is recognized. @ts-ignore: reason has the same delimiter issue.

This differs from closed #2522, which enabled module-wide line-directive handling and unused-expectation diagnostics: the colon spelling is discarded during lexing before those policies run. Found during the PR #3487 benchmark followup; no introducing-commit claim is made.

Acceptance: recognize colon descriptions for @ts-expect-error and @ts-ignore, preserve unused-expectation TS2578, suppress only the following eligible line, and keep misleading prose/truncated/file-pragma prefixes from disabling checking. Do not replace this with @ts-nocheck or weaken the diagnostic policy.

Pinned compiler evidence covers ten accepted, unused, line-local, and misleading-prefix controls in artifacts/p3-compiler/colon-directive-oracles.json, produced by verify-colon-directives.cjs against external/typescript/lib/typescript.js version 6.0.3.

Activity

  1. added
    bugSomething isn't working
    priority: P3Low: minor metadata, diagnostic/error-branding polish, or explicitly deferred work.
    on Nov 4, 2026
  2. added a commit that references this issue on Nov 4, 2026
    bcc2506
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

    bugSomething isn't workingpriority: P3Low: minor metadata, diagnostic/error-branding polish, or explicitly deferred work.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions