cosmology-tech / telescope

A TypeScript Transpiler for Cosmos Protobufs ⚛️
https://cosmology.zone/products/telescope
Apache License 2.0
141 stars 41 forks source link

tsc errors #586

Closed liujun93 closed 3 months ago

liujun93 commented 4 months ago
google/protobuf/descriptor.ts:6137:5 - error TS2322: Type '1' is not assignable to type 'FeatureSet_Utf8Validation'.

6137     utf8Validation: 1,
         ~~~~~~~~~~~~~~

  google/protobuf/descriptor.ts:2429:3
    2429   utf8Validation: FeatureSet_Utf8Validation;
           ~~~~~~~~~~~~~~
    The expected type comes from property 'utf8Validation' which is declared here on type 'FeatureSet'

google/protobuf/descriptor.ts:6160:9 - error TS2367: This comparison appears to be unintentional because the types 'FeatureSet_Utf8Validation' and '1' have no overlap.

6160     if (message.utf8Validation !== 1) {
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~

google/protobuf/descriptor.ts:6208:5 - error TS2322: Type '1 | FeatureSet_Utf8Validation' is not assignable to type 'FeatureSet_Utf8Validation'.
  Type '1' is not assignable to type 'FeatureSet_Utf8Validation'.

6208     message.utf8Validation = object.utf8Validation ?? 1;
         ~~~~~~~~~~~~~~~~~~~~~~

Found 3 errors in the same file, starting at: google/protobuf/descriptor.ts:6137
Zetazzz commented 3 months ago

published @cosmology/telescope@1.5.2

please enable: prototypes.typingsFormat.autoFixUndefinedEnumDefault

(the default value of an enum field would be: 1(proto2); 0(proto3); But in some rare cases, those default values are not existing. But enable this, default value will automatically fixed with the smallest value.)