1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-06-28 15:27:43 +00:00

eslint: modules/chat/emotes

* swap let for const in a few places
* convert processEmotes() to static method & update callsites
This commit is contained in:
lemonslut 2025-06-07 17:00:42 -06:00
parent a514c143fa
commit 528f5882d6
No known key found for this signature in database

View file

@ -81,10 +81,9 @@ function appearLeaveToKeyframes(source, multi = 1, offset = 0, has_var = false)
for(const line of source) { for(const line of source) {
const pct = (line[0] * multi) + offset; const pct = (line[0] * multi) + offset;
const vr = has_var ? `var(--ffz-effect-transforms) ` : '';
let vr, tx, scale, ty; const tx = line[1] === 0 ? '' : `translateX(${line[1]}px) `;
vr = has_var ? `var(--ffz-effect-transforms) ` : ''; let scale, ty;
tx = line[1] === 0 ? '' : `translateX(${line[1]}px) `;
if ( line.length === 4 ) { if ( line.length === 4 ) {
scale = `scale(${line[2]})`; scale = `scale(${line[2]})`;
@ -1168,7 +1167,8 @@ export default class Emotes extends Module {
if ( ! this.parent.context.get('chat.effects.enable') ) if ( ! this.parent.context.get('chat.effects.enable') )
return null; return null;
let filter, transformOrigin, transform, animation, animations = []; const animations = [];
let filter, transformOrigin, transform, animation;
for(const input of this.activeEffectStyles) { for(const input of this.activeEffectStyles) {
if ( (flags & input.flags) !== input.flags ) if ( (flags & input.flags) !== input.flags )
@ -2184,7 +2184,7 @@ export default class Emotes extends Module {
} }
processEmote(emote, set_id) { static processEmote(emote, set_id) {
if ( ! emote.id || ! emote.name || ! emote.urls ) if ( ! emote.id || ! emote.name || ! emote.urls )
return null; return null;
@ -2269,7 +2269,7 @@ export default class Emotes extends Module {
if ( ! set ) if ( ! set )
throw new Error(`Invalid emote set "${set_id}"`); throw new Error(`Invalid emote set "${set_id}"`);
const processed = this.processEmote(emote, set_id); const processed = this.constructor.processEmote(emote, set_id);
if ( ! processed ) if ( ! processed )
throw new Error('Invalid emote data object.'); throw new Error('Invalid emote data object.');
@ -2456,7 +2456,7 @@ export default class Emotes extends Module {
const bad_emotes = []; const bad_emotes = [];
for(const emote of ems) { for(const emote of ems) {
const processed = this.processEmote(emote, set_id); const processed = this.constructor.processEmote(emote, set_id);
if ( ! processed ) { if ( ! processed ) {
bad_emotes.push(emote); bad_emotes.push(emote);
continue; continue;