leebyron / rollup-plugin-flow

Rollup plugin for removing Flow type annotations.
Other
80 stars 11 forks source link

Maybe an option to enforce the removal of the annotation #2

Closed caridy closed 7 years ago

caridy commented 8 years ago

Normally, /* @flow */ is added to the files, but for big projects, this is a pain. There are already multiple ways to force flow type validation in all files, e.g.: .eslintrc

    "settings": {
        "flowtype": {
            "onlyFilesWithFlowAnnotation": false
        }
    }

But it seems that there is no way to force the removal of the annotations from all .js files using this plugin. Even when using Flow({include: '**/*.js'}) it only guarantee that the file is inspected, but no removal will happen unless the annotation is in place.

Any suggestion?

/cc @jeffmo

diervo commented 8 years ago

@caridy There is already an option in flow-remove-types called checkPragma, is just not exposed. https://github.com/leebyron/flow-remove-types/blob/master/index.js#L11-L21 Will be trivial to add it here. @leebyron I would happily make a PR if you are ok adding this option.

leebyron commented 7 years ago

Just added the ability to do this in v1.1.0 with flow({all:true})