sublimelinter-jshinter

---

ocalhost:~ nihao$ sudo npm install jshint -g
Password:
/usr/local/bin/jshint -> /usr/local/lib/node_modules/jshint/bin/jshint
[email protected] /usr/local/lib/node_modules/jshint
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected])
├── [email protected] ([email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
localhost:~ nihao$


-

设置配置文件:

SublineText》Preferences》Package Settings》Package Control》Settings-User》
=================================================

{
    "installed_packages":
    [
        "HTML-CSS-JS Prettify",
        "Node Completions",
        "SublimeLinter-jshint"
    ],

    "sublimelinter": "save-only",
    "sublimelinter_popup_errors_on_save": true,
    "sublimelinter_executable_map": {
        "javascript": "/usr/local/bin/node",
        "css": "/usr/local/bin/node"//"D:/nodejs/node.exe"
    },
    "jshint_options": {
        "strict": false,
        "quotmark": "single", //只能使用单引号
        "noarg": true,
        "noempty": true, //不允许使用空语句块{}
        "eqeqeq": true, //!==和===检查
        "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
    }

}

 


--

--MAC安装Sublime Linter - jshint 插件:
在mac sublime中按下:commond+shift+p
在弹出的输入框中输入:install package
然后在弹出的输入框中输入选择:sublimelinter 
然后继续安装:sublimelinter-jshint

在Node中安装:npm install jshint -g

 

 

--

Package Control Messages
========================

SublimeLinter:
-------------


____ _ _ _ _ _ _
/ ___| _ _| |__ | (_)_ __ ___ ___| | (_)_ __ | |_ ___ _ __
\___ \| | | | '_ \| | | '_ ` _ \ / _ \ | | | '_ \| __/ _ \ '__|
___) | |_| | |_) | | | | | | | | __/ |___| | | | | || __/ |
|____/ \__,_|_.__/|_|_|_| |_| |_|\___|_____|_|_| |_|\__\___|_|


Welcome to SublimeLinter, a linter framework for Sublime Text 3.

* * * IMPORTANT! * * *

SublimeLinter 3 is NOT a drop-in replacement for
earlier versions.

Linters *NOT* included with SublimeLinter 3,
they must be installed separately.

The settings are different.

* * * READ THE DOCS! * * *

Otherwise you will never know how to install linters, nor will
you know about all of the great new features in SublimeLinter 3.

For complete documentation on how to install and use SublimeLinter,
please see:

http://www.sublimelinter.com


_ _ _ _
| | | | ___| |_ __ | |
| |_| |/ _ \ | '_ \| |
| _ | __/ | |_) |_|
|_| |_|\___|_| .__/(_)
|_|


Hundreds of hours have been spent writing and documenting SublimeLinter
to make it the best it can be — easy to use, easy to configure,
easy to update, easy to extend. If you use SublimeLinter and feel
it is making your coding life better and easier, please consider
making a donation to help fund development and support.

To donate: https://github.com/SublimeLinter/SublimeLinter3#share-the-love

Thank you!

--

 

Package Control Messages
========================

SublimeLinter-jshint:
--------------------

SublimeLinter-jshint
-------------------------------
This linter plugin for SublimeLinter provides an interface to jshint.

** IMPORTANT! **

Before this plugin will activate, you *must*
follow the installation instructions here:

https://github.com/SublimeLinter/SublimeLinter-jshint

-

.jshintrc 文件放在工程的根目录下:

{  
    "camelcase" : true,  
    "indent": 2,  
    "undef": true,  
    "quotmark": single,  
    "maxlen": 80,  
    "trailing": true,
    "curly": true  
}

 



----

 


参考资料
http://sublimelinter.readthedocs.org/en/latest/gutter_themes.html
https://github.com/SublimeLinter/SublimeLinter-jshint

JSHint Options

http://jshint.com/docs/options/
http://cweili.gitcafe.com/jshint-options/
http://corncandy.github.io/2014/05/31/jshint-options/

--


window下得安装:


Sublime Text3安装jshint


win7 + sublime text3 + node.js

Sublime Text需安装插件:SublimeLinter 和 Sublimelinter-jshint。

Node.JS需安装包:npm install -g jshint

如果都是默认安装,以上应该就能用了。

如果Node没有安装在默认位置,在菜单里Tools -> SublimeLinter -> Open User Setting可以修改成实际安装位置。

--------------------

你可能感兴趣的:(sublime)