Last active
December 9, 2016 15:42
-
-
Save skratchdot/8a71a36fbc30bcaa8c6e4bba463f595c to your computer and use it in GitHub Desktop.
jscodeshift transforms
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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