Questions tagged [codelyzer]
17 questions
14
votes
0 answers
Angular13 codelyzer and @angular/core dependency not solving
I used Angular 13.
"@angular/core": "~13.3.11"
"codelyzer": "^6.0.2".
When i used npm install it install all dependencies with below warnings. I try npm audit --force so it converts codelyzer version to 0.0.28 and now npm install throw errors that…

Anant Doshi
- 177
- 1
- 11
7
votes
0 answers
Is there a way to lint an Angular 4+ template to ensure all ng-template ids are unique?
Angular 4+ provides a way to perform if/else logic in the template file, e.g.
Save succeeded.
Save failed.
This, however, requires that…

Ted Weatherly
- 71
- 4
5
votes
1 answer
Having Angular Migrate TSLint to ESLint Banana-In-Box Error
I'm running into significant issues with my migration from TSLint to ESLint for my Angular project. The way I'm working is I'm creating a brand new project (currently in Angular 9), and then I upgrade to Angular 10.2. I have followed the…

user1100412
- 699
- 1
- 10
- 22
5
votes
3 answers
How to disable tslint rule for Angular style guide: "The selector should be prefixed by "?
I have an Angular test for some component which uses the directive ngb-pagination from ng-bootstrap.
Now, in my test I mock this component as follow:
// on next line I get: The selector should be prefixed by ""…

lealceldeiro
- 14,342
- 6
- 49
- 80
5
votes
2 answers
`Tslint --fix` does not autofix but instead generates lint problems as console errors
I'm using the Angular starter kit
and I'm trying to get tslint to autofix all my lint problems with the --fix flag.
I'm running the script:
npm run tslint --fix src/**/*.ts
It just generates the same error that I'm already being told about in tslint…

Jonathan002
- 9,639
- 8
- 37
- 58
4
votes
2 answers
Codelyzer requires Angular 9 instead of Angular 10
When I am running the command npm ls -json in my node js project I get the following error:
npm ERR! missing: @angular/core@9.0.0, required by codelyzer@6.0.2
npm ERR! missing: @angular/compiler@9.0.0, required by codelyzer@6.0.2
@angular/core and…

Camillo
- 153
- 1
- 9
4
votes
0 answers
Codelyzer doesn't report errors in HTML/CSS files
I just created a fresh project using @angular/cli (latest version - 1.1.3) and I'm facing some issues with codelyzer.
Let's see the code what I have right now:
app.component.ts
import { Component } from '@angular/core';
@Component({
selector:…

dev_054
- 3,448
- 8
- 29
- 56
3
votes
0 answers
TSLINT with Angular CLI can you get it to fail a build
I am using tslint/codelyzer with Angular 5 and Visual studio code.
Basically I want to configure things so when I do ng build OR ng serve there will be compile time errors if any tslint rules are broken. Is this possible?

AJM
- 32,054
- 48
- 155
- 243
2
votes
2 answers
Async pipes should not be negated
I migrated from TSLint to ESLint following the guide. Now, I get this error message :
Async pipes should not be negated. Use (observable | async) === (false | null | undefined) to check its value instead
And here is the given explanation…

Arnaud Denoyelle
- 29,980
- 16
- 92
- 148
2
votes
1 answer
Spec files are being linted after I included exclude in angular-cli.json
I have an angular 4 app and manually created 2 .spec files for a class. When I run nglint, it will lint the 2 spec files. The spec files that were included when I generated a component with the angular-cli are not being linted however (which is what…

Kim Merino
- 286
- 1
- 4
- 16
1
vote
1 answer
Show codelyzer errors in WebStorm
In my Angular 9 app, I've set up some codelyzer rules in order to benefit of accessibility checks such as template-accessibility-label-for, by adding them to my tslint.json file.
The rules correctly work when using ng lint, which will correctly…

Francesco Borzi
- 56,083
- 47
- 179
- 252
1
vote
1 answer
Cannot disable tslint rule via Codelyzer on Angular Template
I have an Angular template that needs to call function by passing an index. There is a Codelyzer rule "template-no-call-expression" that complains when I do this.
I have attempted to disable the rule in the typescript file, but it continues to fail…

theMayer
- 15,456
- 7
- 58
- 90
1
vote
0 answers
Can we use 'tslint --fix' command for codelyzer rules?
Im running this tslint commands:
"scripts": {
"tslint": "tslint -p tsconfig.json",
"tslint-fix": "tslint --fix -p tsconfig.json"
}
My 'tslint' command is detecting all the rules,it's working fine. But my 'tslint-fix' command only fix…

Daniel Delgado
- 4,813
- 5
- 40
- 48
1
vote
2 answers
why does codelyzer 4 remove templates-use-public?
Codelyzer 4 has removed templates-use-public. "ng lint" will not report error when accessing a private member in html template. Does any alternative rule exist?

Yong
- 1,107
- 1
- 12
- 21
1
vote
0 answers
Exclude one .html file from codelyzer linting
While working on ngx-bootstrap, I have extracted part of datepicker logic
to separate class, and not codelyzer shows a lot of issues like:
The property "viewMode" that you're trying to access does not exist in the class declaration.
Such exclude…

valorkin
- 1,329
- 9
- 20