From 9a7f11a8288cc97adb2e3519a63cfb2dc8c36a53 Mon Sep 17 00:00:00 2001 From: yugal07 Date: Fri, 10 Jan 2025 00:01:44 +0530 Subject: [PATCH] Fixed ESLint bugs that required ts-specific rules for js functions --- scripts/githooks/check-localstorage-usage.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scripts/githooks/check-localstorage-usage.js b/scripts/githooks/check-localstorage-usage.js index 0a811df307..dfee24c139 100755 --- a/scripts/githooks/check-localstorage-usage.js +++ b/scripts/githooks/check-localstorage-usage.js @@ -7,6 +7,7 @@ import { execSync } from 'child_process'; const args = process.argv.slice(2); const scanEntireRepo = args.includes('--scan-entire-repo'); +// eslint-disable-next-line @typescript-eslint/explicit-function-return-type const containsSkipComment = (file) => { try { const content = readFileSync(file, 'utf-8'); @@ -17,6 +18,7 @@ const containsSkipComment = (file) => { } }; +// eslint-disable-next-line @typescript-eslint/explicit-function-return-type const getModifiedFiles = () => { try { if (scanEntireRepo) { @@ -40,6 +42,7 @@ const files = getModifiedFiles(); const filesWithLocalStorage = []; +// eslint-disable-next-line @typescript-eslint/explicit-function-return-type const checkLocalStorageUsage = (file) => { if (!file) { return; @@ -86,10 +89,10 @@ if (filesWithLocalStorage.length > 0) { console.info( '\x1b[34m%s\x1b[0m', - '\nInfo: Consider using custom hook functions.' + '\nInfo: Consider using custom hook functions.', ); console.info( - 'Please use the getItem, setItem, and removeItem functions provided by the custom hook useLocalStorage.\n' + 'Please use the getItem, setItem, and removeItem functions provided by the custom hook useLocalStorage.\n', ); process.exit(1);