Useeslint-disable-next-line to ignore the next line. Use eslint-disable to ignore all warn

    xiaoxiao2022-07-07  150

    报错内容

    error: Too many blank lines at the end of file. Max of 0 allowed (no-multiple-empty-lines) at src\view\product\index.vue:107:1: 105 | } 106 | </script> > 107 | | ^ 108 | 100 errors found. 100 errors potentially fixable with the `--fix` option. You may use special comments to disable some warnings. Use // eslint-disable-next-line to ignore the next line. Use /* eslint-disable */ to ignore all warnings in a file.

    如图

     

    出现上边的警告并不影响程序正常运行,但是看着比较烦

    出现的原因是因为开启了eslint 编码规范检查

    解决办法:

    办法一:在 webpack.base.conf.js 文件中,找到 module 节点下的 rules 节点,注释掉这一行     

    // ...(config.dev.useEslint ? [createLintingRule()] : []),

     

    办法二:如果是较新版本的 vue ,使用的不是 webpack.base.conf.js 配置,而是 vue-cli-service 配置,找到 vue.config.js 文件,将 lintOnSave 设为 false 即可

     

    最新回复(0)