VUE3&TS: Vue3+TS编码上的配置报错处理
阿里云国内75折 回扣 微信号:monov8 |
阿里云国际,腾讯云国际,低至75折。AWS 93折 免费开户实名账号 代冲值 优惠多多 微信号:monov8 飞机:@monov6 |
简介
记录自己在学习、开发 Vue3&TS 过程中所遇到的配置报错、警告的解决方式。
记录
1. Type string trivially inferred from a string literal, remove type annotation.
从一个字符串字面推断出的类型字符串删除类型注释。
解决方法在 .eslintrc.js 中添加 rules 项
'@typescript-eslint/no-inferrable-types': 'off'
2. File ‘…xxx.vue’ is not a module
报错某vue文件不是一个模块。
解决方法格式化并保存一次 .eslintrc.js 文件
3. Unexpected any. Specify a different type.
意外的any。指定一个不同的类型。
解决方法在 .eslintrc.js 中添加 rules 项【如果页面上还是有警告显示重新允许项目即可】
'@typescript-eslint/no-explicit-any': ['off']