镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Suppress only specified errors using '// @ts-ignore' comments. #21197

Description

In some special cases it's ok to ignore error using '// @ts-ignore' comment. But, good practice is ignore only pecific error, not all possible errors. There is an issue with way, how to specify error, there is no public error codes, messages are localized. We have no way to point what diagnostic we want to ignore. But we have diagnosticMessages.json that contains codes.
My proposal is: Include error code to diagnostic message, and then allow to specify what error compiler should ignore, may be like this
// @ts-ignore:1048
May be it would be better to create human readable identifiers for all error and use them instead number codes.

Activity

  1. ghost added
    DuplicateAn existing issue was already created
    on Jan 16, 2018
  2. typescript-bot commented on Jan 30, 2018

    @typescript-bot
    Contributor

    Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed.

  3. Busyrev commented on Feb 3, 2018

    @Busyrev
    ContributorAuthor

    I think it is not a duplicate of #19139. My idea is specify error number in //ts-ignore comment ingnore only errors you want to, not all possible

  4. locked and limited conversation to collaborators on Jul 3, 2018
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

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions