facebookarchive / flow-remove-types

🚿 Removes Flow type annotations from JavaScript files with speed and simplicity.
MIT License
467 stars 52 forks source link

Output not parsing flow #41

Closed WebDevMichael closed 7 years ago

WebDevMichael commented 7 years ago

When I use the command flow-remove-types src/services/context/index.js > TEST.js For demo purposes I just selected a few flow syntax from our code to pass through flow-remove-types, I get the following output, the same as the input, nothing has been parsed:

`const Context = require('./models/Context'); const ContextDialogstate = require('./models/ContextDialogstate'); const Dialogstate = require('../dialogstate/models/Dialogstate');

const getContextDialogstateByType = async (dialogstateId: number, type: string) => { const contextDialogstates = await ContextDialogstate .where({ dialogstate_id: dialogstateId, type }) .fetchAll({ withRelated: ['context'], });

return contextDialogstates ? contextDialogstates.toJSON() : null; };`

(No need to paste input source code and output source code, they are identical)

It doesn't work either when I use the following command flow-remove-types -d lib/src/ ./src, the files are just copied without parsing flow

WebDevMichael commented 7 years ago

Don't forget to add @flow at the top of the file. Oops