joarwilk / flowgen

Generate flowtype definition files from TypeScript
Other
657 stars 87 forks source link

fix: add "static" keyword in front of static getters #171

Closed yradchen closed 2 years ago

yradchen commented 2 years ago

References issue

Currently when creating a static getter in a class, the word "static" is left out when code is transpiled to Flow. Flow is then unable to access the property in the class, this CR adds the keyword so that Flow may read the property within the class.

Typescript file

export default class Test {
    static get hello(): string;
}

BEFORE CHANGE flow file

declare export default class Test {
  hello: string;
}

AFTER CHANGE flow file

declare export default class Test {
  static hello: string;
}
orta commented 2 years ago

👍🏻 looks good to me, will ship when the next PR comes though