[英]Cannot disable tslint rule via Codelyzer on Angular Template
I have an Angular template that needs to call function by passing an index.我有一个 Angular 模板,需要通过传递索引来调用函数。 There is a Codelyzer rule "template-no-call-expression" that complains when I do this.
当我这样做时,有一个 Codelyzer 规则“模板无调用表达式”会抱怨。
I have attempted to disable the rule in the typescript file, but it continues to fail the lint check.我试图禁用打字稿文件中的规则,但它仍然无法通过 lint 检查。 Is this a bug, or am I not doing it correctly?
这是一个错误,还是我做得不正确?
/* tslint:disable: template-no-call-expression */
@Component({
...
Make sure the tslint-disabling is the FIRST line in your component.ts (so that means: above the imports)!确保 tslint-disabling 是你的 component.ts 中的第一行(所以这意味着:在导入之上)! I had the same problem and after reading the comment on the pull request below, I realized that if you put the disabling on line 17 of your TS, it will disable the check for all lines 17+ in your HTML file, but NOT for line 1 - 16 :\\
我遇到了同样的问题,在阅读下面对拉取请求的评论后,我意识到如果您将禁用放在 TS 的第 17 行,它将禁用对 HTML 文件中所有 17+ 行的检查,但不会禁用对行的检查1 - 16 :\\
See comment on https://github.com/mgechev/codelyzer/pull/492请参阅https://github.com/mgechev/codelyzer/pull/492 上的评论
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.