From 16f38bc591b7fdfa3ca62370642bd86baef056ad Mon Sep 17 00:00:00 2001 From: Simon Alling Date: Thu, 5 May 2022 07:48:09 +0200 Subject: [PATCH] Fix lint errors in portal (#16799) This PR fixes all lint errors reported by TSLint (`npm run lint` in `src/portal/`). TSLint also reports multiple warnings (see #16798), but this PR doesn't fix any of them. Signed-off-by: Simon Alling --- src/portal/src/app/base/left-side-nav/labels/labels.module.ts | 2 +- .../app/base/password-setting/password-setting.component.ts | 2 +- .../chart-detail/chart-detail-value.component.spec.ts | 2 +- .../helm-chart/helm-chart-detail/helm-chart.service.ts | 4 ++-- .../helm-chart/helm-chart-list/list-charts.component.spec.ts | 2 +- .../project-policy-config.component.spec.ts | 2 +- .../shared/components/push-image/push-image.component.spec.ts | 2 +- src/portal/src/app/shared/directives/port.directive.ts | 2 +- 8 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/portal/src/app/base/left-side-nav/labels/labels.module.ts b/src/portal/src/app/base/left-side-nav/labels/labels.module.ts index 3465b9be9..532ac6a79 100644 --- a/src/portal/src/app/base/left-side-nav/labels/labels.module.ts +++ b/src/portal/src/app/base/left-side-nav/labels/labels.module.ts @@ -13,7 +13,7 @@ // limitations under the License. import { NgModule } from "@angular/core"; -import { SharedModule } from "../../../shared/shared.module";; +import { SharedModule } from "../../../shared/shared.module"; import { RouterModule, Routes } from "@angular/router"; import { LabelsComponent } from "./labels.component"; diff --git a/src/portal/src/app/base/password-setting/password-setting.component.ts b/src/portal/src/app/base/password-setting/password-setting.component.ts index 0ae6c430a..e5a1af9ab 100644 --- a/src/portal/src/app/base/password-setting/password-setting.component.ts +++ b/src/portal/src/app/base/password-setting/password-setting.component.ts @@ -27,7 +27,7 @@ import { InlineAlertComponent } from "../../shared/components/inline-alert/inlin export class PasswordSettingComponent implements AfterViewChecked { showOldPwd: boolean = false; showNewPwd: boolean = false; - showReNewPwd: boolean =false; + showReNewPwd: boolean = false; opened: boolean = false; oldPwd: string = ""; newPwd: string = ""; diff --git a/src/portal/src/app/base/project/helm-chart/helm-chart-detail/chart-detail/chart-detail-value.component.spec.ts b/src/portal/src/app/base/project/helm-chart/helm-chart-detail/chart-detail/chart-detail-value.component.spec.ts index 9b341b77f..83b8bf4b7 100644 --- a/src/portal/src/app/base/project/helm-chart/helm-chart-detail/chart-detail/chart-detail-value.component.spec.ts +++ b/src/portal/src/app/base/project/helm-chart/helm-chart-detail/chart-detail/chart-detail-value.component.spec.ts @@ -11,7 +11,7 @@ describe('ChartDetailValueComponent', () => { let component: ChartDetailValueComponent; let fixture: ComponentFixture; - beforeEach(async ()=> { + beforeEach(async () => { await TestBed.configureTestingModule({ imports: [ TranslateModule.forRoot(), diff --git a/src/portal/src/app/base/project/helm-chart/helm-chart-detail/helm-chart.service.ts b/src/portal/src/app/base/project/helm-chart/helm-chart-detail/helm-chart.service.ts index faa927991..f3cd9c7a9 100644 --- a/src/portal/src/app/base/project/helm-chart/helm-chart-detail/helm-chart.service.ts +++ b/src/portal/src/app/base/project/helm-chart/helm-chart-detail/helm-chart.service.ts @@ -177,9 +177,9 @@ export class HelmChartDefaultService extends HelmChartService { responseType: 'blob', }) .pipe(map(response => { - let parts = filename.split('/') + let parts = filename.split('/'); return { - filename: parts[parts.length-1], + filename: parts[parts.length - 1], data: response }; })) diff --git a/src/portal/src/app/base/project/helm-chart/helm-chart-list/list-charts.component.spec.ts b/src/portal/src/app/base/project/helm-chart/helm-chart-list/list-charts.component.spec.ts index b1acd682d..ebb47e1a2 100644 --- a/src/portal/src/app/base/project/helm-chart/helm-chart-list/list-charts.component.spec.ts +++ b/src/portal/src/app/base/project/helm-chart/helm-chart-list/list-charts.component.spec.ts @@ -14,7 +14,7 @@ describe('ListChartsComponent', () => { } }; - beforeEach(()=> { + beforeEach(() => { TestBed.configureTestingModule({ declarations: [ListChartsComponent], imports: [ diff --git a/src/portal/src/app/base/project/project-config/project-policy-config/project-policy-config.component.spec.ts b/src/portal/src/app/base/project/project-config/project-policy-config/project-policy-config.component.spec.ts index a9e5df9c4..c5062aaf1 100644 --- a/src/portal/src/app/base/project/project-config/project-policy-config/project-policy-config.component.spec.ts +++ b/src/portal/src/app/base/project/project-config/project-policy-config/project-policy-config.component.spec.ts @@ -150,5 +150,5 @@ describe('ProjectPolicyConfigComponent', () => { }) class TestHostComponent { @ViewChild(ProjectPolicyConfigComponent) - projectPolicyConfigComponent: ProjectPolicyConfigComponent + projectPolicyConfigComponent: ProjectPolicyConfigComponent; } diff --git a/src/portal/src/app/shared/components/push-image/push-image.component.spec.ts b/src/portal/src/app/shared/components/push-image/push-image.component.spec.ts index 0bda7c52f..00c6418a9 100644 --- a/src/portal/src/app/shared/components/push-image/push-image.component.spec.ts +++ b/src/portal/src/app/shared/components/push-image/push-image.component.spec.ts @@ -15,7 +15,7 @@ describe('PushImageButtonComponent (inline template)', () => { imports: [ SharedTestingModule ], - declarations: [InlineAlertComponent, CopyInputComponent, PushImageButtonComponent,TestHostComponent], + declarations: [InlineAlertComponent, CopyInputComponent, PushImageButtonComponent, TestHostComponent], providers: [ ErrorHandler ] diff --git a/src/portal/src/app/shared/directives/port.directive.ts b/src/portal/src/app/shared/directives/port.directive.ts index 5ab4c8a00..2a488d165 100644 --- a/src/portal/src/app/shared/directives/port.directive.ts +++ b/src/portal/src/app/shared/directives/port.directive.ts @@ -27,7 +27,7 @@ export function portValidator(): ValidatorFn { if (!regExp.test(value)) { return { 'port': 65535 }; } else { - const portV = Number.parseInt(value); + const portV = Number.parseInt(value, 10); if (portV <= 0 || portV > 65535) { return { 'port': 65535 }; }