Cannot disable template rules
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- angular, typescript
- Lĩnh vực
- tooling
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện báo cáo với ng lint, sử dụng thiết lập tsconfig.json được示示 và chú thích template-cyclomatic-complexity trong component. Theo dõi cách quy tắc template của Angular nhận các chỉ thị vô hiệu hóa và xác minh kết quả mong đợi: tất cả chẩn đoán của quy tắc đó biến mất khi quy tắc bị vô hiệu hóa.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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 the ts file that references the template.
When I execute the ng lint command without the tslint:disable:rule comment, I can see this output:
ERROR: /project/src/app/module/components/temp/temp.component.html:7:2 - The cyclomatic complexity exceeded the defined limit (cost '10'). Your template should be refactored.
ERROR: /project/src/app/module/components/temp/temp.component.html:48:6 - The cyclomatic complexity exceeded the defined limit (cost '10'). Your template should be refactored.
ERROR: /project/src/app/module/components/temp/temp.component.html:59:16 - The cyclomatic complexity exceeded the defined limit (cost '10'). Your template should be refactored.
If I add the tslint:disable:rule comment, this is the output:
ERROR: /project/src/app/module/components/temp/temp.component.html:7:2 - The cyclomatic complexity exceeded the defined limit (cost '10'). Your template should be refactored.
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
/* tslint:disable:template-cyclomatic-complexity */
@Component({
selector: 'temp',
templateUrl: './temp.component.html',
styleUrls: ['./temp.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
})
Environment
- OS: MacOS
- Node.js version: 8.11.3
- npm version: 6.9.0
- Angular version:
"@angular/core": "^7.2.0" - tslint version:
"tslint": "^5.15.0""tslint-angular": "^1.1.2"
Additional context
N/A
- Ngôn ngữ chính
- TypeScript
- Star
- 2.5k
- Fork
- 232
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của mgechev/codelyzer
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 32/100
-
Angular 14Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
-
Support for Angular 10Có thể đã có người làm @ccarmesin đã nhận 1842 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 25/100
Tất cả issue của mgechev/codelyzer
Issue tương tự
-
clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster maturity:stable P3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
openclaw/openclaw#200937 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
accepted bug needs-info triaged
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
zts212653/clowder-ai#2025 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
letehaha/moneymatter#906 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
blinkospace/blinko#1287 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Feyisara2108/stellargive#1379 ·
Maintainer thường phản hồi trong vòng 1 ngày