问题
初始化的 vant 项目中 ts 想用 any,eslint 插什么手不让用 (no-explicit-any)?
解决问题
解法方法很简单,添加下面规则
rules: {
"@typescript-eslint/no-explicit-any": "off"
}, 在使用 TypeScript 的 Vant 项目中,ESLint 插件 `@typescript-eslint/no-explicit-any` 默认禁止使用 `any` 类型。本文介绍如何通过在 ESLint 配置中添加规则 `\"@typescript-eslint/no-explicit-any\": \"off\"` 来解决这个问题,从而允许使用 `any` 类型。
初始化的 vant 项目中 ts 想用 any,eslint 插什么手不让用 (no-explicit-any)?
解法方法很简单,添加下面规则
rules: {
"@typescript-eslint/no-explicit-any": "off"
},