SublimeLinter

关于代码检查 郑重推荐这个插件

官方插件库中仅有sublime3 有此插件

(对于ST2 有个sublimeLinter for ST2 没试过)

SublimeLinter只是一个检测环境, 检测的功能还需其他插件来完成, 安装好SublimeLinter后, 再装SublimeLinter-jscs SublimeLinter-csslint 之类的插件

环境

  • NodeJS
  • NodeJS 中还需全局安装 jscs jshint csslint

当然了, 如果你只用jscs 就只安装jscs这个模块啦

用户配置

官方配置文档 http://www.sublimelinter.com/en/latest/global_settings.html

PS path是自动寻找的, 无需手动指定

{
"user": {
"debug": false,
"delay": 0.25,
"error_color": "D02000",
"gutter_theme": "Packages/SublimeLinter/gutter-themes/Blueberry/round/Blueberry - round.gutter-theme",
"gutter_theme_excludes": [],
"lint_mode": "load/save", //保存的时候运行代码检查
"linters": {
"csslint": {
"@disable": false,
"args": [],
"errors": "",
"excludes": [],
"ignore": "box-model,adjoining-classes,box-sizing,compatible-vendor-prefixes,gradients,text-indent,fallback-colors,star-property-hack,underscore-property-hack,bulletproof-font-face,font-faces,import,regex-selectors,universal-selector,unqualified-attributes,overqualified-elements,duplicate-background-images,floats,font-sizes,ids,important,outline-none,qualified-headings,unique-headings",
"warnings": ""
},
"jscs": {
"@disable": false,
"args": [
"--config",
"C:\\Users\\rakuluo\\AppData\\Roaming\\Sublime Text 3\\Packages\\User\\.jscsrc"
],
"excludes": []
},
"jshint": {
"@disable": true,
"args": [
"--config",
"C:\\Users\\rakuluo\\AppData\\Roaming\\Sublime Text 3\\Packages\\User\\.jshintrc"
],
"excludes": []
},
"scss": {
"@disable": false,
"args": [
"--config",
"C:\\Users\\xxxx\\AppData\\Roaming\\Sublime Text 3\\Packages\\User\\.scss-lint.yml"
],
"exclude-linter": "",
"excludes": [],
"include-linter": ""
}
},
"mark_style": "outline",
"no_column_highlights_line": false,
"passive_warnings": false,
"rc_search_limit": 3,
"shell_timeout": 10,
"show_errors_on_save": false,
"show_marks_in_minimap": true,
"syntax_map": {
"html (django)": "html",
"html (rails)": "html",
"html 5": "html",
"javascript (babel)": "javascript",
"php": "html",
"python django": "python"
},
"warning_color": "DDB700",
"wrap_find": true
}
}

其中 C:\Users\rakuluo\AppData\Roaming\Sublime Text 3\Packages\ 是 Browse Packages 的路径

jsrc csslint 配置文件

jsrc csslint的配置文件可以在http://imweb.github.io/CodeGuide/下载 之后放在Packages 的 User 目录下

更多配置http://imweb.github.io/CodeGuide/

使用

        "lint_mode": "load/save", //保存的时候运行代码检查

之后可以在保存时显示感叹号和warning的框, 光标移动到warning时将会在状态栏显示详细错误信息

