mirror of
https://github.com/TheBinaryNinja/tvapp2.git
synced 2026-06-04 02:55:41 -04:00
refactor: update eslint corrections
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -117,4 +117,5 @@ class Log
|
||||
@usage import Log from './classes/Log.js';
|
||||
*/
|
||||
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
export default Log;
|
||||
|
||||
@@ -42,5 +42,6 @@ class Semaphore
|
||||
@usage import Log from './classes/Log.js';
|
||||
*/
|
||||
|
||||
// eslint-disable-next-line no-restricted-syntax
|
||||
export default Semaphore;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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'],
|
||||
|
||||
Reference in New Issue
Block a user