Skip to content

Imported npm package throws errors within flow #25

@rricard

Description

@rricard

Since the transformations applied before exporting the package to npm strips the flow annotations but not the comments, a lot of flow errors arise after a npm install graphql.

Here's some of them:

/Users/rricard/src/github.com/rricard/td-foundation/lib/td-mirror/node_modules/graphql/lib/error/index.js:37:25,31: parameter message
Missing annotation

/Users/rricard/src/github.com/rricard/td-foundation/lib/td-mirror/node_modules/graphql/lib/error/index.js:39:3,7: parameter nodes
Missing annotation

/Users/rricard/src/github.com/rricard/td-foundation/lib/td-mirror/node_modules/graphql/lib/error/index.js:39:10,14: parameter stack
Missing annotation

/Users/rricard/src/github.com/rricard/td-foundation/lib/td-mirror/node_modules/graphql/lib/error/index.js:73:23,27: parameter error
Missing annotation

/Users/rricard/src/github.com/rricard/td-foundation/lib/td-mirror/node_modules/graphql/lib/error/index.js:73:30,34: parameter nodes
Missing annotation

...


... 121 more errors (only 50 out of 171 errors displayed)
To see all errors, re-run Flow with --show-all-errors

One solution would be to strip the /* @flow */ comments from the npm package. But we would lose all of the useful information contained inside those annotations. If we had a transform able to put the annotations in a comment, that would be much better...

Anyway, I'm open to discuss the best way to fix this so I can start working on a pull-request and/or a new transform for flow annotations!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions