[英]can someone tell me how to disable everything that's triggered by @typescript-eslint/ban-types?
这个“@typescript-eslint/ban-types”让我做噩梦。 我从事一个大型项目,它产生了无法轻易修复的大错误(数百个)。
这是我的配置但是愚蠢的 eslint 不想接受它:
//
// Typescript
"@typescript-eslint/ban-types": [
"error",
{
types: {
"{}": false,
Function: false,
},
extendDefaults: true,
},
],
查看来自 GitHub TypeScript ESLint Link的ban-types.ts
文件
将此添加到您的.eslintrc
文件以忽略默认禁止类型。
"@typescript-eslint/ban-types": ["error",
{
"types": {
"String": false,
"Boolean": false,
"Number": false,
"Symbol": false,
"{}": false,
"Object": false,
"object": false,
"Function": false,
},
"extendDefaults": true
}
]
您还可以通过执行以下操作来缩短此操作:
rules: {
"@typescript-eslint/ban-types": "off"
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.