SublimeLinter的更多相关文章

  1. 在Sublime Text 3 中安装SublimeLinter,Node.js进行JS&CSS代码校验

    转载自:http://www.wiibil.com/website/sublimelinter-jshint-csslint.html 在Sublime Text中安装SublimeLinter,No ...

  2. sublime插件@sublimelinter安装使用

    sublimelinter插件是一款sublime编辑器的代码校验插件,支持多种语言,对于前端来说主要包含css和js校验. 要是用这款插件 1)安装node,然后在全局安装jshint(npm in ...

  3. 求教Sublime Text2 SublimeLinter插件安装问题

    昨天装了 SublimeLinter插件(代码语法检测),这个事插件的地址:https://github.com/Kronuz/SublimeLinter 按照作者的介绍配置了一下,发现语法检测不起作 ...

  4. 借助 SublimeLinter 编写高质量的 JavaScript & CSS 代码

    SublimeLinter 是前端编码利器——Sublime Text 的一款插件,用于高亮提示用户编写的代码中存在的不规范和错误的写法,支持 JavaScript.CSS.HTML.Java.PHP ...

  5. 在SUBLIME TEXT中安装SUBLIMELINTER进行JS&CSS代码校验

    一:Sublime Text 中需要先安装Package Control.(如果有则无需安装) 安装方法:打开Sublime Text控制台(快捷键Ctrl+`),在控制台粘贴以下代码,按回车执行. ...

  6. 代码校验工具 SublimeLinter 的安装与使用

    SublimeLinter 是 Sublime 的插件,它的作用是检查代码语法是否有错误,并提示.习惯了 IDE 下写代码的人一定需要一款在 Sublime 上类似的语法检查工具.下面我们开始. 安装 ...

  7. 解决Mac下SublimeLinter的Unsafe Characters警告

    Mac下编辑JS文件, 如果是中文字符的行会警告: This character may get silently deleted by one or more browsers. SublimeLi ...

  8. sublime中安装sublimelinter php 语法检查

    打开控制台,install package 搜 sublimelinter 先安装sublimelinter本体 安装完以后再搜索一下,安装sublimelinter-php 接下来,打开prefer ...

  9. SublimeLinter 3中使用jshint

    这货得知已久,在sublime2时期对着教程按部就班的凑合用着...不明所以. 今天无意发现SublimeLinter终于出3了,果断装之,鼓捣1个多小时,磕磕绊绊终于成功工作了.期间看了无数英文文档 ...

随机推荐

  1. RemoveAll 要重写equals方法

    public class User { private String name; private int age; //setter and getter public String getName( ...

  2. c++常用IDE

    vs2013. CodeLite (c/c++/PHP) codeBlocks Qt Creator Xcode

  3. PHP Curl CURLOPT_POSTFIELDS 1024

    resolve : curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:')); url: http://www.laruence.com/2011/ ...

  4. leetcode Binary Tree Right Side View python

    # Definition for a binary tree node. # class TreeNode(object): # def __init__(self, x): # self.val = ...

  5. leetcode Linked List Cycle python

    # Definition for singly-linked list. # class ListNode(object): # def __init__(self, x): # self.val = ...

  6. Java学习之Java实现CallBack功能

    回调函数实际上就是在调用某个函数(通常是API函数)时,将自己的一个函数(这个函数为回调函数)的地址作为参数传递给那个函数.而那个函数在需要的时候,利用传递的地址调用回调函数,这时你可以利用这个机会在 ...

  7. 原版Windows XP Pro With SP3 VOL MSDN简体中文专业版

    2008年5月2日,微软推出Windows XP Pro With SP3 VOL MSDN x86 32位简体中文专业版,这是最经典也是我最喜爱的操作系统之一.在MSDN(微软开发者网络)的网站上查 ...

  8. C语言入门(3)——对Hello World程序的解释

    上篇我们写了一个最简单的程序.这个简单的程序包含了很多重要的内容.本篇我们通过这个最简单的Hello World程序逐一讲解C语言程序的一些特点. 打开Visual Studio 2013 通过菜单- ...

  9. HDU 3037 Saving Beans(Lucas定理的直接应用)

    解题思路: 直接求C(n+m , m) % p , 由于n , m ,p都非常大,所以要用Lucas定理来解决大组合数取模的问题. #include <string.h> #include ...

  10. C++中顶层const和底层const

    1. 顶层 const 与底层 const 概念 指针本身是一个对象,由于,指针实际相应着内存单元的一段存储空间,然而,指针所指向的也是一个数据对象,因此,指针是一个常量与指针所指向的是一个常量是两个 ...