> 文章列表 > 若依项目前端在启动阶段报错的处理方式

若依项目前端在启动阶段报错的处理方式

若依项目前端在启动阶段报错的处理方式

vue3.0 如何取消eslint 的代码格式校验

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.
ERROR in [eslint]
C:\\Users\\xuhuichen\\Desktop\\gpyh-wechat-h5\\src\\components\\a1.vue1:1  error  Component name "a1" should always be multi-word  vue/multi-word-component-names

解决方法:

  1. 打开vue.config.js 文件

  2. 重启后, eslint就关闭了

  3.   module.exports = {lintOnSave: false //如果为false,就是取消eslint规则的检查}
    

如果电脑node环境版本高于15,项目无法启动,在package.json文件里作如下修改

  "scripts": {"serve": "set NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve","build": "vue-cli-service build","report": "vue-cli-service build --report","build:preview": "vue-cli-service build --mode preview","lint": "vue-cli-service lint","lint:nofix": "vue-cli-service lint --no-fix"},