Skip to content

Instantly share code, notes, and snippets.

@SebastienElet
Created August 12, 2016 10:06
Show Gist options
  • Save SebastienElet/ae4d2f37d09a8e18a55b97864b590609 to your computer and use it in GitHub Desktop.
Save SebastienElet/ae4d2f37d09a8e18a55b97864b590609 to your computer and use it in GitHub Desktop.
es5-to-es6.sh
CODEMOD_PATH="/tmp/js-codemod"
npm i -g eslint jscodeshift
git clone https://github.com/cpojer/js-codemod.git
# Run eslint fix
npm run cli eslint --fix "$1"
# Run es6 codemod
for codemod in no-vars template-literals object-shorthand unchain-variables unquote-properties updated-computed-props;
do
jscodeshift -t $CODEMOD_PATH/$codemod.js "$1"
done
jscodeshift -t $CODEMOD_PATH/arrow-function.js --inline-single-expressions=true "$1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment