@angular-eslint/eslint-plugin-template 17.1.2-alpha.6 → 17.1.2-alpha.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/rules/i18n.js +11 -2
  2. package/package.json +3 -3
@@ -145,9 +145,17 @@ exports.default = (0, create_eslint_rule_1.createESLintRule)({
145
145
  ]);
146
146
  const allowedTags = new Set(ignoreTags);
147
147
  const collectedCustomIds = new Map();
148
+ function getNextElementOrTemplateParent(node) {
149
+ const parent = node.parent;
150
+ if (parent && !isElement(parent) && !isTemplate(parent)) {
151
+ return getNextElementOrTemplateParent(parent);
152
+ }
153
+ return parent;
154
+ }
148
155
  function handleElementOrTemplate(node) {
149
156
  var _a;
150
- const { i18n, parent, sourceSpan } = node;
157
+ const { i18n, sourceSpan } = node;
158
+ const parent = getNextElementOrTemplateParent(node);
151
159
  if (isTagAllowed(allowedTags, node) ||
152
160
  isElementWithI18n(parent) ||
153
161
  isTemplateWithI18n(parent)) {
@@ -227,7 +235,8 @@ exports.default = (0, create_eslint_rule_1.createESLintRule)({
227
235
  }
228
236
  function handleBoundTextOrIcuOrText(node) {
229
237
  var _a;
230
- const { parent, sourceSpan } = node;
238
+ const { sourceSpan } = node;
239
+ const parent = getNextElementOrTemplateParent(node);
231
240
  if ((isBoundText(node) &&
232
241
  isBoundTextAllowed(allowedBoundTextPattern, node)) ||
233
242
  ((isElement(parent) || isTemplate(parent)) &&
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular-eslint/eslint-plugin-template",
3
- "version": "17.1.2-alpha.6",
3
+ "version": "17.1.2-alpha.7",
4
4
  "description": "ESLint plugin for Angular Templates",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -17,8 +17,8 @@
17
17
  "LICENSE"
18
18
  ],
19
19
  "dependencies": {
20
- "@angular-eslint/bundled-angular-compiler": "17.1.2-alpha.6",
21
- "@angular-eslint/utils": "17.1.2-alpha.6",
20
+ "@angular-eslint/bundled-angular-compiler": "17.1.2-alpha.7",
21
+ "@angular-eslint/utils": "17.1.2-alpha.7",
22
22
  "@typescript-eslint/type-utils": "6.18.0",
23
23
  "@typescript-eslint/utils": "6.18.0",
24
24
  "aria-query": "5.3.0",