Suppress unused property warning in Typescript for individual line

Since TypeScript 2.6 you can suppress errors with // @ts-ignore.

A // @ts-ignore comment suppresses all errors that originate on the following line. It is recommended practice to have the remainder of the comment following @ts-ignore explain which error is being suppressed.

Please note that this comment only suppresses the error reporting, and we recommend you use this comments very sparingly.

source (release notes TypeScript 2.6

If the error is an tslint error then you can disable them with

// tslint:disable-next-line

See for more information.

Leave a Comment