Skip to content

Commit

Permalink
Type corrections
Browse files Browse the repository at this point in the history
I have a language server now.
  • Loading branch information
jb3 committed Sep 11, 2024
1 parent 444892c commit f0d2516
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions thallium-frontend/src/utils/hooks.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useMemo, useState, useEffect } from "react";
import { useState, useEffect } from "react";
import { type RefObject } from "react";

export function useVisible(ref: RefObject<HTMLElement>) {
const [isVisible, setVisible] = useState(false)

Check failure on line 5 in thallium-frontend/src/utils/hooks.ts

View workflow job for this annotation

GitHub Actions / lint-frontend / lint

Missing semicolon
Expand All @@ -7,7 +8,8 @@ export function useVisible(ref: RefObject<HTMLElement>) {
const observer = new IntersectionObserver(
([entry]) => setVisible(entry.isIntersecting)

Check failure on line 9 in thallium-frontend/src/utils/hooks.ts

View workflow job for this annotation

GitHub Actions / lint-frontend / lint

Returning a void expression from an arrow function shorthand is forbidden. Please add braces to the arrow function
)

Check failure on line 10 in thallium-frontend/src/utils/hooks.ts

View workflow job for this annotation

GitHub Actions / lint-frontend / lint

Missing semicolon
observer.observe(ref.current)
if (ref.current)
observer.observe(ref.current)

Check failure on line 12 in thallium-frontend/src/utils/hooks.ts

View workflow job for this annotation

GitHub Actions / lint-frontend / lint

Missing semicolon
return () => observer.disconnect()

Check failure on line 13 in thallium-frontend/src/utils/hooks.ts

View workflow job for this annotation

GitHub Actions / lint-frontend / lint

Returning a void expression from an arrow function shorthand is forbidden. Please add braces to the arrow function
}, [])

Check warning on line 14 in thallium-frontend/src/utils/hooks.ts

View workflow job for this annotation

GitHub Actions / lint-frontend / lint

React Hook useEffect has a missing dependency: 'ref'. Either include it or remove the dependency array

Expand Down

0 comments on commit f0d2516

Please sign in to comment.