使用vue-cli腳手架構建了webpack項目,在開發過程中,Eslint驗證太嚴謹了,重新設置eslink


使用vue-cli腳手架構建了webpack項目,在開發過程中,開始設置eslink的時候不小心設置了yes,然后可能因為縮進等代碼不規范的情況下出現類似以下這種情況:

   

這種時候就要重新設置eslink了。

在webpack.base.conf.js里面刪掉下面:

preLoaders: [
      {
        test: /\.vue$/, loader: 'eslint', include: projectRoot, exclude: [/node_modules/, /ignore_lib/] }, { test: /\.js$/, loader: 'eslint', include: projectRoot, exclude: [/node_modules/, /ignore_lib/] } ]
也有些是
module: {
rules: [
// {
// test: /\.(js|vue)$/,
// // loader: 'eslint-loader',
// enforce: 'pre',
// include: [resolve('src'), resolve('test')],
// options: {
// formatter: require('eslint-friendly-formatter')
// }
// },
注:只注釋 // loader: 'eslint-loader'。不可以,報錯。
 
為了解決問題而不擇手段,切不可因為問題而逃避。加油!
 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM