rescript-association / genType

Auto generation of idiomatic bindings between Reason and JavaScript: either vanilla or typed with TypeScript/FlowType.
https://rescript-lang.org/docs/gentype/latest/introduction
MIT License
757 stars 44 forks source link

Fix Flow error suppression codes #592

Closed mrtnzlml closed 2 years ago

mrtnzlml commented 2 years ago

Flow requires error suppression codes (see: https://flow.org/en/docs/errors/). It returns the following warning without them:

Warning ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ src/abacus-backoffice/src/cats/Test.gen.js:8:1

Suppression is missing a code. Please update this suppression to use an error code: $FlowFixMe[untyped-import]

      5│  */
      6│ /* eslint-disable */
      7│
      8│ // $FlowExpectedError: Reason checked type sufficiently
      9│ import * as TestBS from './Test.bs';
     10│
     11│ export type Props = {| +name?: string, +children: React$Node |};

Found 1 warning
cristianoc commented 2 years ago

@mrtnzlml see commit above to issue correct Flow suppression codes.

Btw it seems by default that warnings are not shown by Flow -- would you share how you produced the warning in your screenshot on top?

mrtnzlml commented 2 years ago

It might be that Flow warnings need to be enabled explicitly like so: https://github.com/adeira/universe/blob/174425b52f83ebf874d166a6fe64eba8659c8169/.flowconfig#L52

Thanks for correcting the supression codes. I went too blindly with the refactoring. 🙈