寫項(xiàng)目過程中用ESLint遵守代碼規(guī)范很有必要,但是對(duì)于一些規(guī)范也很是無(wú)語(yǔ)傲绣,比如:‘Unexpected console statement (no-console)’店诗,連console都不能用炉抒,這就很抓狂了竭鞍。其實(shí)增加一行代碼即可板惑。
修改package.json中的eslintConfig:{} 中的 “rules”:{},增加一行代碼: "no-console":"off"
?? "eslintConfig": {
? ? "root": true,
? ? "env": {
? ? ? "node": true
? ? },
? ? "extends": [
? ? ? "plugin:vue/essential",
? ? ? "eslint:recommended"
? ? ],
? ? "rules": {
? ? ? "no-console":"off"
? ? },
? ? "parserOptions": {
? ? ? "parser": "babel-eslint"
? ? }
},
作者:嗯哼曼
鏈接:http://www.reibang.com/p/4f2a6ca1f562
來源:簡(jiǎn)書
著作權(quán)歸作者所有偎快。商業(yè)轉(zhuǎn)載請(qǐng)聯(lián)系作者獲得授權(quán),非商業(yè)轉(zhuǎn)載請(qǐng)注明出處洽胶。