@angular-eslint/eslint-plugin-template 19.4.1-alpha.11 → 19.4.1-alpha.13
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.
- package/dist/rules/alt-text.js +10 -8
- package/package.json +5 -5
package/dist/rules/alt-text.js
CHANGED
|
@@ -65,8 +65,9 @@ function isValidImgNode(node) {
|
|
|
65
65
|
function isValidObjectNode(node) {
|
|
66
66
|
let hasTitleAttribute = false, hasAriaLabelAttribute = false;
|
|
67
67
|
for (const attribute of node.attributes) {
|
|
68
|
-
hasTitleAttribute = attribute.name === 'title';
|
|
69
|
-
hasAriaLabelAttribute =
|
|
68
|
+
hasTitleAttribute = hasTitleAttribute || attribute.name === 'title';
|
|
69
|
+
hasAriaLabelAttribute =
|
|
70
|
+
hasAriaLabelAttribute || isAriaLabel(attribute.name);
|
|
70
71
|
}
|
|
71
72
|
// Note that we return "early" before looping through `element.inputs`.
|
|
72
73
|
// Because if the element has an attribute, then we don't need to iterate
|
|
@@ -76,8 +77,8 @@ function isValidObjectNode(node) {
|
|
|
76
77
|
}
|
|
77
78
|
let hasTitleBinding = false, hasAriaLabelBinding = false;
|
|
78
79
|
for (const input of node.inputs) {
|
|
79
|
-
hasTitleBinding = input.name === 'title';
|
|
80
|
-
hasAriaLabelBinding = isAriaLabel(input.name);
|
|
80
|
+
hasTitleBinding = hasTitleBinding || input.name === 'title';
|
|
81
|
+
hasAriaLabelBinding = hasAriaLabelBinding || isAriaLabel(input.name);
|
|
81
82
|
}
|
|
82
83
|
if (hasTitleBinding || hasAriaLabelBinding) {
|
|
83
84
|
return true;
|
|
@@ -92,8 +93,9 @@ function isValidObjectNode(node) {
|
|
|
92
93
|
function isValidAreaNode(node) {
|
|
93
94
|
let hasAltAttribute = false, hasAriaLabelAttribute = false;
|
|
94
95
|
for (const attribute of node.attributes) {
|
|
95
|
-
hasAltAttribute = isAlt(attribute.name);
|
|
96
|
-
hasAriaLabelAttribute =
|
|
96
|
+
hasAltAttribute = hasAltAttribute || isAlt(attribute.name);
|
|
97
|
+
hasAriaLabelAttribute =
|
|
98
|
+
hasAriaLabelAttribute || isAriaLabel(attribute.name);
|
|
97
99
|
}
|
|
98
100
|
// Note that we return "early" before looping through `element.inputs`.
|
|
99
101
|
// Because if the element has an attribute, then we don't need to iterate
|
|
@@ -103,8 +105,8 @@ function isValidAreaNode(node) {
|
|
|
103
105
|
}
|
|
104
106
|
let hasAltBinding = false, hasAriaLabelBinding = false;
|
|
105
107
|
for (const input of node.inputs) {
|
|
106
|
-
hasAltBinding = isAlt(input.name);
|
|
107
|
-
hasAriaLabelBinding = isAriaLabel(input.name);
|
|
108
|
+
hasAltBinding = hasAltBinding || isAlt(input.name);
|
|
109
|
+
hasAriaLabelBinding = hasAriaLabelBinding || isAriaLabel(input.name);
|
|
108
110
|
}
|
|
109
111
|
return hasAltBinding || hasAriaLabelBinding;
|
|
110
112
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular-eslint/eslint-plugin-template",
|
|
3
|
-
"version": "19.4.1-alpha.
|
|
3
|
+
"version": "19.4.1-alpha.13",
|
|
4
4
|
"description": "ESLint plugin for Angular Templates",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -20,13 +20,13 @@
|
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"aria-query": "5.3.2",
|
|
22
22
|
"axobject-query": "4.1.0",
|
|
23
|
-
"@angular-eslint/bundled-angular-compiler": "19.4.1-alpha.
|
|
24
|
-
"@angular-eslint/utils": "19.4.1-alpha.
|
|
23
|
+
"@angular-eslint/bundled-angular-compiler": "19.4.1-alpha.13",
|
|
24
|
+
"@angular-eslint/utils": "19.4.1-alpha.13"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/aria-query": "5.0.4",
|
|
28
|
-
"@angular-eslint/template-parser": "19.4.1-alpha.
|
|
29
|
-
"@angular-eslint/test-utils": "19.4.1-alpha.
|
|
28
|
+
"@angular-eslint/template-parser": "19.4.1-alpha.13",
|
|
29
|
+
"@angular-eslint/test-utils": "19.4.1-alpha.13"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
32
|
"@typescript-eslint/types": "^7.11.0 || ^8.0.0",
|