项目地点:Sublime-JSHint
装置
Ctrl+Shift+P
orCmd+Shift+P
in Linux/Windows/OS X输入 install, 挑选 Package Control: Install Package
输入 js gutter, 挑选 JSHint Gutter
设置
Ctrl+Shift+P
orCmd+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_save
为true
将会在保留后自动运转。
右键 -> JSHint -> Lint Code
Ctrl+Shift+P
,输入jshint
回车