windows7 下安装Closure Linter

Closure Linter 官网 http://code.google.com/p/closure-linter/

安装:

1.closure linter 是在python下运行的,所以先安装python

2.下载对应 Python 版本的 Easy Install module 并进行安装. 也就是要安装 setuptools windows下本人安装的为: setuptools-0.6c11.win32-py2.5.exe

3. 确保 Easy Install 配置到Path环境变量。我的电脑 -- 高级系统设置 -- 高级 -- 环境变量 -- 系统变量 -- PATH --添加安装的目录 “;D:\Program Files\Python\Scripts\”

4.在CMD使用命令安装 Closure Linter:

 easy_install http://closure-linter.googlecode.com/files/closure_linter-latest.tar.gz

一、使用:

校验JS文件(必须以.js为后缀):

gjslint -r {JavaScript 文件的绝对路径}

修正JS文件:

fixjsstyle -r {JavaScript 文件的绝对路径}

二、集成到Nodepad++

1. 安装 NppExec 插件

通过菜单进入 Plugins -> Plugin Manager -> Show Plugin Manager, 并选择安装 NppExec 插件.

2.校验JS文件:

 按F6打开插件面板,输入以下命令(可将命令另存为):

 gjslint $(FULL_CURRENT_PATH)

3.修正JS文件:

 按F6打开插件面板,输入以下命令(可将命令另存为):

 fixjsstyle $(FULL_CURRENT_PATH)

原文地址:https://www.cnblogs.com/bennman/p/2536563.html