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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |