sublime text3 jshint 安裝

官方文檔:
node

https://github.com/victorporof/Sublime-JSHintgit


操做步驟:github

安裝node.jsspa

jshint使用nodejs的引擎來檢測js語法.因此須要先安裝node.js插件

nodejs下載地址code

http://nodejs.org/download/文檔

安裝後,在cmd下敲打 node 看看有沒有執行成功.cmd

沒有執行成功 將 node.exe 的地址加入到path裏. [注意:win7 path最後不要有反斜槓]
it


安裝jshint插件io

打開sublime text3

ctrl+shift+p

install package

選擇JSHint Gutter

配置node的地址, 重啓st3.

鼠標右鍵裏已經有了js hint


JS hint 設置

在右鍵->jshint->Set Linting Preferences  中,將如下倆項設置爲false.

  "globalstrict": false, //再也不提醒 use strict
  "undef": false,  //不提醒 未定義變量

在右鍵->jshint->Set Plugin Options 中, 將如下一項設置爲true.

  "lint_on_save": true, //保存時檢測語法
相關文章
相關標籤/搜索