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 回车

    原文作者:帕奇式
    原文地址: https://segmentfault.com/a/1190000007260446
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