the tswhy logo: a question mark in a box

tswhy‽

A community effort to enrich TypeScript diagnostics.

TS1034

'super' must be followed by an argument list or member access.

When super appears in a derived class, it must be used, not just left as an empty statement:

class Base {
  method() {
    console.log("Base#method");
  }
}

class A extends Base {
  method() {
    super; // Error
  }
}

Fix: Invoke super as a function.

Utilize super() in the method:

class Base {
  method() {
    console.log("Base#method");
  }
}

class A extends Base {
  method() {
    super();
  }
}

Fix: Access a property of super.

Access some property of the ancestor:

class Base {
  prop = "prop";
}

class A extends Base {
  constructor() {
    console.log(super.prop);
  }
}