-
Notifications
You must be signed in to change notification settings - Fork 235
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot disable template rules #821
Comments
Additional fact: the I took a quick look and could not find where this error might be (btw, we have no test for this). Any thoughts, @mgechev? |
I will take a look at this right after I/O. |
Any update on this? |
The following workaround would work (I know it's not ideal): /* tslint:disable:template-cyclomatic-complexity */
@Component({
selector: 'temp',
templateUrl: './temp.component.html',
styleUrls: ['./temp.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
})
export class Foo {} And in your template: <!-- tslint:disable:template-cyclomatic-complexity -->
<div>
...
</div> |
@mgechev The rule I'm using is I cannot test the rule (I have also updated codelyzer to |
Any update on this? I am facing the same problem for |
The suggested workaround does not work for me as well. It gets rid of 90% of rule violation, but not all. |
Describe the bug
Can't disable the
template-cyclomatic-complexity
rule.Context and configuration
I'm using tslint in an Angular project.
tsconfig.json
setting:"template-cyclomatic-complexity": [true, 10],
Following this readme (https://github.com/mgechev/codelyzer/blob/master/README.md#disable-a-rule-that-validates-template-or-styles) in order to disable a rule, I have to write the
tslint:disable:rule
in thets
file that references the template.When I execute the
ng lint
command without thetslint:disable:rule
comment, I can see this output:If I add the
tslint:disable:rule
comment, this is the output:Seems that the rule is not entirely disabled.
To Reproduce
ng lint
on the root of the project.Expected behavior
The rule should be disabled entirely.
Code
Environment
"@angular/core": "^7.2.0"
"tslint": "^5.15.0"
"tslint-angular": "^1.1.2"
Additional context
N/A
The text was updated successfully, but these errors were encountered: