Angular eslint template rules don't apply to inline templates inside blocks #1825
Closed
1 task done
Labels
package: template-parser
ESLint custom parser which enables linting Angular Templates
triage
This issue needs to be looked at and categorized by a maintainer
Description and reproduction of the issue
The angular-eslint/template rules seem to only detect inline components created at the top-level of a file. For example, if the following component is created with the recommended template rule set in the top of a spec file:
You get the expected lint error:
However if the Component is created inside a block level element such as a describe block:
Then you do not get any eslint template errors.
Attached is a reproduction of the issue. See
src\app\template-issue\template-issue.component.spec.ts
template-issue.zip
Additional Context: We would like to be able to enable the i18n attributes rule (
@angular-eslint/template/i18n
) for our test code. We have a component library with exhaustive attribute test coverage and would like to enable the i18n attributes rule in our test templates to make sure i18n attribute exceptions are well captured and categorized. All our inline test templates are inside describe blocks and do not seem to be detected by the angular eslint template parsing.Versions
@angular-eslint/template-parser
16.3.1
ESLint
8.57.0
node
20.10.0
ng version
output per the instructions given here.The text was updated successfully, but these errors were encountered: