Using Google Closure Compiler, analyze a directory of javascript files. "It also checks syntax, variable references, and types, and warns about common JavaScript pitfalls."