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

快来打我* 2022-01-28 01:25 665阅读 0赞

报错内容

  1. 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:
  2. 105 | }
  3. 106 | </script>
  4. > 107 |
  5. | ^
  6. 108 |
  7. 100 errors found.
  8. 100 errors potentially fixable with the `--fix` option.
  9. You may use special comments to disable some warnings.
  10. Use // eslint-disable-next-line to ignore the next line.
  11. Use /* eslint-disable */ to ignore all warnings in a file.

如图

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dzanp6Y2Jx_size_16_color_FFFFFF_t_70

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

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

解决办法

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

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

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

watermark_type_ZmFuZ3poZW5naGVpdGk_shadow_10_text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dzanp6Y2Jx_size_16_color_FFFFFF_t_70 1

发表评论

表情:
评论列表 (有 0 条评论,665人围观)

还没有评论,来说两句吧...

相关阅读