From 304590a03e5d3eba90058fcd050ad1c5dcc37e8a Mon Sep 17 00:00:00 2001 From: MoritzWeber Date: Wed, 7 Feb 2024 15:44:45 +0100 Subject: [PATCH] refactor: Enforce mentioning of lifecycle hook interfaces --- frontend/.eslintrc.js | 1 + frontend/src/app/helpers/editor/editor.component.ts | 3 ++- .../project-metadata/project-metadata.component.ts | 4 ++-- .../project-audit-log/project-audit-log.component.ts | 4 +++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/frontend/.eslintrc.js b/frontend/.eslintrc.js index db0258021..8fc255edf 100644 --- a/frontend/.eslintrc.js +++ b/frontend/.eslintrc.js @@ -59,6 +59,7 @@ module.exports = { "unused-imports/no-unused-imports": "error", "no-console": ["error", { allow: ["error"] }], "deprecation/deprecation": "warn", + "@angular-eslint/use-lifecycle-interface": "error", }, }, { diff --git a/frontend/src/app/helpers/editor/editor.component.ts b/frontend/src/app/helpers/editor/editor.component.ts index 8edda593c..d3cc0d4ee 100644 --- a/frontend/src/app/helpers/editor/editor.component.ts +++ b/frontend/src/app/helpers/editor/editor.component.ts @@ -9,6 +9,7 @@ import { HostListener, Input, NgZone, + OnInit, Output, } from '@angular/core'; @@ -22,7 +23,7 @@ import { stringify, parse, YAMLParseError } from 'yaml'; selector: 'app-editor', templateUrl: './editor.component.html', }) -export class EditorComponent { +export class EditorComponent implements OnInit { private editor?: monaco.editor.IStandaloneCodeEditor = undefined; intialValue = 'Loading...'; diff --git a/frontend/src/app/projects/project-detail/project-metadata/project-metadata.component.ts b/frontend/src/app/projects/project-detail/project-metadata/project-metadata.component.ts index 85ac1d11a..a6a3ecda8 100644 --- a/frontend/src/app/projects/project-detail/project-metadata/project-metadata.component.ts +++ b/frontend/src/app/projects/project-detail/project-metadata/project-metadata.component.ts @@ -3,7 +3,7 @@ * SPDX-License-Identifier: Apache-2.0 */ -import { Component } from '@angular/core'; +import { Component, OnInit } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { ActivatedRoute, Router } from '@angular/router'; import { UntilDestroy, untilDestroyed } from '@ngneat/until-destroy'; @@ -24,7 +24,7 @@ import { templateUrl: './project-metadata.component.html', styleUrls: ['./project-metadata.component.css'], }) -export class ProjectMetadataComponent { +export class ProjectMetadataComponent implements OnInit { project?: Project; canDelete = false; diff --git a/frontend/src/app/projects/project-detail/project-users/project-audit-log/project-audit-log.component.ts b/frontend/src/app/projects/project-detail/project-users/project-audit-log/project-audit-log.component.ts index ef53996fa..e48920c1b 100644 --- a/frontend/src/app/projects/project-detail/project-users/project-audit-log/project-audit-log.component.ts +++ b/frontend/src/app/projects/project-detail/project-users/project-audit-log/project-audit-log.component.ts @@ -4,9 +4,11 @@ */ import { + AfterViewInit, Component, ElementRef, Inject, + OnInit, QueryList, ViewChildren, } from '@angular/core'; @@ -20,7 +22,7 @@ import { ProjectAuditLogService } from 'src/app/projects/project-detail/project- styleUrls: ['./project-audit-log.component.css'], }) @UntilDestroy() -export class ProjectAuditLogComponent { +export class ProjectAuditLogComponent implements OnInit, AfterViewInit { pageSize = 25; pageSizeArray = [...Array(this.pageSize).keys()];