@angular-eslint/eslint-plugin-template 19.8.1-alpha.0 → 19.8.1

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.
@@ -1 +1 @@
1
- {"version":3,"file":"no-interpolation-in-attributes.d.ts","sourceRoot":"","sources":["../../src/rules/no-interpolation-in-attributes.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,OAAO,GAAG,CAAC;IAAE,2BAA2B,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC;AACjE,MAAM,MAAM,UAAU,GAAG,6BAA6B,CAAC;AACvD,eAAO,MAAM,SAAS,mCAAmC,CAAC;;AAY1D,wBA+EG"}
1
+ {"version":3,"file":"no-interpolation-in-attributes.d.ts","sourceRoot":"","sources":["../../src/rules/no-interpolation-in-attributes.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,OAAO,GAAG,CAAC;IAAE,2BAA2B,EAAE,OAAO,CAAA;CAAE,CAAC,CAAC;AACjE,MAAM,MAAM,UAAU,GAAG,6BAA6B,CAAC;AACvD,eAAO,MAAM,SAAS,mCAAmC,CAAC;;AAY1D,wBAmFG"}
@@ -59,16 +59,20 @@ exports.default = (0, create_eslint_rule_1.createESLintRule)({
59
59
  messageId: 'noInterpolationInAttributes',
60
60
  fix: isFullInterpolation
61
61
  ? (fixer) => {
62
- const attributeName = boundAttribute.name.trim();
62
+ const attrStart = boundAttribute.keySpan.start.offset;
63
+ const attrEnd = boundAttribute.keySpan.end.offset;
64
+ const attributeName = sourceCode.text
65
+ .slice(attrStart, attrEnd)
66
+ .trim();
63
67
  const exprStart = boundAttribute.valueSpan.start.offset + 2; // +2 to remove '{{'
64
68
  const exprEnd = boundAttribute.valueSpan.end.offset - 2; // -2 to remove '}}'
65
69
  const expression = sourceCode.text
66
70
  .slice(exprStart, exprEnd)
67
71
  .trim();
68
- return fixer.replaceTextRange([
69
- boundAttribute.keySpan.start.offset,
70
- boundAttribute.valueSpan.end.offset,
71
- ], `[${attributeName}]="${expression}`);
72
+ const rangeStart = boundAttribute.sourceSpan.start.offset;
73
+ const rangeEnd = boundAttribute.sourceSpan.end.offset;
74
+ const replacement = `[${attributeName}]="${expression}"`;
75
+ return fixer.replaceTextRange([rangeStart, rangeEnd], replacement);
72
76
  }
73
77
  : null,
74
78
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular-eslint/eslint-plugin-template",
3
- "version": "19.8.1-alpha.0",
3
+ "version": "19.8.1",
4
4
  "description": "ESLint plugin for Angular Templates",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -20,19 +20,19 @@
20
20
  "dependencies": {
21
21
  "aria-query": "5.3.2",
22
22
  "axobject-query": "4.1.0",
23
- "@angular-eslint/bundled-angular-compiler": "19.8.1-alpha.0",
24
- "@angular-eslint/utils": "19.8.1-alpha.0"
23
+ "@angular-eslint/bundled-angular-compiler": "19.8.1",
24
+ "@angular-eslint/utils": "19.8.1"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@types/aria-query": "5.0.4",
28
- "@angular-eslint/test-utils": "19.8.1-alpha.0"
28
+ "@angular-eslint/test-utils": "19.8.1"
29
29
  },
30
30
  "peerDependencies": {
31
31
  "@typescript-eslint/types": "^7.11.0 || ^8.0.0",
32
32
  "@typescript-eslint/utils": "^7.11.0 || ^8.0.0",
33
33
  "eslint": "^8.57.0 || ^9.0.0",
34
34
  "typescript": "*",
35
- "@angular-eslint/template-parser": "19.8.1-alpha.0"
35
+ "@angular-eslint/template-parser": "19.8.1"
36
36
  },
37
37
  "gitHead": "e2006e5e9c99e5a943d1a999e0efa5247d29ec24"
38
38
  }