Description
Description and reproduction of the issue
The self-closing tag rule considers an element with a comment as an empty tag.
But this causes code and information loss, we need comments as a team in our development process.
The autofix removes the comment, example is below.
{
"rules": {
"@angular-eslint/template/prefer-self-closing-tags": ["error"]
}
}
<!-- input -->
<ngx-datatable
#table
[rows]="rows"
[columns]="columns">
<!-- <commented-out-element
[someAttribute]="string"
></commented-out-element> -->
<!-- SOME OTHER COMMENTS -->
</ngx-datatable>
<!-- auto fixed output -->
<ngx-datatable
#table
[rows]="rows"
[columns]="columns" />
Versions
package | version |
---|---|
@angular-eslint/eslint-plugin-template |
16.3.1 |
@angular-eslint/template-parser |
16.3.1 |
@typescript-eslint/parser |
6.19.1 |
ESLint |
8.56.0 |
node |
18.17.0 |
# Please run `npx ng version` in your project and paste the full output here:
Angular CLI: 16.2.12
Node: 18.17.0
Package Manager: npm 9.6.7
OS: win32 x64
Angular: 16.2.12
... animations, cli, common, compiler, compiler-cli, core, forms
... language-service, localize, platform-browser
... platform-browser-dynamic, router
Package Version
---------------------------------------------------------
@angular-devkit/architect 0.1602.12
@angular-devkit/build-angular 16.2.12
@angular-devkit/core 16.0.6
@angular-devkit/schematics 16.0.6
@angular/cdk 16.2.13
@schematics/angular 16.2.12
ng-packagr 16.2.3
rxjs 7.8.1
typescript 5.0.4
zone.js 0.13.3
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest supported version of the packages and checked my
ng version
output per the instructions given here.