When I compile my typescript project, I'm using the noImplicitAny
option so that I won't forget to specify the types on my variables and arguments.
However sometimes you have arguments that you don't use. For example:
jQuery.ajaxTransport("+*", function (options: JQueryAjaxSettings) {
return {
abort: function (_, callback: JQueryCallback) {
I am not interested in the first argument of the abort function, so I ignore it by naming it _.
Is that the proper way to do that in TypeScript? I couldn't find it in the guide. I suspect that it isn't the proper way, because I can only name one argument _.
Typescript raises the following error:
error TS7006: Parameter '_' implicitly has an 'any' type.
I could just type _:any
but that seems a bit overkill for an argument that I don't use.