是否有禁止使用函数的 type Color = 'red' | 'blue' | 'green'
class Shape {
constructor(public color: Color) {}
}
console.log(new Shape('red')) // Will be validated at compile time
属性的 eslint 规则?
当您缩小代码时,它通常会破坏函数的名称。因此,在开发中,name
将是 myFunc.name
,但在生产中它将类似于 'myFunc'
。这是一个开发用枪,我想防止这种情况发生。
eslint-plugin-ban 仅适用于调用表达式,但我想要一些适用于访问属性 (MemberExpression) 的内容。