protobuf2flowtype
protobuf2flowtype copied to clipboard
Non-existent attributes are not reported as flow errors
Hi, I'm using protobuf2flowtype in my app. So far it has been useful to make sure I'm properly using the attributes of my Protobuf objects with respect to type check. However I noticed that non-existent attributes are not reported as flow errors.
I looked at the generated code and noticed this in node_modules/protobuf2flowtype-runtime/index.js
:
declare class Protobuf$Message<T: ProtoBuf$MessageLiteral, R: Protobuf$RefectType<T>> extends Object {
I wonder why Protobuf$Message
extends Object
? As far as I understand, extending Object
means: use any attribute you want, it's free! It is not really the Protobuf spirit, which is rather strict and would not allow such misconduct.
Your help will be appreciated.