Skip to content

Instantly share code, notes, and snippets.

@skratchdot
Last active December 9, 2016 15:42
Show Gist options
  • Select an option

  • Save skratchdot/8a71a36fbc30bcaa8c6e4bba463f595c to your computer and use it in GitHub Desktop.

Select an option

Save skratchdot/8a71a36fbc30bcaa8c6e4bba463f595c to your computer and use it in GitHub Desktop.
jscodeshift transforms
export default function transformer(file, api) {
const j = api.jscodeshift;
return '\'use strict\';\n' + j(file.source)
.find(j.ExpressionStatement)
.filter((path) => path.value.expression.value === 'use strict')
.remove()
.toSource();
}
export default function transformer(file, api) {
const j = api.jscodeshift;
return j(file.source)
.find(j.ExpressionStatement)
.filter((path) => path.value.expression.value === 'use strict')
.remove()
.toSource();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment