Skip to content

Instantly share code, notes, and snippets.

@keiththomps
Last active August 29, 2015 14:16
Show Gist options
  • Save keiththomps/e890e56f4433625d2c88 to your computer and use it in GitHub Desktop.
Save keiththomps/e890e56f4433625d2c88 to your computer and use it in GitHub Desktop.
Finding JS inconsistencies
#!/usr/bin/env zsh -i
echo "Files containing unnecessarily named functions:" $(ag "\w+\s*:\s*function\s*\w+\s*\(" app/assets/javascripts -l | wc -l)
echo "Files containing bad spaces in function expressions:" $(ag "(function \(|function(\s\w+)?\(.*\){)" app/assets/javascripts -l | wc -l)
echo "Files containing { on new line:" $(ag "^\s*\{\s*$" app/assets/javascripts -l | wc -l)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment