@angular-eslint/eslint-plugin-template 18.0.2-alpha.6 → 18.0.2-alpha.8
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/configs/accessibility.json +15 -15
- package/dist/configs/all.json +33 -33
- package/dist/configs/process-inline-templates.json +7 -7
- package/dist/configs/recommended.json +7 -7
- package/dist/rules/prefer-self-closing-tags.d.ts.map +1 -1
- package/dist/rules/prefer-self-closing-tags.js +8 -5
- package/package.json +4 -4
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
2
|
+
"parser": "@angular-eslint/template-parser",
|
|
3
|
+
"plugins": ["@angular-eslint/template"],
|
|
4
|
+
"rules": {
|
|
5
|
+
"@angular-eslint/template/alt-text": "error",
|
|
6
|
+
"@angular-eslint/template/click-events-have-key-events": "error",
|
|
7
|
+
"@angular-eslint/template/elements-content": "error",
|
|
8
|
+
"@angular-eslint/template/interactive-supports-focus": "error",
|
|
9
|
+
"@angular-eslint/template/label-has-associated-control": "error",
|
|
10
|
+
"@angular-eslint/template/mouse-events-have-key-events": "error",
|
|
11
|
+
"@angular-eslint/template/no-autofocus": "error",
|
|
12
|
+
"@angular-eslint/template/no-distracting-elements": "error",
|
|
13
|
+
"@angular-eslint/template/role-has-required-aria": "error",
|
|
14
|
+
"@angular-eslint/template/table-scope": "error",
|
|
15
|
+
"@angular-eslint/template/valid-aria": "error"
|
|
16
|
+
}
|
|
17
17
|
}
|
package/dist/configs/all.json
CHANGED
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
2
|
+
"parser": "@angular-eslint/template-parser",
|
|
3
|
+
"plugins": ["@angular-eslint/template"],
|
|
4
|
+
"rules": {
|
|
5
|
+
"@angular-eslint/template/alt-text": "error",
|
|
6
|
+
"@angular-eslint/template/attributes-order": "error",
|
|
7
|
+
"@angular-eslint/template/banana-in-box": "error",
|
|
8
|
+
"@angular-eslint/template/button-has-type": "error",
|
|
9
|
+
"@angular-eslint/template/click-events-have-key-events": "error",
|
|
10
|
+
"@angular-eslint/template/conditional-complexity": "error",
|
|
11
|
+
"@angular-eslint/template/cyclomatic-complexity": "error",
|
|
12
|
+
"@angular-eslint/template/elements-content": "error",
|
|
13
|
+
"@angular-eslint/template/eqeqeq": "error",
|
|
14
|
+
"@angular-eslint/template/i18n": "error",
|
|
15
|
+
"@angular-eslint/template/interactive-supports-focus": "error",
|
|
16
|
+
"@angular-eslint/template/label-has-associated-control": "error",
|
|
17
|
+
"@angular-eslint/template/mouse-events-have-key-events": "error",
|
|
18
|
+
"@angular-eslint/template/no-any": "error",
|
|
19
|
+
"@angular-eslint/template/no-autofocus": "error",
|
|
20
|
+
"@angular-eslint/template/no-call-expression": "error",
|
|
21
|
+
"@angular-eslint/template/no-distracting-elements": "error",
|
|
22
|
+
"@angular-eslint/template/no-duplicate-attributes": "error",
|
|
23
|
+
"@angular-eslint/template/no-inline-styles": "error",
|
|
24
|
+
"@angular-eslint/template/no-interpolation-in-attributes": "error",
|
|
25
|
+
"@angular-eslint/template/no-negated-async": "error",
|
|
26
|
+
"@angular-eslint/template/no-positive-tabindex": "error",
|
|
27
|
+
"@angular-eslint/template/prefer-control-flow": "error",
|
|
28
|
+
"@angular-eslint/template/prefer-ngsrc": "error",
|
|
29
|
+
"@angular-eslint/template/prefer-self-closing-tags": "error",
|
|
30
|
+
"@angular-eslint/template/role-has-required-aria": "error",
|
|
31
|
+
"@angular-eslint/template/table-scope": "error",
|
|
32
|
+
"@angular-eslint/template/use-track-by-function": "error",
|
|
33
|
+
"@angular-eslint/template/valid-aria": "error"
|
|
34
|
+
}
|
|
35
35
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
"parser": "@typescript-eslint/parser",
|
|
3
|
+
"parserOptions": {
|
|
4
|
+
"ecmaVersion": 2020,
|
|
5
|
+
"sourceType": "module"
|
|
6
|
+
},
|
|
7
|
+
"plugins": ["@angular-eslint/template"],
|
|
8
|
+
"processor": "@angular-eslint/template/extract-inline-html"
|
|
9
9
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
"parser": "@angular-eslint/template-parser",
|
|
3
|
+
"plugins": ["@angular-eslint/template"],
|
|
4
|
+
"rules": {
|
|
5
|
+
"@angular-eslint/template/banana-in-box": "error",
|
|
6
|
+
"@angular-eslint/template/eqeqeq": "error",
|
|
7
|
+
"@angular-eslint/template/no-negated-async": "error"
|
|
8
|
+
}
|
|
9
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prefer-self-closing-tags.d.ts","sourceRoot":"","sources":["../../src/rules/prefer-self-closing-tags.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,UAAU,0BAA0B,CAAC;AAClD,eAAO,MAAM,SAAS,6BAA6B,CAAC;;AAEpD,
|
|
1
|
+
{"version":3,"file":"prefer-self-closing-tags.d.ts","sourceRoot":"","sources":["../../src/rules/prefer-self-closing-tags.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,UAAU,0BAA0B,CAAC;AAClD,eAAO,MAAM,SAAS,6BAA6B,CAAC;;AAEpD,wBAkIG"}
|
|
@@ -70,17 +70,20 @@ exports.default = (0, create_eslint_rule_1.createESLintRule)({
|
|
|
70
70
|
const { sourceSpan } = node;
|
|
71
71
|
const ngContentCloseTag = '</ng-content>';
|
|
72
72
|
if (sourceSpan.toString().includes(ngContentCloseTag)) {
|
|
73
|
-
|
|
74
|
-
const content = sourceSpan
|
|
73
|
+
const whiteSpaceContent = sourceSpan
|
|
75
74
|
.toString()
|
|
76
75
|
.match(/>(\s*)</m)
|
|
77
|
-
?.at(1)
|
|
76
|
+
?.at(1);
|
|
77
|
+
const hasContent = typeof whiteSpaceContent === 'undefined';
|
|
78
|
+
if (hasContent) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
78
81
|
const openingTagLastChar =
|
|
79
82
|
// This is more than the minimum length of a ng-content element
|
|
80
83
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
81
84
|
sourceSpan
|
|
82
85
|
.toString()
|
|
83
|
-
.at(-2 - ngContentCloseTag.length -
|
|
86
|
+
.at(-2 - ngContentCloseTag.length - whiteSpaceContent.length);
|
|
84
87
|
const closingTagPrefix = getClosingTagPrefix(openingTagLastChar);
|
|
85
88
|
context.report({
|
|
86
89
|
// content nodes don't have information about startSourceSpan and endSourceSpan,
|
|
@@ -99,7 +102,7 @@ exports.default = (0, create_eslint_rule_1.createESLintRule)({
|
|
|
99
102
|
fix: (fixer) => fixer.replaceTextRange([
|
|
100
103
|
sourceSpan.end.offset -
|
|
101
104
|
ngContentCloseTag.length -
|
|
102
|
-
|
|
105
|
+
whiteSpaceContent.length -
|
|
103
106
|
1,
|
|
104
107
|
sourceSpan.end.offset,
|
|
105
108
|
], closingTagPrefix + '/>'),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular-eslint/eslint-plugin-template",
|
|
3
|
-
"version": "18.0.2-alpha.
|
|
3
|
+
"version": "18.0.2-alpha.8",
|
|
4
4
|
"description": "ESLint plugin for Angular Templates",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -18,13 +18,13 @@
|
|
|
18
18
|
"LICENSE"
|
|
19
19
|
],
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@angular-eslint/bundled-angular-compiler": "18.0.2-alpha.
|
|
22
|
-
"@angular-eslint/utils": "18.0.2-alpha.
|
|
21
|
+
"@angular-eslint/bundled-angular-compiler": "18.0.2-alpha.8",
|
|
22
|
+
"@angular-eslint/utils": "18.0.2-alpha.8",
|
|
23
23
|
"aria-query": "5.3.0",
|
|
24
24
|
"axobject-query": "4.0.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@angular-eslint/test-utils": "18.0.2-alpha.
|
|
27
|
+
"@angular-eslint/test-utils": "18.0.2-alpha.8",
|
|
28
28
|
"@types/aria-query": "5.0.4"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|