Cannot disable template rules
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 35/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Ferma
- Stack tecnologico
- angular, typescript
- Ambito
- tooling
Direzione di ricerca
Inizia riproducendo la segnalazione con ng lint usando l’impostazione tsconfig.json mostrata e il commento template-cyclomatic-complexity nel componente. Traccia il modo in cui la regola dei template Angular riceve le direttive di disabilitazione e verifica il risultato previsto: tutte le diagnosi per quella regola scompaiono quando viene disabilitata.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
- Lingua principale
- TypeScript
- Stelle
- 2.5k
- Fork
- 232
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di mgechev/codelyzer
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 32/100
-
Angular 14Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 35/100
-
Support for Angular 10Forse già presa @ccarmesin l’ha presa 1842 giorni fa. Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 25/100
Tutte le issue di mgechev/codelyzer
Issue simili
-
clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster maturity:stable P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
openclaw/openclaw#200937 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
accepted bug needs-info triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
zts212653/clowder-ai#2025 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
letehaha/moneymatter#906 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
blinkospace/blinko#1287 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
Feyisara2108/stellargive#1379 ·
I maintainer di solito rispondono entro 1 giorno