寫個 script 在 shell 透過 rhino.jar 跑 fulljslint.js,在 Vim 也寫個 function 呼叫它,於是可以用 quickfix window 除錯。
取得檔案
- fulljslint.js - douglascrockford/JSLint - GitHub
- json2.js - douglascrockford/JSON-js - GitHub
- rhino.jar - Download Rhino - MDC Doc Center (即 rhino1_7R2.zip 裡的 js.jar)
- bin/jslint、scripts/jslint.js 和 vimrc 設定例 - gist: 754754 - Using JSLint command within Vim.- GitHub
- 以上 js 檔案皆沒壓縮,實際使用前我會先讓 closure-complier 壓一下。