From 9df52d660feb722404be00a50f3c8a612bec1c15 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 17 Aug 2021 14:42:53 +0200 Subject: Migrate client to eslint --- .../edit-basic-configuration.component.ts | 2 +- .../edit-custom-config/edit-custom-config.component.ts | 4 +++- .../config/edit-custom-config/edit-homepage.component.ts | 2 +- .../follows/following-list/following-list.component.ts | 3 +-- .../+admin/follows/shared/redundancy-checkbox.component.ts | 2 +- .../video-redundancies-list.component.ts | 4 ++-- .../video-block-list/video-block-list.component.html | 4 ++-- .../video-block-list/video-block-list.component.ts | 4 ++-- .../video-comment-list/video-comment-list.component.ts | 6 +++--- .../plugins/plugin-search/plugin-search.component.html | 2 +- .../plugin-show-installed.component.ts | 6 +++--- client/src/app/+admin/plugins/shared/plugin-api.service.ts | 4 +--- client/src/app/+admin/system/jobs/job.service.ts | 8 ++++---- client/src/app/+admin/system/logs/logs.service.ts | 6 +++--- .../app/+admin/users/user-edit/user-create.component.ts | 6 ++++-- client/src/app/+admin/users/user-edit/user-edit.ts | 2 +- .../app/+admin/users/user-edit/user-password.component.ts | 6 ++++-- .../app/+admin/users/user-edit/user-update.component.ts | 14 ++++++++++---- .../src/app/+admin/users/user-list/user-list.component.ts | 2 +- 19 files changed, 48 insertions(+), 39 deletions(-) (limited to 'client/src/app/+admin') diff --git a/client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.ts b/client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.ts index 671e734ac..7a8258820 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.ts +++ b/client/src/app/+admin/config/edit-custom-config/edit-basic-configuration.component.ts @@ -97,7 +97,7 @@ export class EditBasicConfigurationComponent implements OnInit, OnChanges { .pipe(pairwise()) .subscribe(([ oldValue, newValue ]) => { if (oldValue !== true && newValue === true) { - // tslint:disable:max-line-length + /* eslint-disable max-len */ this.signupAlertMessage = $localize`You enabled signup: we automatically enabled the "Block new videos automatically" checkbox of the "Videos" section just below.` this.form.patchValue({ diff --git a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts index 538fa6f14..be1a99289 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts +++ b/client/src/app/+admin/config/edit-custom-config/edit-custom-config.component.ts @@ -277,7 +277,9 @@ export class EditCustomConfigComponent extends FormReactive implements OnInit { // Reload general configuration this.serverService.resetConfig() - .subscribe(config => this.serverConfig = config) + .subscribe(config => { + this.serverConfig = config + }) this.updateForm() diff --git a/client/src/app/+admin/config/edit-custom-config/edit-homepage.component.ts b/client/src/app/+admin/config/edit-custom-config/edit-homepage.component.ts index 1923ede39..dc834da14 100644 --- a/client/src/app/+admin/config/edit-custom-config/edit-homepage.component.ts +++ b/client/src/app/+admin/config/edit-custom-config/edit-homepage.component.ts @@ -1,4 +1,4 @@ -import { Component, Input, OnInit } from '@angular/core' +import { Component, Input } from '@angular/core' import { FormGroup } from '@angular/forms' import { CustomMarkupService } from '@app/shared/shared-custom-markup' diff --git a/client/src/app/+admin/follows/following-list/following-list.component.ts b/client/src/app/+admin/follows/following-list/following-list.component.ts index cf0225098..383f66ffd 100644 --- a/client/src/app/+admin/follows/following-list/following-list.component.ts +++ b/client/src/app/+admin/follows/following-list/following-list.component.ts @@ -2,7 +2,6 @@ import { SortMeta } from 'primeng/api' import { Component, OnInit, ViewChild } from '@angular/core' import { ConfirmService, Notifier, RestPagination, RestTable } from '@app/core' import { InstanceFollowService } from '@app/shared/shared-instance' -import { BatchDomainsModalComponent } from '@app/shared/shared-moderation' import { ActorFollow } from '@shared/models' import { FollowModalComponent } from './follow-modal.component' @@ -22,7 +21,7 @@ export class FollowingListComponent extends RestTable implements OnInit { private notifier: Notifier, private confirmService: ConfirmService, private followService: InstanceFollowService - ) { + ) { super() } diff --git a/client/src/app/+admin/follows/shared/redundancy-checkbox.component.ts b/client/src/app/+admin/follows/shared/redundancy-checkbox.component.ts index 47c402510..95f8473db 100644 --- a/client/src/app/+admin/follows/shared/redundancy-checkbox.component.ts +++ b/client/src/app/+admin/follows/shared/redundancy-checkbox.component.ts @@ -14,7 +14,7 @@ export class RedundancyCheckboxComponent { constructor ( private notifier: Notifier, private redundancyService: RedundancyService - ) { } + ) { } updateRedundancyState () { this.redundancyService.updateRedundancy(this.host, this.redundancyAllowed) diff --git a/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.ts b/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.ts index 4c691269a..7ffed83e8 100644 --- a/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.ts +++ b/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.ts @@ -21,7 +21,7 @@ export class VideoRedundanciesListComponent extends RestTable implements OnInit pagination: RestPagination = { count: this.rowsPerPage, start: 0 } displayType: VideoRedundanciesTarget = 'my-videos' - redundanciesGraphsData: { stats: VideosRedundancyStats, graphData: object, options: object }[] = [] + redundanciesGraphsData: { stats: VideosRedundancyStats, graphData: any, options: any }[] = [] noRedundancies = false @@ -32,7 +32,7 @@ export class VideoRedundanciesListComponent extends RestTable implements OnInit private confirmService: ConfirmService, private redundancyService: RedundancyService, private serverService: ServerService - ) { + ) { super() this.bytesPipe = new BytesPipe() diff --git a/client/src/app/+admin/moderation/video-block-list/video-block-list.component.html b/client/src/app/+admin/moderation/video-block-list/video-block-list.component.html index d89c8f244..3a8df1f07 100644 --- a/client/src/app/+admin/moderation/video-block-list/video-block-list.component.html +++ b/client/src/app/+admin/moderation/video-block-list/video-block-list.component.html @@ -21,7 +21,7 @@ - + Video Sensitive @@ -54,7 +54,7 @@
- + {{ videoBlock.video.name }}
by {{ videoBlock.video.channel?.displayName }} on {{ videoBlock.video.channel?.host }}
diff --git a/client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts b/client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts index adef16975..3edcb1c63 100644 --- a/client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts +++ b/client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts @@ -28,11 +28,11 @@ export class VideoBlockListComponent extends RestTable implements OnInit { inputFilters: AdvancedInputFilter[] = [ { - queryParams: { 'search': 'type:auto' }, + queryParams: { search: 'type:auto' }, label: $localize`Automatic blocks` }, { - queryParams: { 'search': 'type:manual' }, + queryParams: { search: 'type:manual' }, label: $localize`Manual blocks` } ] diff --git a/client/src/app/+admin/moderation/video-comment-list/video-comment-list.component.ts b/client/src/app/+admin/moderation/video-comment-list/video-comment-list.component.ts index 4904bcc25..512ceffd9 100644 --- a/client/src/app/+admin/moderation/video-comment-list/video-comment-list.component.ts +++ b/client/src/app/+admin/moderation/video-comment-list/video-comment-list.component.ts @@ -44,11 +44,11 @@ export class VideoCommentListComponent extends RestTable implements OnInit { inputFilters: AdvancedInputFilter[] = [ { - queryParams: { 'search': 'local:true' }, + queryParams: { search: 'local:true' }, label: $localize`Local comments` }, { - queryParams: { 'search': 'local:false' }, + queryParams: { search: 'local:false' }, label: $localize`Remote comments` } ] @@ -66,7 +66,7 @@ export class VideoCommentListComponent extends RestTable implements OnInit { private videoCommentService: VideoCommentService, private markdownRenderer: MarkdownService, private bulkService: BulkService - ) { + ) { super() this.videoCommentActions = [ diff --git a/client/src/app/+admin/plugins/plugin-search/plugin-search.component.html b/client/src/app/+admin/plugins/plugin-search/plugin-search.component.html index 8d8f12c48..a41c7d700 100644 --- a/client/src/app/+admin/plugins/plugin-search/plugin-search.component.html +++ b/client/src/app/+admin/plugins/plugin-search/plugin-search.component.html @@ -3,7 +3,7 @@
diff --git a/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.ts b/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.ts index 10fb52911..402bef1ea 100644 --- a/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.ts +++ b/client/src/app/+admin/plugins/plugin-show-installed/plugin-show-installed.component.ts @@ -103,8 +103,8 @@ export class PluginShowInstalledComponent extends FormReactive implements OnInit const settingsValues: any = {} for (const setting of this.registeredSettings) { - buildOptions[ setting.name ] = null - settingsValues[ setting.name ] = this.getSetting(setting.name) + buildOptions[setting.name] = null + settingsValues[setting.name] = this.getSetting(setting.name) } this.buildForm(buildOptions) @@ -117,7 +117,7 @@ export class PluginShowInstalledComponent extends FormReactive implements OnInit private getSetting (name: string) { const settings = this.plugin.settings - if (settings && settings[name] !== undefined) return settings[name] + if (settings?.[name] !== undefined) return settings[name] const registered = this.registeredSettings.find(r => r.name === name) diff --git a/client/src/app/+admin/plugins/shared/plugin-api.service.ts b/client/src/app/+admin/plugins/shared/plugin-api.service.ts index d91fccc09..c4f480cae 100644 --- a/client/src/app/+admin/plugins/shared/plugin-api.service.ts +++ b/client/src/app/+admin/plugins/shared/plugin-api.service.ts @@ -1,10 +1,8 @@ -import { Observable } from 'rxjs' -import { catchError, map, switchMap } from 'rxjs/operators' +import { catchError } from 'rxjs/operators' import { HttpClient, HttpParams } from '@angular/common/http' import { Injectable } from '@angular/core' import { ComponentPagination, RestExtractor, RestService } from '@app/core' import { PluginService } from '@app/core/plugins/plugin.service' -import { peertubeTranslate } from '@shared/core-utils/i18n' import { InstallOrUpdatePlugin, ManagePlugin, diff --git a/client/src/app/+admin/system/jobs/job.service.ts b/client/src/app/+admin/system/jobs/job.service.ts index 4b4a8914f..6c4a07469 100644 --- a/client/src/app/+admin/system/jobs/job.service.ts +++ b/client/src/app/+admin/system/jobs/job.service.ts @@ -20,9 +20,9 @@ export class JobService { ) {} getJobs (options: { - jobState?: JobStateClient, - jobType: JobTypeClient, - pagination: RestPagination, + jobState?: JobStateClient + jobType: JobTypeClient + pagination: RestPagination sort: SortMeta }): Observable> { const { jobState, jobType, pagination, sort } = options @@ -32,7 +32,7 @@ export class JobService { if (jobType !== 'all') params = params.append('jobType', jobType) - return this.authHttp.get>(JobService.BASE_JOB_URL + `/${jobState ? jobState : ''}`, { params }) + return this.authHttp.get>(JobService.BASE_JOB_URL + `/${jobState || ''}`, { params }) .pipe( map(res => { return this.restExtractor.convertResultListDateToHuman(res, [ 'createdAt', 'processedOn', 'finishedOn' ]) diff --git a/client/src/app/+admin/system/logs/logs.service.ts b/client/src/app/+admin/system/logs/logs.service.ts index 69439a179..0c222cad2 100644 --- a/client/src/app/+admin/system/logs/logs.service.ts +++ b/client/src/app/+admin/system/logs/logs.service.ts @@ -18,9 +18,9 @@ export class LogsService { ) {} getLogs (options: { - isAuditLog: boolean, - startDate: string, - level?: LogLevel, + isAuditLog: boolean + startDate: string + level?: LogLevel endDate?: string }): Observable { const { isAuditLog, startDate } = options diff --git a/client/src/app/+admin/users/user-edit/user-create.component.ts b/client/src/app/+admin/users/user-edit/user-create.component.ts index 8403db91a..b61b22fd0 100644 --- a/client/src/app/+admin/users/user-edit/user-create.component.ts +++ b/client/src/app/+admin/users/user-edit/user-create.component.ts @@ -33,7 +33,7 @@ export class UserCreateComponent extends UserEdit implements OnInit { private router: Router, private notifier: Notifier, private userService: UserService - ) { + ) { super() this.buildQuotaOptions() @@ -78,7 +78,9 @@ export class UserCreateComponent extends UserEdit implements OnInit { this.router.navigate([ '/admin/users/list' ]) }, - error: err => this.error = err.message + error: err => { + this.error = err.message + } }) } diff --git a/client/src/app/+admin/users/user-edit/user-edit.ts b/client/src/app/+admin/users/user-edit/user-edit.ts index ae1f79ba0..af5e674a7 100644 --- a/client/src/app/+admin/users/user-edit/user-edit.ts +++ b/client/src/app/+admin/users/user-edit/user-edit.ts @@ -7,7 +7,7 @@ import { HTMLServerConfig, UserAdminFlag, UserRole, VideoResolution } from '@sha import { SelectOptionsItem } from '../../../../types/select-options-item.model' @Directive() -// tslint:disable-next-line: directive-class-suffix +// eslint-disable-next-line @angular-eslint/directive-class-suffix export abstract class UserEdit extends FormReactive implements OnInit { videoQuotaOptions: SelectOptionsItem[] = [] videoQuotaDailyOptions: SelectOptionsItem[] = [] diff --git a/client/src/app/+admin/users/user-edit/user-password.component.ts b/client/src/app/+admin/users/user-edit/user-password.component.ts index 7c42b9241..42bf20de1 100644 --- a/client/src/app/+admin/users/user-edit/user-password.component.ts +++ b/client/src/app/+admin/users/user-edit/user-password.component.ts @@ -20,7 +20,7 @@ export class UserPasswordComponent extends FormReactive implements OnInit { protected formValidatorService: FormValidatorService, private notifier: Notifier, private userService: UserService - ) { + ) { super() } @@ -39,7 +39,9 @@ export class UserPasswordComponent extends FormReactive implements OnInit { .subscribe({ next: () => this.notifier.success($localize`Password changed for user ${this.username}.`), - error: err => this.error = err.message + error: err => { + this.error = err.message + } }) } diff --git a/client/src/app/+admin/users/user-edit/user-update.component.ts b/client/src/app/+admin/users/user-edit/user-update.component.ts index 2128ba4fd..42599a17e 100644 --- a/client/src/app/+admin/users/user-edit/user-update.component.ts +++ b/client/src/app/+admin/users/user-edit/user-update.component.ts @@ -33,7 +33,7 @@ export class UserUpdateComponent extends UserEdit implements OnInit, OnDestroy { private router: Router, private notifier: Notifier, private userService: UserService - ) { + ) { super() this.buildQuotaOptions() @@ -63,7 +63,9 @@ export class UserUpdateComponent extends UserEdit implements OnInit, OnDestroy { .subscribe({ next: user => this.onUserFetched(user), - error: err => this.error = err.message + error: err => { + this.error = err.message + } }) }) } @@ -91,7 +93,9 @@ export class UserUpdateComponent extends UserEdit implements OnInit, OnDestroy { this.router.navigate([ '/admin/users/list' ]) }, - error: err => this.error = err.message + error: err => { + this.error = err.message + } }) } @@ -114,7 +118,9 @@ export class UserUpdateComponent extends UserEdit implements OnInit, OnDestroy { this.notifier.success($localize`An email asking for password reset has been sent to ${this.user.username}.`) }, - error: err => this.error = err.message + error: err => { + this.error = err.message + } }) } diff --git a/client/src/app/+admin/users/user-list/user-list.component.ts b/client/src/app/+admin/users/user-list/user-list.component.ts index d4406549a..39caf5ed5 100644 --- a/client/src/app/+admin/users/user-list/user-list.component.ts +++ b/client/src/app/+admin/users/user-list/user-list.component.ts @@ -36,7 +36,7 @@ export class UserListComponent extends RestTable implements OnInit { inputFilters: AdvancedInputFilter[] = [ { - queryParams: { 'search': 'banned:true' }, + queryParams: { search: 'banned:true' }, label: $localize`Banned users` } ] -- cgit v1.2.3