我需要一个允许我禁止使用表单验证器的规则

I need a rule that allows me to ban the usages of a form-validator

我们制作了我们自己的 Validators.required 表单验证器版本,它包含在基础 Angular 7 中。我们必须使用新的 CustomValidators.required 来代替。我们正在考虑通过将旧版本包含在我们现有的 TSlint 配置中来禁止使用旧版本。我们研究了禁令规则 https://palantir.github.io/tslint/rules/ban/ 但这似乎不起作用,我们配置如下:

"ban": [
      true,
      "eval",
      {"name": ["Validators", "required"], "message": "Don't use the Validators.required use the CustomValidators.required instead!"}
    ]

我们目前不知所措,感谢您的帮助:)

我创建了一个自定义规则来完全按照我的意愿进行操作,这比我想象的要容易。 我使用了这个视频:https://www.youtube.com/watch?v=jBPhmzH0x64