Sublime Text3 -- 安装sublimeLinter插件

1、下载'nodejs',网址 'http://nodejs.org/'

2、以管理员身份打开命令提示符,输入 'npm install -g jshint'

3、安装Package control 插件管理

4、[ctrl+shift+P]+输入'pci'+输入'SublimeLinter'

5、[ctrl+shift+P]+入'pci'+入'sublimeLinter-jshint'

6、配置SublimeLinter 的用户配置文件,Preferences->Package Settings->SublimeLinter->Settings - User

{
    "sublimelinter": "save-only",
    "sublimelinter_popup_errors_on_save": true,
    "sublimelinter_executable_map": {
        "javascript": "D:/Program Files/nodejs/node.exe",
        "css": "D:/Program Files/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
    }
}

7、重新开启 Sublime,[ctrl+shift+P]+输入'ssjs',即可使用jslint

8、在路径下新增文件'.jshintrc',即可定义规则

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值