Skip to content

Commit f07636e

Browse files
authored
[ACS-8956] Introduce new ESLint rule for self-closing tags (#10354)
1 parent 3f1b88a commit f07636e

File tree

247 files changed

+710
-1359
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

247 files changed

+710
-1359
lines changed

.eslintrc.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,10 @@ module.exports = {
185185
{
186186
files: ['*.html'],
187187
extends: ['plugin:@angular-eslint/template/recommended', 'plugin:@angular-eslint/template/accessibility'],
188-
rules: {}
188+
parser: '@angular-eslint/template-parser',
189+
rules: {
190+
'@angular-eslint/template/prefer-self-closing-tags': 'error'
191+
}
189192
},
190193
{
191194
files: ['*.spec.ts'],

lib/cli/.eslintrc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"prefer-arrow/prefer-arrow-functions": "off",
1414
"@typescript-eslint/no-var-requires": "off",
1515
"@typescript-eslint/naming-convention": "warn",
16-
"quote-props": "warn",
16+
"quote-props": "off",
1717
"no-shadow": "warn",
1818
"no-restricted-syntax": "off",
1919
"no-underscore-dangle": "off",

lib/content-services/.eslintrc.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@
2222
}
2323
],
2424
"no-shadow": "warn",
25-
"quote-props": "warn",
25+
"quote-props": "off",
2626
"object-shorthand": "warn",
2727
"prefer-const": "warn",
2828
"arrow-body-style": "warn",
2929
"@angular-eslint/no-output-native": "off",
30-
"space-before-function-paren": "warn",
30+
"space-before-function-paren": "off",
3131
"@angular-eslint/component-selector": [
3232
"error",
3333
{

lib/content-services/src/lib/aspect-list/aspect-list-dialog.component.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ <h1 class="adf-aspect-list-dialog-title">{{title | translate}}</h1>
99
{{'ADF-ASPECT-LIST.DIALOG.SELECTED' | translate}}</p>
1010
</div>
1111
<mat-dialog-content class="adf-aspect-dialog-content">
12-
<adf-aspect-list #aspectList (valueChanged)="onValueChanged($event)" (updateCounter)="onUpdateCounter($event)" [nodeId]="currentNodeId" [excludedAspects]="data.excludedAspects">
13-
</adf-aspect-list>
12+
<adf-aspect-list #aspectList (valueChanged)="onValueChanged($event)" (updateCounter)="onUpdateCounter($event)" [nodeId]="currentNodeId" [excludedAspects]="data.excludedAspects" />
1413
</mat-dialog-content>
1514

1615
<mat-dialog-actions class="adf-aspect-list-dialog">

lib/content-services/src/lib/aspect-list/aspect-list.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,6 @@
4444

4545
<ng-template #loading>
4646
<div class="adf-aspect-list-spinner">
47-
<mat-progress-spinner mode="indeterminate" id="adf-aspect-spinner"></mat-progress-spinner>
47+
<mat-progress-spinner mode="indeterminate" id="adf-aspect-spinner" />
4848
</div>
4949
</ng-template>

lib/content-services/src/lib/category/categories-management/categories-management.component.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@
6363
*ngIf="existingCategoriesLoading"
6464
[diameter]="50"
6565
class="adf-categories-management-spinner"
66-
[attr.aria-label]="'CATEGORIES_MANAGEMENT.LOADING' | translate">
67-
</mat-spinner>
66+
[attr.aria-label]="'CATEGORIES_MANAGEMENT.LOADING' | translate" />
6867
</div>
6968
</div>

lib/content-services/src/lib/common/services/saved-searches.service.ts

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,8 @@ export class SavedSearchesService {
5858
*/
5959
getSavedSearches(): Observable<SavedSearch[]> {
6060
return this.getSavedSearchesNodeId().pipe(
61-
concatMap(() => {
62-
return from(
63-
this.nodesApi.getNodeContent(this.savedSearchFileNodeId).then((content) => this.mapFileContentToSavedSearches(content))
64-
).pipe(
61+
concatMap(() =>
62+
from(this.nodesApi.getNodeContent(this.savedSearchFileNodeId).then((content) => this.mapFileContentToSavedSearches(content))).pipe(
6563
catchError((error) => {
6664
if (!this.createFileAttempt) {
6765
this.createFileAttempt = true;
@@ -70,8 +68,8 @@ export class SavedSearchesService {
7068
}
7169
return throwError(() => error);
7270
})
73-
);
74-
})
71+
)
72+
)
7573
);
7674
}
7775

@@ -130,9 +128,9 @@ export class SavedSearchesService {
130128
tap((updatedSearches: SavedSearch[]) => {
131129
this.savedSearches$.next(updatedSearches);
132130
}),
133-
switchMap((updatedSearches: SavedSearch[]) => {
134-
return from(this.nodesApi.updateNodeContent(this.savedSearchFileNodeId, JSON.stringify(updatedSearches)));
135-
}),
131+
switchMap((updatedSearches: SavedSearch[]) =>
132+
from(this.nodesApi.updateNodeContent(this.savedSearchFileNodeId, JSON.stringify(updatedSearches)))
133+
),
136134
catchError((error) => {
137135
this.savedSearches$.next(previousSavedSearches);
138136
return throwError(() => error);
@@ -161,9 +159,9 @@ export class SavedSearchesService {
161159
tap((updatedSearches: SavedSearch[]) => {
162160
this.savedSearches$.next(updatedSearches);
163161
}),
164-
switchMap((updatedSearches: SavedSearch[]) => {
165-
return from(this.nodesApi.updateNodeContent(this.savedSearchFileNodeId, JSON.stringify(updatedSearches)));
166-
}),
162+
switchMap((updatedSearches: SavedSearch[]) =>
163+
from(this.nodesApi.updateNodeContent(this.savedSearchFileNodeId, JSON.stringify(updatedSearches)))
164+
),
167165
catchError((error) => {
168166
this.savedSearches$.next(previousSavedSearchesOrder);
169167
return throwError(() => error);
@@ -192,9 +190,9 @@ export class SavedSearchesService {
192190
}));
193191
}),
194192
tap((savedSearches: SavedSearch[]) => this.savedSearches$.next(savedSearches)),
195-
switchMap((updatedSearches: SavedSearch[]) => {
196-
return from(this.nodesApi.updateNodeContent(this.savedSearchFileNodeId, JSON.stringify(updatedSearches)));
197-
}),
193+
switchMap((updatedSearches: SavedSearch[]) =>
194+
from(this.nodesApi.updateNodeContent(this.savedSearchFileNodeId, JSON.stringify(updatedSearches)))
195+
),
198196
catchError((error) => {
199197
this.savedSearches$.next(previousSavedSearchesOrder);
200198
return throwError(() => error);

lib/content-services/src/lib/content-metadata/components/content-metadata-card/content-metadata-card.component.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111
[preset]="preset"
1212
[displayTags]="displayTags"
1313
[displayCategories]="displayCategories"
14-
[customPanels]="customPanels">
15-
</adf-content-metadata>
14+
[customPanels]="customPanels" />
1615
</mat-card-content>
1716
<mat-card-footer class="adf-content-metadata-card-footer adf-content-metadata-card-view-footer">
1817
<div>

lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.html

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@
5252
[displayEmpty]="displayEmpty"
5353
[copyToClipboardAction]="copyToClipboardAction"
5454
[useChipsForMultiValueProperty]="useChipsForMultiValueProperty"
55-
[multiValueSeparator]="multiValueSeparator">
56-
</adf-card-view>
55+
[multiValueSeparator]="multiValueSeparator" />
5756
</mat-expansion-panel>
5857

5958
<ng-container *ngIf="displayTags">
@@ -114,8 +113,7 @@
114113
(tagsChange)="storeTagsToAssign($event)"
115114
[mode]="tagsCreatorMode"
116115
[tags]="assignedTags"
117-
[disabledTagsRemoving]="saving">
118-
</adf-tags-creator>
116+
[disabledTagsRemoving]="saving" />
119117
</mat-expansion-panel>
120118
</ng-container>
121119

@@ -178,8 +176,7 @@
178176
[categories]="categories"
179177
[managementMode]="categoriesManagementMode"
180178
[classifiableChanged]="classifiableChanged"
181-
(categoriesChange)="storeCategoriesToAssign($event)">
182-
</adf-categories-management>
179+
(categoriesChange)="storeCategoriesToAssign($event)" />
183180
</mat-expansion-panel>
184181
</ng-container>
185182

@@ -196,10 +193,9 @@
196193
<adf-content-metadata-header
197194
class="adf-metadata-custom-panel-title"
198195
[title]="customPanel.panelTitle"
199-
[expanded]="currentPanel.panelTitle === customPanel.panelTitle && currentPanel.expanded">
200-
</adf-content-metadata-header>
196+
[expanded]="currentPanel.panelTitle === customPanel.panelTitle && currentPanel.expanded" />
201197
</mat-expansion-panel-header>
202-
<adf-dynamic-component [id]="customPanel.component" [data]="{ node }"></adf-dynamic-component>
198+
<adf-dynamic-component [id]="customPanel.component" [data]="{ node }" />
203199
</mat-expansion-panel>
204200

205201
<ng-container *ngIf="groupedProperties$ | async; else loading; let groupedProperties">
@@ -257,13 +253,12 @@
257253
[copyToClipboardAction]="copyToClipboardAction"
258254
[useChipsForMultiValueProperty]="useChipsForMultiValueProperty"
259255
[multiValueSeparator]="multiValueSeparator"
260-
[displayLabelForChips]="true">
261-
</adf-card-view>
256+
[displayLabelForChips]="true" />
262257
</mat-expansion-panel>
263258
</div>
264259
</ng-container>
265260

266261
<ng-template #loading>
267-
<mat-progress-bar mode="indeterminate" [attr.aria-label]="'DATA_LOADING' | translate"> </mat-progress-bar>
262+
<mat-progress-bar mode="indeterminate" [attr.aria-label]="'DATA_LOADING' | translate" />
268263
</ng-template>
269264
</mat-accordion>

lib/content-services/src/lib/content-node-selector/content-node-selector-panel/content-node-selector-panel.component.html

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@
3434
[hideMyFiles]="dropdownHideMyFiles"
3535
[siteList]="dropdownSiteList"
3636
[value]="startSiteGuid"
37-
data-automation-id="content-node-selector-sites-combo">
38-
</adf-sites-dropdown>
37+
data-automation-id="content-node-selector-sites-combo" />
3938
<button *ngIf="hasCustomModels()"
4039
data-automation-id="adf-toggle-search-panel-button"
4140
mat-icon-button
@@ -44,7 +43,7 @@
4443
{{ 'SEARCH.SEARCH_HEADER.TITLE' | translate }}
4544
</button>
4645
<div class="adf-content-node-selector-search-panel-container">
47-
<adf-search-panel *ngIf="searchPanelExpanded"></adf-search-panel>
46+
<adf-search-panel *ngIf="searchPanelExpanded" />
4847
<div class="adf-content-node-selector-document-list-container">
4948
<adf-toolbar>
5049
<adf-toolbar-title>
@@ -59,9 +58,8 @@ <h2 class="adf-search-results-label">{{ 'NODE_SELECTOR.SEARCH_RESULTS' | transla
5958
[transform]="breadcrumbTransform"
6059
[folderNode]="breadcrumbFolderNode"
6160
[root]="breadcrumbFolderTitle"
62-
data-automation-id="content-node-selector-content-breadcrumb">
63-
</adf-dropdown-breadcrumb>
64-
<ng-container *ngIf="showNodeCounter" [adf-node-counter]="getSelectedCount()"></ng-container>
61+
data-automation-id="content-node-selector-content-breadcrumb" />
62+
<ng-container *ngIf="showNodeCounter" [adf-node-counter]="getSelectedCount()" />
6563
</adf-toolbar-title>
6664
</adf-toolbar>
6765

@@ -98,15 +96,15 @@ <h2 class="adf-search-results-label">{{ 'NODE_SELECTOR.SEARCH_RESULTS' | transla
9896
</adf-custom-empty-content-template>
9997

10098
<data-columns>
101-
<data-column key="$thumbnail" type="image"></data-column>
99+
<data-column key="$thumbnail" type="image" />
102100
<data-column key="name" type="text" title="ADF-DOCUMENT-LIST.LAYOUT.NAME" class="adf-full-width adf-ellipsis-cell">
103101
<ng-template let-context>
104-
<adf-name-location-cell [row]="context.row"></adf-name-location-cell>
102+
<adf-name-location-cell [row]="context.row" />
105103
</ng-template>
106104
</data-column>
107-
<data-column key="modifiedAt" type="date" title="ADF-DOCUMENT-LIST.LAYOUT.MODIFIED_ON" format="timeAgo" class="adf-content-selector-modified-cell"></data-column>
108-
<data-column key="createdByUser.displayName" type="text" title="ADF-DOCUMENT-LIST.LAYOUT.CREATED_BY" class="adf-content-selector-modifier-cell"></data-column>
109-
<data-column key="visibility" type="text" title="ADF-DOCUMENT-LIST.LAYOUT.STATUS" class="adf-content-selector-visibility-cell"></data-column>
105+
<data-column key="modifiedAt" type="date" title="ADF-DOCUMENT-LIST.LAYOUT.MODIFIED_ON" format="timeAgo" class="adf-content-selector-modified-cell" />
106+
<data-column key="createdByUser.displayName" type="text" title="ADF-DOCUMENT-LIST.LAYOUT.CREATED_BY" class="adf-content-selector-modifier-cell" />
107+
<data-column key="visibility" type="text" title="ADF-DOCUMENT-LIST.LAYOUT.STATUS" class="adf-content-selector-visibility-cell" />
110108
</data-columns>
111109

112110
</adf-document-list>

0 commit comments

Comments
 (0)