Sublime Text 3中SublimeLinter的使用
2024-10-19 02:22:12
关于Sublime Text 2中的SublimeLinter的使用网上多如牛毛,基本上不会遇到什么问题,简单的讲一下关于Sublime Text 3中遇到的问题:
1.通过package control(cmd+shift+p),搜索SublimeLinter,安装,如果按照网上的配置是没法进行JS和CSS校验的;
2.安装jshint,csslint,SublimeLinter在Text 3中自己本身演变成了一个框架,关于各个语言校验的集合,关于各种语言的校验又拆成对应的小模块:
(需要安装node,如果没有安装的可以参考本人之前的文章)
安装jshint:
npm install -g jshint
安装csslint:
npm install -g csslint
3.这个时候不要急于配置,还需要两个对应的插件SublimeLinter-jshint以及SublimeLinter-csslint,如果没有出错的话,这个时候是有对应的JS和CSS警告以及提示的;
4.配置可选项,SublimeLinter向下兼容,配置选项参考网上前辈的配置:
{
"sublimelinter": "save-only",
"sublimelinter_popup_errors_on_save": true,
"sublimelinter_executable_map": {
"javascript": "http://www.cnblogs.com/xiaofeixiang/",
"css": "http://www.cnblogs.com/xiaofeixiang/"
},
"jshint_options": {
"strict": false,
"quotmark": "single", //只能使用单引号
"noarg": true,
"noempty": true, //不允许使用空语句块{}
"eqeqeq": false, //!==和===检查
"undef": true,
"curly": true, //值为true时,不能省略循环和条件语句后的大括号
"forin": true, //for in hasOwnPropery检查
"devel": true,
"jquery": true,
"browser": true,
"wsh": true,
"evil": true,
"unused": "vars", //形参和变量未使用检查
"latedef": true, //先定义变量,后使用
"globals": {
"grunt": true,
"module": true,
"window": true,
"jQuery": true,
"$": true,
"global": true,
"document": true,
"console": true,
"setTimeout": true,
"setInterval": true
}
},
"csslint_options": {
"adjoining-classes": false,
"box-sizing": false,
"box-model": false,
"compatible-vendor-prefixes": false,
"floats": false,
"font-sizes": false,
"gradients": false,
"important": false,
"known-properties": false,
"outline-none": false,
"qualified-headings": false,
"regex-selectors": false,
"shorthand": false,
"text-indent": false,
"unique-headings": false,
"universal-selector": false,
"unqualified-attributes": false
}
}
5.如果对于SublimeLinter有兴趣可以参考官网:http://www.sublimelinter.com/en/latest/
最新文章
- vue.js学习(第一课)
- C++迪杰斯特拉算法求最短路径
- Arcgis SDE10.1 和 Arcgis server10.1的授权文件license
- ExtJs
- google protocol buffer 使用说明
- 移动设备和SharePoint 2013 - 第4部分:定位
- ubuntu桌面环境配置及切换
- 标准C编程-笔记全集
- 《Effective C++》:规定44-规定45
- Hbase在的应用经验的统计
- aync await 进一步探索
- 【JSP 标签】选择判断c:choose
- JavaScript实现动画效果
- 第一次C语言实验报告
- 初识Java——一维数组的创建及使用
- Login Verification CodeForces - 928A (实现)
- 初识css预处理器:Sass、LESS
- IntellIJ IDEA 配置 Vue 支持
- 什么是EOS(不一样的角度看柚子)
- 在多台PC之间同步Resharper所有设置的方法
热门文章
- php模板引擎之featherview
- ScrollView中嵌套GridView,Listview的办法
- BZOJ4278 : [ONTAK2015]Tasowanie
- shell 常用命令语句
- 接口开发-基于SpringBoot创建基础框架
- [Go] Beego 模板嵌套 使用总结
- C++ classes and uniform initialization
- ASP.NET Web API接受AngualrJS的QueryString的两种方式
- Android之仿iphone抖动效果
- Material Designer的低版本兼容实现(八)—— Flat Button