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 --- .../app/shared/form-validators/user-validators.ts | 64 +++++++++++----------- 1 file changed, 32 insertions(+), 32 deletions(-) (limited to 'client/src/app/shared/form-validators/user-validators.ts') diff --git a/client/src/app/shared/form-validators/user-validators.ts b/client/src/app/shared/form-validators/user-validators.ts index 976c97b87..6d0dea64e 100644 --- a/client/src/app/shared/form-validators/user-validators.ts +++ b/client/src/app/shared/form-validators/user-validators.ts @@ -11,10 +11,10 @@ export const USER_USERNAME_VALIDATOR: BuildFormValidator = { Validators.pattern(new RegExp(`^${USER_USERNAME_REGEX_CHARACTERS}*$`)) ], MESSAGES: { - 'required': $localize`Username is required.`, - 'minlength': $localize`Username must be at least 1 character long.`, - 'maxlength': $localize`Username cannot be more than 50 characters long.`, - 'pattern': $localize`Username should be lowercase alphanumeric; dots and underscores are allowed.` + required: $localize`Username is required.`, + minlength: $localize`Username must be at least 1 character long.`, + maxlength: $localize`Username cannot be more than 50 characters long.`, + pattern: $localize`Username should be lowercase alphanumeric; dots and underscores are allowed.` } } @@ -26,18 +26,18 @@ export const USER_CHANNEL_NAME_VALIDATOR: BuildFormValidator = { Validators.pattern(/^[a-z0-9][a-z0-9._]*$/) ], MESSAGES: { - 'required': $localize`Channel name is required.`, - 'minlength': $localize`Channel name must be at least 1 character long.`, - 'maxlength': $localize`Channel name cannot be more than 50 characters long.`, - 'pattern': $localize`Channel name should be lowercase, and can contain only alphanumeric characters, dots and underscores.` + required: $localize`Channel name is required.`, + minlength: $localize`Channel name must be at least 1 character long.`, + maxlength: $localize`Channel name cannot be more than 50 characters long.`, + pattern: $localize`Channel name should be lowercase, and can contain only alphanumeric characters, dots and underscores.` } } export const USER_EMAIL_VALIDATOR: BuildFormValidator = { VALIDATORS: [ Validators.required, Validators.email ], MESSAGES: { - 'required': $localize`Email is required.`, - 'email': $localize`Email must be valid.` + required: $localize`Email is required.`, + email: $localize`Email must be valid.` } } @@ -47,8 +47,8 @@ export const USER_HANDLE_VALIDATOR: BuildFormValidator = { Validators.pattern(/@.+/) ], MESSAGES: { - 'required': $localize`Handle is required.`, - 'pattern': $localize`Handle must be valid (eg. chocobozzz@example.com).` + required: $localize`Handle is required.`, + pattern: $localize`Handle must be valid (eg. chocobozzz@example.com).` } } @@ -57,7 +57,7 @@ export const USER_EXISTING_PASSWORD_VALIDATOR: BuildFormValidator = { Validators.required ], MESSAGES: { - 'required': $localize`Password is required.` + required: $localize`Password is required.` } } @@ -68,9 +68,9 @@ export const USER_PASSWORD_VALIDATOR: BuildFormValidator = { Validators.maxLength(255) ], MESSAGES: { - 'required': $localize`Password is required.`, - 'minlength': $localize`Password must be at least 6 characters long.`, - 'maxlength': $localize`Password cannot be more than 255 characters long.` + required: $localize`Password is required.`, + minlength: $localize`Password must be at least 6 characters long.`, + maxlength: $localize`Password cannot be more than 255 characters long.` } } @@ -80,37 +80,37 @@ export const USER_PASSWORD_OPTIONAL_VALIDATOR: BuildFormValidator = { Validators.maxLength(255) ], MESSAGES: { - 'minlength': $localize`Password must be at least 6 characters long.`, - 'maxlength': $localize`Password cannot be more than 255 characters long.` + minlength: $localize`Password must be at least 6 characters long.`, + maxlength: $localize`Password cannot be more than 255 characters long.` } } export const USER_CONFIRM_PASSWORD_VALIDATOR: BuildFormValidator = { VALIDATORS: [], MESSAGES: { - 'matchPassword': $localize`The new password and the confirmed password do not correspond.` + matchPassword: $localize`The new password and the confirmed password do not correspond.` } } export const USER_VIDEO_QUOTA_VALIDATOR: BuildFormValidator = { VALIDATORS: [ Validators.required, Validators.min(-1) ], MESSAGES: { - 'required': $localize`Video quota is required.`, - 'min': $localize`Quota must be greater than -1.` + required: $localize`Video quota is required.`, + min: $localize`Quota must be greater than -1.` } } export const USER_VIDEO_QUOTA_DAILY_VALIDATOR: BuildFormValidator = { VALIDATORS: [ Validators.required, Validators.min(-1) ], MESSAGES: { - 'required': $localize`Daily upload limit is required.`, - 'min': $localize`Daily upload limit must be greater than -1.` + required: $localize`Daily upload limit is required.`, + min: $localize`Daily upload limit must be greater than -1.` } } export const USER_ROLE_VALIDATOR: BuildFormValidator = { VALIDATORS: [ Validators.required ], MESSAGES: { - 'required': $localize`User role is required.` + required: $localize`User role is required.` } } @@ -122,15 +122,15 @@ export const USER_DESCRIPTION_VALIDATOR: BuildFormValidator = { Validators.maxLength(1000) ], MESSAGES: { - 'minlength': $localize`Description must be at least 3 characters long.`, - 'maxlength': $localize`Description cannot be more than 1000 characters long.` + minlength: $localize`Description must be at least 3 characters long.`, + maxlength: $localize`Description cannot be more than 1000 characters long.` } } export const USER_TERMS_VALIDATOR: BuildFormValidator = { VALIDATORS: [ Validators.requiredTrue ], MESSAGES: { - 'required': $localize`You must agree with the instance terms in order to register on it.` + required: $localize`You must agree with the instance terms in order to register on it.` } } @@ -140,8 +140,8 @@ export const USER_BAN_REASON_VALIDATOR: BuildFormValidator = { Validators.maxLength(250) ], MESSAGES: { - 'minlength': $localize`Ban reason must be at least 3 characters long.`, - 'maxlength': $localize`Ban reason cannot be more than 250 characters long.` + minlength: $localize`Ban reason must be at least 3 characters long.`, + maxlength: $localize`Ban reason cannot be more than 250 characters long.` } } @@ -152,9 +152,9 @@ function buildDisplayNameValidator (required: boolean) { Validators.maxLength(120) ], MESSAGES: { - 'required': $localize`Display name is required.`, - 'minlength': $localize`Display name must be at least 1 character long.`, - 'maxlength': $localize`Display name cannot be more than 50 characters long.` + required: $localize`Display name is required.`, + minlength: $localize`Display name must be at least 1 character long.`, + maxlength: $localize`Display name cannot be more than 50 characters long.` } } -- cgit v1.2.3