From 50afa71c847a385a9655c5dbcc149a8cea3b26e8 Mon Sep 17 00:00:00 2001 From: John Rassa Date: Thu, 27 Jun 2024 13:58:44 -0400 Subject: [PATCH] feat: Enable additional eslint rules --- .eslintrc.json | 25 ++++++++- src/app/app.component.html | 2 +- .../common/breadcrumb/breadcrumb.component.ts | 4 +- .../bs-dialog-container.component.html | 2 +- .../configurable-dialog.component.html | 5 +- src/app/common/flyout/flyout.component.html | 3 +- .../loading-overlay.component.html | 6 ++- .../loading-overlay.component.ts | 4 +- .../loading-spinner.component.spec.ts | 4 +- .../loading-spinner.component.ts | 4 +- .../common/modal/modal/modal.component.html | 2 +- .../notification/notification.component.html | 2 +- .../notification/notification.component.ts | 4 +- .../search-input/search-input.component.html | 11 ++-- .../search-input/search-input.component.scss | 12 ++--- .../search-input.component.spec.ts | 8 ++- .../search-input/search-input.component.ts | 16 +++--- .../system-alert/system-alert.component.ts | 4 +- .../actions-menu-column.component.scss | 3 +- .../ago-date/ago-date-column.component.html | 3 +- .../columns/asy-abstract-column.component.ts | 2 +- .../asy-abstract-value-column.component.ts | 2 +- .../columns/date/date-column.component.html | 3 +- .../asy-expandable-list-column.component.html | 8 ++- .../asy-expander-column.component.html | 4 +- .../asy-expander-column.component.scss | 9 ++++ .../columns/text/text-column.component.html | 3 +- .../asy-abstract-header-filter.component.ts | 2 +- .../asy-header-date-filter.component.html | 1 + .../asy-header-list-filter.component.html | 14 +++-- .../asy-header-text-filter.component.html | 7 ++- ...asy-header-typeahead-filter.component.html | 4 +- .../table/paginator/paginator.component.html | 3 +- .../table/sidebar/sidebar.component.html | 2 +- .../asy-sort-header.component.html | 4 +- .../asy-table-empty-state.component.html | 16 ++++-- .../asy-table-empty-state.component.ts | 3 +- src/app/core/admin/admin.component.html | 2 +- src/app/core/admin/admin.component.ts | 4 +- .../cache-entry-modal.component.html | 16 +++--- .../cache-entry-modal.component.ts | 2 +- .../admin/cache-entries/cache-entry.model.ts | 1 - .../list-cache-entries.component.html | 15 +++--- .../list-cache-entries.component.ts | 1 + .../list-euas/admin-list-euas.component.html | 28 ++++++---- .../manage-eua/manage-eua.component.html | 2 +- .../admin-list-feedback.component.html | 31 +++++------ .../admin-list-feedback.component.ts | 4 +- .../list-messages.component.html | 14 ++--- .../manage-message.component.html | 4 +- .../admin-list-users.component.html | 42 +++++++-------- .../manage-user/manage-user.component.html | 52 +++++++++---------- src/app/core/audit/audit.service.ts | 1 + .../list-audit-entries.component.html | 33 +++++------- src/app/core/eua/user-eua.component.html | 2 +- src/app/core/eua/user-eua.component.ts | 2 +- .../feedback-flyout.component.html | 9 ++-- .../feedback-modal.component.html | 9 ++-- .../feedback-modal.component.ts | 4 +- .../external-links.component.ts | 2 +- .../getting-started-help.component.html | 2 +- .../getting-started-help.component.ts | 2 +- src/app/core/help/help.component.html | 2 +- src/app/core/help/help.component.ts | 4 +- .../masquerade/masquerade.component.html | 6 +-- .../masquerade/masquerade.component.ts | 2 +- .../recent-messages.component.html | 9 ++-- .../view-all-messages.component.html | 7 ++- src/app/core/page-title.strategy.ts | 1 + src/app/core/signin/signin.component.html | 2 +- src/app/core/signin/signin.component.ts | 4 +- src/app/core/signup/signed-up.component.ts | 2 +- src/app/core/signup/signup.component.html | 2 +- .../site-container.component.html | 2 +- .../site-container.component.ts | 4 +- .../site-navbar/site-navbar.component.html | 38 +++++++++----- .../site-navbar/site-navbar.component.scss | 2 +- .../core/site-navbar/site-navbar.component.ts | 9 ++-- .../add-members-modal.component.html | 4 +- .../create-team/create-team.component.html | 23 ++++---- .../list-team-members.component.html | 20 +++---- .../list-teams/base-list-teams.component.ts | 2 +- .../list-teams/list-teams.component.html | 10 ++-- .../general-details.component.html | 28 ++++++---- .../teams/view-team/view-team.component.html | 4 +- .../theme-toggle/theme-toggle.component.html | 1 + .../site/example/alerts/alerts.component.html | 4 +- .../site/example/forms/forms.component.html | 6 +-- .../example-loading-overlay.component.html | 16 ++++-- .../example/shared/example-mock.service.ts | 27 ---------- .../example/shared/example-rest.service.ts | 20 ------- src/app/site/example/shared/example.model.ts | 5 -- .../site/example/shared/example.service.ts | 10 ---- src/index.html | 9 +++- src/styles/_globals.scss | 2 +- 95 files changed, 400 insertions(+), 382 deletions(-) delete mode 100644 src/app/site/example/shared/example-mock.service.ts delete mode 100644 src/app/site/example/shared/example-rest.service.ts delete mode 100644 src/app/site/example/shared/example.model.ts delete mode 100644 src/app/site/example/shared/example.service.ts diff --git a/.eslintrc.json b/.eslintrc.json index 1cce03ac..8cbb1d32 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -49,6 +49,13 @@ "style": "kebab-case" } ], + "@angular-eslint/prefer-on-push-component-change-detection": ["off"], + "@angular-eslint/prefer-output-readonly": ["error"], + "@angular-eslint/prefer-standalone": ["warn"], + "@angular-eslint/relative-url-prefix": ["error"], + "@angular-eslint/use-component-view-encapsulation": ["error"], + "@angular-eslint/use-injectable-provided-in": ["error"], + "@angular-eslint/use-lifecycle-interface": ["error"], "@typescript-eslint/no-explicit-any": ["off"], "@typescript-eslint/no-unused-vars": [ "warn", @@ -106,7 +113,23 @@ "extends": [ "plugin:@angular-eslint/template/recommended" ], - "rules": {} + "rules": { + "@angular-eslint/template/alt-text": ["error"], + "@angular-eslint/template/button-has-type": ["error"], + "@angular-eslint/template/click-events-have-key-events": ["error"], + "@angular-eslint/template/elements-content": ["error"], + "@angular-eslint/template/interactive-supports-focus": ["error"], + "@angular-eslint/template/label-has-associated-control": ["error"], + "@angular-eslint/template/mouse-events-have-key-events": ["error"], + "@angular-eslint/template/no-any": ["error"], + "@angular-eslint/template/no-distracting-elements": ["error"], + "@angular-eslint/template/prefer-control-flow": ["error"], + "@angular-eslint/template/prefer-ngsrc": ["error"], + "@angular-eslint/template/prefer-self-closing-tags": ["error"], + "@angular-eslint/template/role-has-required-aria": ["error"], + "@angular-eslint/template/table-scope": ["error"], + "@angular-eslint/template/valid-aria": ["error"] + } }, { "files": [ diff --git a/src/app/app.component.html b/src/app/app.component.html index 5f1a60ac..082586e2 100644 --- a/src/app/app.component.html +++ b/src/app/app.component.html @@ -1,5 +1,5 @@
- +
diff --git a/src/app/common/breadcrumb/breadcrumb.component.ts b/src/app/common/breadcrumb/breadcrumb.component.ts index a1c320af..81e341a4 100644 --- a/src/app/common/breadcrumb/breadcrumb.component.ts +++ b/src/app/common/breadcrumb/breadcrumb.component.ts @@ -9,8 +9,8 @@ import { Breadcrumb, BreadcrumbService } from './breadcrumb.service'; @Component({ selector: 'breadcrumb', - templateUrl: 'breadcrumb.component.html', - styleUrls: ['breadcrumb.component.scss'], + templateUrl: './breadcrumb.component.html', + styleUrls: ['./breadcrumb.component.scss'], standalone: true, imports: [RouterLink] }) diff --git a/src/app/common/dialog/bs-dialog-container/bs-dialog-container.component.html b/src/app/common/dialog/bs-dialog-container/bs-dialog-container.component.html index 77131635..affee68c 100644 --- a/src/app/common/dialog/bs-dialog-container/bs-dialog-container.component.html +++ b/src/app/common/dialog/bs-dialog-container/bs-dialog-container.component.html @@ -1,5 +1,5 @@ diff --git a/src/app/common/dialog/configurable-dialog/configurable-dialog.component.html b/src/app/common/dialog/configurable-dialog/configurable-dialog.component.html index 4d8b8bc3..0f88a670 100644 --- a/src/app/common/dialog/configurable-dialog/configurable-dialog.component.html +++ b/src/app/common/dialog/configurable-dialog/configurable-dialog.component.html @@ -13,10 +13,13 @@
@for (input of data.inputs; track input; let isFirst = $first) {
- + @if (input.type === 'textarea') {