Last active
December 2, 2015 18:53
-
-
Save gilbarbara/7cbf1deb76fc41133ace to your computer and use it in GitHub Desktop.
Regex ES2015
This file contains 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
# replace require to imports | |
^.*?([^ ]+)\s+= require\(([^ ,;]+)\)[,;]$ | |
import $1 from $2; | |
# replace React.createClass | |
[varletcons]+ (\w+) = React.createClass\(\{ | |
export default class $1 extends React.Component { | |
# replace function with arrows | |
function (\(.*\)) | |
$1 => |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment