Suppress unused property warning in Typescript for individual line

It is now possible to use _ for unused params.

function myFunc(_, b: string) {}
function otherFunc(_, _1, c: string) {} // multiple unsused

https://github.com/Microsoft/TypeScript/issues/9458


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 https://palantir.github.io/tslint/usage/rule-flags/ for more information.

Tags:

Typescript