在项目中遇到警告:warning Unexpected any. Specify a different type @typescript-eslint/no-explicit-any
只需要在“package.json”文件中找到“eslintConfig”配置项的“rules”,添加上 “@typescript-eslint/no-explicit-any”: [“off”]然后重启项目就行了。
"eslintConfig": {
"root": true,
"env": {
"node": true
},
"extends": [
"plugin:vue/vue3-essential",
"eslint:recommended",
"@vue/typescript/recommended"
],
"parserOptions": {
"ecmaVersion": 2020
},
"rules": { // 就这
"@typescript-eslint/no-explicit-any": ["off"] // 把他加上重启项目就行了
}
},