chore: enforce brackets for if clause and for/while loops
This commit is contained in:
@@ -18,7 +18,9 @@ export function smoothScroll(node: HTMLAnchorElement) {
|
||||
event.preventDefault();
|
||||
|
||||
const hash = node.getAttribute('href');
|
||||
if (!hash || hash === '#') return;
|
||||
if (!hash || hash === '#') {
|
||||
return;
|
||||
}
|
||||
|
||||
const targetElement = document.querySelector(hash);
|
||||
|
||||
|
||||
@@ -35,7 +35,9 @@ export function throttle<T extends (...args: any[]) => any>(
|
||||
fn(...args);
|
||||
} else {
|
||||
// Schedule for end of wait period (trailing edge)
|
||||
if (timeoutId) clearTimeout(timeoutId);
|
||||
if (timeoutId) {
|
||||
clearTimeout(timeoutId);
|
||||
}
|
||||
timeoutId = setTimeout(() => {
|
||||
lastCall = Date.now();
|
||||
fn(...args);
|
||||
|
||||
Reference in New Issue
Block a user