Skip to content

Instantly share code, notes, and snippets.

@gilbarbara
Last active December 2, 2015 18:53
Show Gist options
  • Save gilbarbara/7cbf1deb76fc41133ace to your computer and use it in GitHub Desktop.
Save gilbarbara/7cbf1deb76fc41133ace to your computer and use it in GitHub Desktop.
Regex ES2015
# 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