ni / javascript-styleguide

JavaScript and TypeScript Style Guide
MIT License
9 stars 9 forks source link

@angular-eslint/template/cyclomatic-complexity is too aggressive #95

Closed mollykreis closed 1 year ago

mollykreis commented 2 years ago

I've noticed in a few different changes that the @angular-eslint/template/cyclomatic-complexity rule has to be disabled in Angular templates with too many elements containing *ngIf statements.

I don't think the rule should cause errors if too many independent (i.e. not nested) elements are conditionally shown/hidden within a component.

Example component

jattasNI commented 2 years ago

We decided to turn off this rule. It triggers when you have lots of ngIf statements in a flat hierarchy, which is not something we want to discourage. @TrevorKarjanis to own turning this decision into a config change.

TrevorKarjanis commented 1 year ago

Close with #110.