Currently, I am developing a program with TypeScript and TSLint serving as the linter. Below is my preferred list of rules found in tslint.json:
{
"extends": "tslint:recommended",
"rules": {
"comment-format": [false, "check-space"],
"eofline": false,
"triple-equals": [false, "allow-null-check"],
"no-trailing-whitespace": false,
"one-line": false,
"no-empty": false,
"typedef-whitespace": false,
"whitespace": false,
"radix": false,
"no-consecutive-blank-lines": false,
"no-console": false,
"typedef": [true,
"variable-declaration",
"call-signature",
"parameter",
"property-declaration",
"member-variable-declaration"
],
"quotemark": false,
"no-any": true,
"one-variable-per-declaration": false
}
}
Despite utilizing TSLint, it fails to identify incorrect function calls with the wrong number of parameters. For instance, consider the following function:
let displayTimer: Function = function(): void {
document.getElementById('milliseconds').innerHTML = ms.toString();
document.getElementById('seconds').innerHTML = seconds.toString();
document.getElementById('minutes').innerHTML= minutes.toString();
};
Within another function, I invoke it in this manner:
let turnTimerOn: Function = function(): void {
ms += interval;
if (ms >= 1000)
{
ms = 0;
seconds += 1;
}
if (seconds >= 60)
{
ms = 0;
seconds = 0;
minutes += 1;
}
displayTimer(1);
};
It's evident that a parameter is being passed to the displayTimer function (in this case, the number 1), yet the linter does not report this as an issue.