vue项目安装出现的问题No ESLint configuration found

用低版本脚手架安装vue项目时若选上ESLint时若出现No ESLint configuration found这样的错,解决方法如下:

  • npm init -y
  • npm install eslint --save-dev
  • ./node_modules/.bin/eslint --init

以上三步执行完后No ESLint configuration found的问题便解决了,但会有其他的错误,因此,如果项目中有.eslintrc.js文件则把里面的内容改为以下内容,若没有该文件建立后写入以下代码:

module.exports = {
  root: true,
  parserOptions: {
    parser: 'babel-eslint'
  },
  env: {
    browser: true,
  },
  extends: [
    error-prevention
   
    'plugin:vue/essential', 
   
    'standard'
  ],
  
  plugins: [
    'vue'
  ],
  
  rules: {
    
    'generator-star-spacing': 'off',
    
    'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
  }
}

现在在运行项目就没有错啦!✌️✌️✌️✌️✌️✌️

发布了93 篇原创文章 · 获赞 60 · 访问量 3万+

猜你喜欢

转载自blog.csdn.net/weixin_43363871/article/details/94838553
今日推荐