From cf282aa351cbc58691fb1b2fb4764830247cdbe8 Mon Sep 17 00:00:00 2001 From: Vijay A Date: Mon, 25 Jul 2022 08:16:50 +0530 Subject: eslint needs to be executed at the top-level to actually work --- src/helpers/array-helpers.ts | 8 ++++---- src/helpers/url-helpers.ts | 7 ++++++- src/helpers/validation-helpers.ts | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) (limited to 'src/helpers') diff --git a/src/helpers/array-helpers.ts b/src/helpers/array-helpers.ts index 5d28af433..33be12fa7 100644 --- a/src/helpers/array-helpers.ts +++ b/src/helpers/array-helpers.ts @@ -1,6 +1,6 @@ export default function shuffleArray(arr: any[]): any[] { return arr - .map(a => [ Math.random(), a ]) - .sort((a, b) => a[ 0 ] - b[ 0 ]) - .map(a => a[ 1 ]) -}; + .map(a => [Math.random(), a]) + .sort((a, b) => a[0] - b[0]) + .map(a => a[1]); +} diff --git a/src/helpers/url-helpers.ts b/src/helpers/url-helpers.ts index 720f242b4..69a2cc4dc 100644 --- a/src/helpers/url-helpers.ts +++ b/src/helpers/url-helpers.ts @@ -24,7 +24,12 @@ export function isValidExternalURL(url: string | URL) { } export function fixUrl(url: string | URL) { - return url.toString().replaceAll('//', '/').replaceAll('http:/', 'http://').replaceAll('https:/', 'https://').replaceAll('file:/', 'file://'); + return url + .toString() + .replaceAll('//', '/') + .replaceAll('http:/', 'http://') + .replaceAll('https:/', 'https://') + .replaceAll('file:/', 'file://'); } export function isValidFileUrl(path: string) { diff --git a/src/helpers/validation-helpers.ts b/src/helpers/validation-helpers.ts index b2b8823af..4e0af8b08 100644 --- a/src/helpers/validation-helpers.ts +++ b/src/helpers/validation-helpers.ts @@ -13,7 +13,7 @@ const messages = defineMessages({ }, url: { id: 'validation.url', - defaultMessage: "{field} is not a valid URL", + defaultMessage: '{field} is not a valid URL', }, minLength: { id: 'validation.minLength', -- cgit v1.2.3-70-g09d2