2.2.0 • Published 10 years ago
urad-make-eslint v2.2.0
urAD JavaScript Coding Style
安裝
Setp 1
從 npmjs.org 下載、安裝 urAD 共用的 eslint 設定檔到專案內,安裝過程中會在 pwd 下產生 .eslinerc 檔案、dependencies.mk 兩個檔案
$ npm i --save urad-make-eslintStep 2
建立 Makefile
# 載入相依的 Makefile
# 他會包含我們 urad-make-eslint 下的 index.mk
include dependencies.mk
# 取得所有 js 檔案位置
# $(shell ...) 請替換成取得所有專案內 js 檔的指令
SRC = $(shell find lib/ -type f -name '*.js')使用
$ make eslint如何閱讀錯誤訊息

- 檔案位置(index.js)
- 問題發生的行數、欄數(25 行、25 欄)
- 錯誤等級
- 錯誤訊息
- rule 名稱,可以用他到 eslint 網站上取得詳細說明(http://eslint.org/docs/rules/quotes)