HTML5 Dev Gal

Messing with HTML5, CSS3 and JavaScript.

Automatic JavaScript Linting Fixes

| Comments

I was getting sick of manually fixing closure linter errors one by one so I created a shell script to do this recursivley over a directory or with a single file.

Requires closure compiler

#!/bin/bash
########################################################
## Fixes closure linter ##
## (https://developers.google.com/closure/utilities/) ##
## errors in JavaScript files. Requires closure ##
## compiler ##
## (https://developers.google.com/closure/compiler/) ##
## ##
## Usage: ##
## fixjs /path/myfile.js or ##
## fixjs /path ##
########################################################
for file in $(find $1 -name "*.js");
do
echo $file
fixjsstyle --strict --jsdoc --custom_jsdoc_tags=file,namespace,memberof,function,inner,public,private,protected,todo $file
done
view raw fixjs.sh hosted with ❤ by GitHub

Comments