Skip to content

Allow Program#getSemanticDiagnostics to ignore @ts-ignore #25238

@ajafff

Description

@ajafff

Search Terms

ts-ignore

Suggestion

Add a parameter to program.getSemanticDiagnostics to turn off filtering by // @ts-ignore comments.

Use Cases

#25166 proposes an option to report unused // @ts-ignore comments. Since this would require yet another compilerOption, I think this should better be done by external tooling like a linter.

Currently there is no way for external tools to know if there would actually be a semantic diagnostic without the comment. With the proposed API one could check that there is at least one diagnostic per ignore comment.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Domain: APIRelates to the public API for TypeScriptIn DiscussionNot yet reached consensusSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions