Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Busyrev opened this issue Jan 16, 2018 · 3 comments
Closed

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

Busyrev opened this issue Jan 16, 2018 · 3 comments
Labels
Duplicate An existing issue was already created

Comments

@Busyrev
Copy link
Contributor

Busyrev commented Jan 16, 2018

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.

@ghost
Copy link

ghost commented Jan 16, 2018

Duplicate of #19139

@ghost ghost marked this as a duplicate of #19139 Jan 16, 2018
@ghost ghost added the Duplicate An existing issue was already created label Jan 16, 2018
@typescript-bot
Copy link
Collaborator

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

@Busyrev
Copy link
Contributor Author

Busyrev commented Feb 3, 2018

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

@microsoft microsoft locked and limited conversation to collaborators Jul 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

2 participants