zoukankan      html  css  js  c++  java
  • vue.js

    当我们使用vue开发项目时,发现经常报一些莫名的错误,什么空格没写、

    什么双引号要改为单引号,这对于有强迫症的同学来说,真是有句mmp不知当讲不当讲。

    因为vue版本的不同,所以不同版本的去掉eslint的方式也不同。因为网上没看到我这个版本的去除方法。

    所以我斗胆上传我这个版本的方法1:

    首先找到/build/webpack.base.conf.js文件,然后找到createLintingRule关键词所在地方

    具体配置如下:

    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
      // }
    })

    如上所示,把里面内容注释掉,然后npm run dev跑一跑。

    没错只要你不犯原则上的错误,它都是可以原谅的。

    如果你觉得上面的方法麻烦,没事还有一个简单点的方法:

    首先找到config/index.js文件夹,打开,

     // Various Dev Server settings
        host: 'localhost', // can be overwritten by process.env.HOST
        port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
        autoOpenBrowser: true,
        errorOverlay: true,
        notifyOnErrors: true,
        poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-
    
        // Use Eslint Loader?
        // If true, your code will be linted during bundling and
        // linting errors and warnings will be shown in the console.
        useEslint: false,  // 将这里改成false 就ok 了,默认是true。

    上面两张方法任意一种都可以让你肆无忌惮的写代码了。

  • 相关阅读:
    HDU----(4291)A Short problem(快速矩阵幂)
    HDU----(2157)How many ways??(快速矩阵幂)
    hdu---(2604)Queuing(矩阵快速幂)
    hdu---(5038)Grade(胡搞)
    齐次方程到矩阵(番外篇)
    uva--1339
    hdu----(5023)A Corrupt Mayor's Performance Art(线段树区间更新以及区间查询)
    hdu----(2848)Repository(trie树变形)
    hdu---(1800)Flying to the Mars(trie树)
    hdu----(1075)What Are You Talking About(trie之查找)
  • 原文地址:https://www.cnblogs.com/lafitewu/p/8308636.html
Copyright © 2011-2022 走看看