报错You may use special comments to disable some warnings.vue-cli脚手架关闭eslint的步骤

简介: 报错You may use special comments to disable some warnings.vue-cli脚手架关闭eslint的步骤

打开 build文件夹下面的webpack.base.conf.js;

找到下面这段代码,并将它注释掉:

const createLintingRule = () => ({
  // test: /\.(js|vue)$/,
  // loader: 'eslint-loader',
  // enforce: 'pre',
  // include: [resolve('src'), resolve('test')],
  // options: {
  //   formatter: require('eslint-friendly-formatter'),
  //   emitWarning: !config.dev.showEslintErrorsInOverlay
  // }
})

重启项目,正常情况下这样就可以解决了。

________________________

如果以上办法还不能解决,就看下面的方法:

在build文件夹下面的webpack.base.conf.js中找到

注释掉上面43行代码即可

  module: {
    rules: [
      // ...(config.dev.useEslint ? [createLintingRule()] : []),
      {
        test: /\.vue$/,
        loader: 'vue-loader',
        options: vueLoaderConfig
      },


相关文章
|
5月前
|
JavaScript 前端开发 开发者
vue3+ts配置跨域报错问题解决:> newpro2@0.1.0 serve > vue-cli-service serve ERROR Invalid options in vue.
【6月更文挑战第3天】在 Vue CLI 项目中遇到 "ERROR Invalid options in vue.config.js: ‘server’ is not allowed" 错误是因为尝试在 `vue.config.js` 中使用不被支持的 `server` 选项。正确配置开发服务器(如代理)应使用 `devServer` 对象,例如设置代理到 `http://xxx.com/`: ```javascript module.exports = { devServer: {
259 1
|
2月前
|
缓存 JavaScript 前端开发
8种方法解决vue创建项目报错:command failed: npm install --loglevel error
该文章提供了八种解决Vue项目创建时遇到的`command failed: npm install --loglevel error`错误的方法,包括清理缓存、更换npm源、重新安装Node.js等措施。
8种方法解决vue创建项目报错:command failed: npm install --loglevel error
|
JavaScript
Vue 解决 Warning: [antdv: LocaleProvider] `LocaleProvider` is deprecated. Please use `locale` .....
Vue 解决 Warning: [antdv: LocaleProvider] `LocaleProvider` is deprecated. Please use `locale` .....
222 0
|
3月前
|
开发框架 小程序
uniApp——Eslint报错'uni' is not defined
uniApp——Eslint报错'uni' is not defined
130 0
|
4月前
|
JavaScript
Eslint-------error ‘Vue‘ is not defined no-undef
Eslint-------error ‘Vue‘ is not defined no-undef
|
6月前
|
JavaScript
vue3的警告问题 [Vue warn]: inject() can only be used inside setup() or functional components. 怎么解决?
vue3的警告问题 [Vue warn]: inject() can only be used inside setup() or functional components. 怎么解决?
355 5
|
JavaScript
vue报错: ERROR ~/.vuerc may be outdated. Please delete it and re-run vue-cli in manual mode.
vue报错: ERROR ~/.vuerc may be outdated. Please delete it and re-run vue-cli in manual mode.
174 0
vue报错: ERROR ~/.vuerc may be outdated. Please delete it and re-run vue-cli in manual mode.
|
11月前
|
JavaScript
Vue:You may use special comments to disable some warnings.
Vue:You may use special comments to disable some warnings.
|
JavaScript
vue.js实战案例(3):vue启动项目报错npm ERR! missing script: serve的解决方法
vue.js实战案例(3):vue启动项目报错npm ERR! missing script: serve的解决方法
634 0
npm install报错peerDependencies WARNING eslint-plugin-vue@^5.2.3 requires a peer of eslint@^5.0.0 but
npm install 报错,以为是npm问题,改成cnpm install,也还是报错,根据错误信息提示,推断是eslint版本不兼容。
732 0