Skip to content

Commit

Permalink
fix: eslint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
not-ani committed Aug 5, 2024
1 parent 6c3105f commit b8f1793
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions apps/website/src/lib/hooks/use-outside-click.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
/** eslint-disable @typescript-eslint/ban-ts-comment */
//@ts-nocheck
/** eslint-disable @typescript-eslint/no-unsafe-call */
/** eslint-disable @typescript-eslint/no-explicit-any */
/** eslint-disable @typescript-eslint/no-unsafe-member-access */
/** eslint-disable @typescript-eslint/no-explicit-any */
/** eslint-disable @typescript-eslint/ban-types */
import type React from "react";
import { useEffect } from "react";
import { RefObject, useEffect } from "react";

Check warning on line 1 in apps/website/src/lib/hooks/use-outside-click.tsx

View workflow job for this annotation

GitHub Actions / lint

Imports "RefObject" are only used as type

export const useOutsideClick = (
ref: React.RefObject<HTMLDivElement>,
callback: Function,
ref: RefObject<HTMLDivElement>,
callback: (event: MouseEvent | TouchEvent) => void,
) => {
useEffect(() => {
const listener = (event: any) => {
if (!ref.current || ref.current.contains(event.target)) {
const listener = (event: MouseEvent | TouchEvent) => {
if (!(event instanceof MouseEvent) && !(event instanceof TouchEvent)) {
return;
}
if (!ref.current || ref.current.contains(event.target as Node)) {
return;
}
callback(event);
Expand Down

0 comments on commit b8f1793

Please sign in to comment.