Skip to content

Instantly share code, notes, and snippets.

@zhukov
Created June 28, 2016 16:16
Show Gist options
  • Save zhukov/20aea28d8631d189bdef35c9397c8ec6 to your computer and use it in GitHub Desktop.
Save zhukov/20aea28d8631d189bdef35c9397c8ec6 to your computer and use it in GitHub Desktop.
Some RegExp to migrate to standard.js `single declaration per var` rule

In Sublime Text, "Find in folder" on folder with code

  1. (var [^;]+?),\s*([a-z0-9]+? =) => \1; var \2

  2. (for \(var [^);]+); var => \1, \2

  3. (var [^()]+),\n? (\S+(\n|$|,)) => \1; var \2

Repeat each up to 10 times.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment