TS7019
Rest parameter 'args' implicitly has an 'any[]' type.
Broken Code ❌
function log(...args) {
console.log(args);
}{
"compilerOptions": {
"noImplicitAny": true
}
}Fixed Code ✔️
function log(...args: string[]) {
console.log(args);
}{
"compilerOptions": {
"noImplicitAny": true
}
}Alternative:
function log(...args: unknown[]) {
console.log(args);
}{
"compilerOptions": {
"noImplicitAny": true
}
}Rest parameters need explicit type annotations when noImplicitAny is enabled.
