https://pulumi.com logo
#typescript
Title
# typescript
m

millions-furniture-75402

09/28/2020, 3:22 PM
I have application code that uses implicit super() when using a base class. When using typescript locally, that’s no problem, however when building the application with pulumi, it requires an explicit constructor in the child class. Can anyone help me understand why this is happening? explicit constructor required in the child class:
Copy code
constructor(bucketName: string) {
    super(bucketName);
  }
f

faint-table-42725

09/28/2020, 5:01 PM
I’ve never actually seen an implicit super for an inherited class? I got curious and reading the TS handbook, that doesn’t seem to be the case? https://www.typescriptlang.org/docs/handbook/classes.html#inheritance
One difference from the prior example is that each derived class that contains a constructor function must call 
super()
 which will execute the constructor of the base class. What’s more, before we ever access a property on 
this
 in a constructor body, we have to call 
super()
. This is an important rule that TypeScript will enforce.
m

millions-furniture-75402

09/28/2020, 8:02 PM
Hmm, okay I think this is actually more related to an ESLint rule I misunderstood. Thanks for helping me clarify, I’ve disabled the rule.