Cannot disable template rules
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- angular, typescript
- 領域
- tooling
調査の方向性
まず、示されている tsconfig.json の設定と、コンポーネント内の template-cyclomatic-complexity コメントを使って、ng lint で報告を再現します。Angular テンプレートルールが無効化ディレクティブをどのように受け取るかを追跡し、期待される結果を確認します。そのルールを無効にすると、そのルールのすべての診断が消えることを確認してください。
索引モデルが issue の本文から書いたものです。
説明
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
- 主要言語
- TypeScript
- スター
- 2.5k
- フォーク
- 232
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
mgechev/codelyzer のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 32/100
-
Angular 14オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
-
Support for Angular 10対応中かも @ccarmesin が 1842 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
mgechev/codelyzer の issue をすべて見る
似ている issue
-
clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster maturity:stable P3
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
openclaw/openclaw#200937 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
accepted bug needs-info triaged
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
zts212653/clowder-ai#2025 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
letehaha/moneymatter#906 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
blinkospace/blinko#1287 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
Feyisara2108/stellargive#1379 ·
メンテナーはふだん 1 日以内に返信