chore: enforce brackets for if clause and for/while loops
This commit is contained in:
@@ -35,7 +35,9 @@ const displayChar = $derived(char === ' ' ? '\u00A0' : char);
|
||||
const targetFont = $derived(isPast ? fontA?.name ?? '' : fontB?.name ?? '');
|
||||
|
||||
$effect(() => {
|
||||
if (!targetFont || slotFonts[slot] === targetFont) return;
|
||||
if (!targetFont || slotFonts[slot] === targetFont) {
|
||||
return;
|
||||
}
|
||||
const next = slot === 0 ? 1 : 0;
|
||||
slotFonts[next] = targetFont;
|
||||
slot = next;
|
||||
|
||||
@@ -65,7 +65,9 @@ const sliderSpring = new Spring(50, {
|
||||
const sliderPos = $derived(sliderSpring.current);
|
||||
|
||||
function handleMove(e: PointerEvent) {
|
||||
if (!isDragging || !container) return;
|
||||
if (!isDragging || !container) {
|
||||
return;
|
||||
}
|
||||
const rect = container.getBoundingClientRect();
|
||||
const x = Math.max(0, Math.min(e.clientX - rect.left, rect.width));
|
||||
const percentage = (x / rect.width) * 100;
|
||||
@@ -87,7 +89,9 @@ $effect(() => {
|
||||
});
|
||||
|
||||
$effect(() => {
|
||||
if (!responsive) return;
|
||||
if (!responsive) {
|
||||
return;
|
||||
}
|
||||
switch (true) {
|
||||
case responsive.isMobile:
|
||||
typography.multiplier = 0.5;
|
||||
@@ -143,7 +147,9 @@ $effect(() => {
|
||||
});
|
||||
|
||||
$effect(() => {
|
||||
if (typeof window === 'undefined') return;
|
||||
if (typeof window === 'undefined') {
|
||||
return;
|
||||
}
|
||||
const handleResize = () => {
|
||||
if (container && fontA && fontB) {
|
||||
const width = container.offsetWidth;
|
||||
|
||||
Reference in New Issue
Block a user