sublime的js代码检测的插件(by jshint)

项目地址:Sublime-JSHint

安装

  • Ctrl+Shift+P or Cmd+Shift+P in Linux/Windows/OS X

  • 输入 install, 选择 Package Control: Install Package

  • 输入 js gutter, 选择 JSHint Gutter

配置

  • Ctrl+Shift+P or Cmd+Shift+P

  • 输入 jshint, 选择 Set node Path

  • 然后找到你的系统,并把node.exe地址填入即可

像这样:

{
  // Simply using `node` without specifying a path sometimes doesn't work :(
  // https://github.com/victorporof/Sublime-JSHint#oh-noez-command-not-found
  // http://nodejs.org/#download
  "node_path": {
    "windows": "C:/nodejs/node.exe", 
    "linux": "/usr/bin/nodejs",
    "osx": "/usr/local/bin/node"
  },

  // Automatically lint on edit (Sublime Text 3 only).
  // 如设置true会在编辑时运行jshint
  "lint_on_edit": false,

  // Configurable duration before re-linting.
  // 设置编辑后间隔多久才运行jshint
  "lint_on_edit_timeout": 1,

  // Automatically lint when a file is loaded.
  // 如设置true会在加载后运行jshint
  "lint_on_load": false,

  // Automatically lint when a file is saved.
  // 如设置true会在保存后运行jshint
  "lint_on_save": true,

  // Highlight problematic regions when selected.
  "highlight_selected_regions": true,

  // Log the settings passed to JSHint from `.jshintrc`.
  // 是否打印.jshintrc配置到控制台
  "print_diagnostics": false
}

使用

可多种方式,当然如果在JSHint设置了lint_on_savetrue将会在保存后自动运行。

  • 右键 -> JSHint -> Lint Code

  • Ctrl+Shift+P ,输入jshint 回车

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值