Errors when using this codemod in node_modules
rturk opened this issue · comments
Looks like some .js files use code that can't me read by this codemod
Complete error for one file
ERR node_modules/detect-newline/cli.js Transformation error
SyntaxError: 'return' outside of function (30:4)
at Parser.pp.raise (/usr/local/lib/node_modules/jscodeshift/node_modules/babylon/lib/parser/location.js:24:13)
at Parser.pp.parseReturnStatement (/usr/local/lib/node_modules/jscodeshift/node_modules/babylon/lib/parser/statement.js:275:10)
at Parser.pp.parseStatement (/usr/local/lib/node_modules/jscodeshift/node_modules/babylon/lib/parser/statement.js:89:19)
at Parser.parseStatement (/usr/local/lib/node_modules/jscodeshift/node_modules/babylon/lib/plugins/flow.js:655:22)
at Parser.pp.parseBlock (/usr/local/lib/node_modules/jscodeshift/node_modules/babylon/lib/parser/statement.js:442:21)
at Parser.pp.parseStatement (/usr/local/lib/node_modules/jscodeshift/node_modules/babylon/lib/parser/statement.js:105:19)
at Parser.parseStatement (/usr/local/lib/node_modules/jscodeshift/node_modules/babylon/lib/plugins/flow.js:655:22)
at Parser.pp.parseIfStatement (/usr/local/lib/node_modules/jscodeshift/node_modules/babylon/lib/parser/statement.js:268:26)
at Parser.pp.parseStatement (/usr/local/lib/node_modules/jscodeshift/node_modules/babylon/lib/parser/statement.js:87:19)
at Parser.parseStatement (/usr/local/lib/node_modules/jscodeshift/node_modules/babylon/lib/plugins/flow.js:655:22)
Same error occurs in:
ERR node_modules/jade/jade.js Transformation error
ERR node_modules/detect-indent/cli.js Transformation error
ERR node_modules/beeper/index.js Transformation error
ERR node_modules/esprima-fb/test/test.js Transformation error
ERR node_modules/jade/testing/user.js Transformation error
ERR node_modules/json5/test/stringify.js Transformation error
ERR node_modules/mkdirp/bin/cmd.js Transformation error
ERR node_modules/private/test/run.js Transformation error
this is a problem with jscodeshift, please report this issue there(https://github.com/facebook/jscodeshift/issues)