From 9c3ee3d146add9696ab26f25451c983dac2a4358 Mon Sep 17 00:00:00 2001 From: Aetherinox Date: Sun, 5 Oct 2025 00:57:02 -0700 Subject: [PATCH] refactor: update eslint corrections --- tvapp2/classes/CLib.js | 17 +++++++++-------- tvapp2/classes/Log.js | 1 + tvapp2/classes/Semaphore.js | 1 + tvapp2/classes/Utils.js | 7 +++---- tvapp2/eslint.config.mjs | 2 +- 5 files changed, 15 insertions(+), 13 deletions(-) diff --git a/tvapp2/classes/CLib.js b/tvapp2/classes/CLib.js index 280e50be..009d32c7 100644 --- a/tvapp2/classes/CLib.js +++ b/tvapp2/classes/CLib.js @@ -130,13 +130,13 @@ class CLib encodeToHexBase64( str ) { - const hex = [...str].map( char => + const hex = [...str].map( ( char ) => { - const code = char.charCodeAt(0).toString(16); - return code.padStart(2, '0'); - }).join(''); + const code = char.charCodeAt( 0 ).toString( 16 ); + return code.padStart( 2, '0' ); + }).join( '' ); - const base64 = btoa(hex); + const base64 = btoa( hex ); return base64; } @@ -152,10 +152,10 @@ class CLib decodeFromHexBase64( base64Str ) { - const hex = atob(base64Str); - const chars = hex.match(/.{1,2}/g); // every 2 hex chars = 1 byte + const hex = atob( base64Str ); + const chars = hex.match( /.{1,2}/g ); // every 2 hex chars = 1 byte - return chars.map(byte => String.fromCharCode(parseInt(byte, 16))).join(''); + return chars.map( ( byte ) => String.fromCharCode( parseInt( byte, 16 ) ) ).join( '' ); } } @@ -165,4 +165,5 @@ class CLib @usage import CLib from './classes/CLib.js'; */ +// eslint-disable-next-line no-restricted-syntax export default CLib; diff --git a/tvapp2/classes/Log.js b/tvapp2/classes/Log.js index d4dc5589..b802b0ed 100644 --- a/tvapp2/classes/Log.js +++ b/tvapp2/classes/Log.js @@ -117,4 +117,5 @@ class Log @usage import Log from './classes/Log.js'; */ +// eslint-disable-next-line no-restricted-syntax export default Log; diff --git a/tvapp2/classes/Semaphore.js b/tvapp2/classes/Semaphore.js index 89714551..c89fff3b 100644 --- a/tvapp2/classes/Semaphore.js +++ b/tvapp2/classes/Semaphore.js @@ -42,5 +42,6 @@ class Semaphore @usage import Log from './classes/Log.js'; */ +// eslint-disable-next-line no-restricted-syntax export default Semaphore; diff --git a/tvapp2/classes/Utils.js b/tvapp2/classes/Utils.js index 9b8130c7..f0e0def3 100644 --- a/tvapp2/classes/Utils.js +++ b/tvapp2/classes/Utils.js @@ -1,6 +1,5 @@ class Utils { - /* Returns the name of the function that this function was called from. used for Log.verbose @@ -8,7 +7,7 @@ class Utils static getFuncName() { - return (new Error()).stack.match(/at (\S+)/g)[1].slice(3); + return ( new Error() ).stack.match( /at (\S+)/g )[1].slice( 3 ); } /* @@ -18,7 +17,7 @@ class Utils static getConstructorName() { - return (new Error()).stack.match(/new\s+(\w+)/g)[0]; + return ( new Error() ).stack.match( /new\s+(\w+)/g )[0]; } /* @@ -42,7 +41,7 @@ class Utils } else return Boolean( str ); } - } +// eslint-disable-next-line no-restricted-syntax export default Utils; diff --git a/tvapp2/eslint.config.mjs b/tvapp2/eslint.config.mjs index 92db2ad7..c4073f13 100644 --- a/tvapp2/eslint.config.mjs +++ b/tvapp2/eslint.config.mjs @@ -223,7 +223,7 @@ export default '@stylistic/no-whitespace-before-property': ['error'], '@stylistic/object-curly-spacing': ['error', 'always'], '@stylistic/quote-props': ['error', 'as-needed'], - '@stylistic/quotes': ['error', 'single', { allowTemplateLiterals: true }], + '@stylistic/quotes': ['error', 'single', { allowTemplateLiterals: 'always' }], '@stylistic/semi': ['error', 'always'], '@stylistic/space-infix-ops': ['error'], '@stylistic/template-curly-spacing': ['error', 'always'],