In my typescript project compilation process, I make use of the noImplicitAny
option to ensure that I specify the types for variables and arguments.
However, there are instances where I have unused arguments. For instance:
jQuery.ajaxTransport("+*", function (options: JQueryAjaxSettings) {
return {
abort: function (_, callback: JQueryCallback) {
For the first argument of the abort function that I am not interested in, I choose to name it as _ to indicate its insignificance.
I wonder if this is the correct approach in TypeScript, as I couldn't find concrete guidelines on it. My suspicion arises from the fact that only one argument can be named _.
Upon compiling, Typescript displays the error:
error TS7006: Parameter '_' implicitly has an 'any' type.
To resolve this, I could simply type _:any
, but it seems excessive for an unused argument.