Skip to content

Instantly share code, notes, and snippets.

@willread
Last active August 29, 2015 14:24
Show Gist options
  • Save willread/d1551cb5dc7eceab475a to your computer and use it in GitHub Desktop.
Save willread/d1551cb5dc7eceab475a to your computer and use it in GitHub Desktop.
Code refactor checklist

Add a space between function and opening bracket

(function.+\))\{
$1 {

Dots should be at the start of a line, not the end

\.(\n\s*)(?=\S+)
$1.

Control flow statements should use proper whitespace

(^|\s+)(while|do|if|switch)\((.+)\{
$1$2 \($3\) \{

\}(\s*)(else|else if)(.*)\{
\} $2$3 \{
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment