Vscode TSLint plug-in error exception

interface Person {
  firstName: string;
  lastName: string;
}

function greeter(person: Person) {
  return "Hello, " + person.firstName + " " + person.lastName;
}

let user = { firstName: "Jane", lastName: "User" };

document.body.innerHTML = greeter(user);

this code ts compiles fine
but TSLint reports a weird error

"{ firstName: string; lastName: string; }" "Person" 
  Type "{ firstName: string; lastName: string; }" is missing the following properties from type "Person": name, age, getName

Why do I say I am missing when it is clear that the interface does not have a definition of name, age, getName?

Mar.16,2022

try to restart vscode. Sometimes there will be delays and confusion in the ts detection of vscode.

Menu