5to6 / 5to6-codemod

A collection of codemods that allow you to transform your js code from ES5 to ES6.
https://medium.com/@cpojer/effective-javascript-codemods-5a6686bb46fb
302 stars 36 forks source link

Unexpected token export #52

Open Geczy opened 6 years ago

Geczy commented 6 years ago

jscodeshift -t node_modules/5to6-codemod/transforms/amd.js src

Result:

    export default _;
    ^^^^^^

SyntaxError: Unexpected token export
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:616:28)
    at Module._extensions..js (module.js:663:10)
    at Object.require.extensions.(anonymous function) [as .js] (C:\Users\Matt\AppData\Local\Yarn\config\global\node_modules\babel-regist
er\lib\node.js:152:7)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
All done.
Results:
0 errors
0 unmodified
0 skipped
0 ok
Time elapsed: 1.729seconds

Node v8.11

xjamundx commented 6 years ago

I guess we don't have support for ES modules. Should be fairly easy to add, but I unfortunately don't have the time to add it. Will require an updated parser.