@angular-eslint/eslint-plugin-template 16.1.3-alpha.0 → 16.1.3-alpha.10

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.
@@ -188,7 +188,7 @@ function postprocessComponentFile(multiDimensionalMessages, filename) {
188
188
  message.endLine =
189
189
  message.endLine + rangeData.lineAndCharacter.start.line;
190
190
  if (message.fix) {
191
- const startOffset = rangeData.range[0];
191
+ const startOffset = rangeData.range[0] + 1;
192
192
  message.fix.range = [
193
193
  startOffset + message.fix.range[0],
194
194
  startOffset + message.fix.range[1],
@@ -42,10 +42,15 @@ exports.default = (0, create_eslint_rule_1.createESLintRule)({
42
42
  if (!noContent || noCloseTag) {
43
43
  return;
44
44
  }
45
+ // HTML tags always have more than two characters
46
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
47
+ const openingTagLastChar = startSourceSpan.toString().at(-2);
48
+ const hasOwnWhitespace = openingTagLastChar.trim() === '';
49
+ const closingTagPrefix = hasOwnWhitespace ? '' : ' ';
45
50
  context.report({
46
51
  loc: parserServices.convertNodeSourceSpanToLoc(endSourceSpan),
47
52
  messageId: exports.MESSAGE_ID,
48
- fix: (fixer) => fixer.replaceTextRange([startSourceSpan.end.offset - 1, endSourceSpan.end.offset], ' />'),
53
+ fix: (fixer) => fixer.replaceTextRange([startSourceSpan.end.offset - 1, endSourceSpan.end.offset], closingTagPrefix + '/>'),
49
54
  });
50
55
  },
51
56
  };
@@ -18,7 +18,9 @@ function getInteractiveElementAXObjectSchemas() {
18
18
  // listed in the above set `interactiveAXObjects`.
19
19
  interactiveElementAXObjectSchemas = [...elementAXObjects.entries()].reduce((accumulator, [elementSchema, AXObjectSet]) => {
20
20
  return accumulator.concat([...AXObjectSet].every((role) => interactiveAXObjects.has(role))
21
- ? elementSchema
21
+ ? // summary element should not have required attributes
22
+ elementSchema.name === 'summary'
23
+ ? Object.assign(Object.assign({}, elementSchema), { attributes: [] }) : elementSchema
22
24
  : []);
23
25
  }, []);
24
26
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular-eslint/eslint-plugin-template",
3
- "version": "16.1.3-alpha.0+2e4af4d",
3
+ "version": "16.1.3-alpha.10+b1d07bc",
4
4
  "description": "ESLint plugin for Angular Templates",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -17,12 +17,12 @@
17
17
  "LICENSE"
18
18
  ],
19
19
  "dependencies": {
20
- "@angular-eslint/bundled-angular-compiler": "16.1.3-alpha.0+2e4af4d",
21
- "@angular-eslint/utils": "16.1.3-alpha.0+2e4af4d",
20
+ "@angular-eslint/bundled-angular-compiler": "16.1.3-alpha.10+b1d07bc",
21
+ "@angular-eslint/utils": "16.1.3-alpha.10+b1d07bc",
22
22
  "@typescript-eslint/type-utils": "5.62.0",
23
23
  "@typescript-eslint/utils": "5.62.0",
24
24
  "aria-query": "5.3.0",
25
- "axobject-query": "3.1.1"
25
+ "axobject-query": "3.2.1"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@types/aria-query": "5.0.1"
@@ -31,5 +31,5 @@
31
31
  "eslint": "^7.20.0 || ^8.0.0",
32
32
  "typescript": "*"
33
33
  },
34
- "gitHead": "2e4af4d7e60c4ceb7a65a5fa5ed8fde102291c01"
34
+ "gitHead": "b1d07bce8bd977650f62ad260a2a105ee4702375"
35
35
  }