Ubuntu10.10下安装Google Closure Linter检查javascript语法
2010-12-25 12:55
435 查看
使用ubuntu系统和vim的时间都不长,有些东西做了还是记一下的好,写着留着以后方便查。
以下Google Closure Linter简称GCL。
1.安装vim ubuntu10.10默认是不装vim,所以要先装vim:【Emacs党、gedit党请无视……】
sudo apt-get install vim
2.安装python的easy_install模块(安装GCL的时候要用):
sudo apt-get install python-setuptools
3.安装GCL:
sudo easy_install http://closure-linter.googlecode.com/files/closure_linter-latest.tar.gz
OK,大功告成,接下来就可以用 gjslint [filename] 来检查某个js文件的语法了。
写了一个试了下,发觉了几个检查的规则:
1.变量之间的逗号后要有1个空格
2.所有变量定义后都需要分号结束
3.缩进为4格,这里要说一下,vim默认缩进是8格,所以我tab打出的缩进都被判定非法,
用sudo vim /etc/vim/vimrc 把vim配置文件里的最后加上set tabstop=4然后保存,以后默认就会是4格缩进。
附Google Closure系列工具县官的网址 http://code.google.com/intl/zh-CN/closure/utilities/index.html
以下Google Closure Linter简称GCL。
1.安装vim ubuntu10.10默认是不装vim,所以要先装vim:【Emacs党、gedit党请无视……】
sudo apt-get install vim
2.安装python的easy_install模块(安装GCL的时候要用):
sudo apt-get install python-setuptools
3.安装GCL:
sudo easy_install http://closure-linter.googlecode.com/files/closure_linter-latest.tar.gz
OK,大功告成,接下来就可以用 gjslint [filename] 来检查某个js文件的语法了。
写了一个试了下,发觉了几个检查的规则:
1.变量之间的逗号后要有1个空格
2.所有变量定义后都需要分号结束
3.缩进为4格,这里要说一下,vim默认缩进是8格,所以我tab打出的缩进都被判定非法,
用sudo vim /etc/vim/vimrc 把vim配置文件里的最后加上set tabstop=4然后保存,以后默认就会是4格缩进。
附Google Closure系列工具县官的网址 http://code.google.com/intl/zh-CN/closure/utilities/index.html
相关文章推荐
- 在 UltraEdit 中安装jlint 对javascript做语法检查
- 在Notepad++使用Google Closure Linter校验JavaScript代码
- Ubuntu10.10下安装配置tftp服务器
- ubuntu 12.04 安装google中文输入法
- Ubuntu10.10安装重启后黑屏
- vs2008下的javascript语法检查工具——JSLint.VS
- UBUNTU10.10安装LAMP(Linux、Apache、Mysql、Php)环境图文教程
- Ubuntu Server 10.10安装配置Nginx+php-fpm+mysql
- ubuntu10.10 下安装Boost C++ library
- 安装Ubuntu10.10-desktop
- 在ubuntu16 版本下安装谷歌启动google_chrome报错
- ubuntu10.10安装笔记
- 硬盘安装Ubuntu10.10
- Ubuntu下安装Android SDK(图文教程)[解决Google地址被墙问题]
- linux下安装postgresql 8【ubuntu 10.10】
- javascript 格式化和语法检查链接网站
- skye1.3.2 ubuntu10.10 安装
- 【转】ubuntu10.10下安装锐捷客户端
- VM下Ubuntu10.10里安装VMtools成功还是无法显示共享文件夹问题
- XP硬盘安装Ubuntu 10.10系统