Skip to content

Commit 59b1b59

Browse files
fix: lint issues
1 parent b38fc57 commit 59b1b59

File tree

10 files changed

+26
-23
lines changed

10 files changed

+26
-23
lines changed

examples/playground/global.d.ts

Lines changed: 0 additions & 5 deletions
This file was deleted.

examples/playground/src/components/JsonView.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import clsx from "clsx"
22

33
interface Props {
4+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
45
content: any
56
onClick?: () => void
67
}

examples/playground/src/components/map/amdb.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ const AmdbManager = memo(() => {
107107
layers.current
108108
.sort((a, b) => layerOrder[b.layerName] - layerOrder[a.layerName])
109109
.forEach(({ layer }) => layer.bringToFront())
110-
}, [data])
110+
}, [data, map])
111111

112112
return null
113113
})

examples/playground/src/components/map/index.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { useRecoilState, useRecoilValue } from "recoil"
88
import { appState } from "../../state/app"
99
import { userState } from "../../state/user"
1010
import "leaflet/dist/leaflet.css"
11-
import { getAmdbAPI } from "@navigraph/amdb"
1211
import { calculateChartBounds, getChartsAPI } from "@navigraph/charts"
1312
import { useQuery } from "@tanstack/react-query"
1413
import { TbCircleX } from "react-icons/tb"
@@ -61,7 +60,7 @@ const ChartOverlay = ({ charts }: { charts: ReturnType<typeof getChartsAPI> }) =
6160
if (bounds) {
6261
map.flyToBounds(bounds)
6362
}
64-
}, [bounds])
63+
}, [bounds, map])
6564

6665
const { data: urls } = useQuery({
6766
queryKey: ["chart-overlay-urls", chart],
@@ -95,12 +94,14 @@ function NavigraphTiles({ auth }: { auth: NavigraphAuth }) {
9594
const ngLayer = useRef(new NavigraphTileLayer(auth, preset))
9695

9796
useEffect(() => {
98-
ngLayer.current.addTo(map)
97+
const layer = ngLayer.current
98+
99+
layer.addTo(map)
99100

100101
return () => {
101-
ngLayer.current.removeFrom(map)
102+
layer.removeFrom(map)
102103
}
103-
}, [])
104+
}, [map])
104105

105106
useEffect(() => {
106107
ngLayer.current.setPreset(preset)

examples/playground/src/components/protectedPage.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ interface PropsStruct {
1515
[Scope.FMSDATA]: ReturnType<typeof getPackagesAPI>
1616
}
1717

18-
export function protectedPage<P extends {}, S extends Scope[]>(
18+
export function protectedPage<P extends object, S extends Scope[]>(
1919
Component: (
2020
props: P & { auth: NavigraphAuth; user: User } & Pick<PropsStruct, Extract<S[number], keyof PropsStruct>>,
2121
) => ReactNode,
@@ -44,6 +44,7 @@ export function protectedPage<P extends {}, S extends Scope[]>(
4444
amdb={amdb}
4545
charts={charts}
4646
fmsdata={fmsdata}
47+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
4748
{...(props as unknown as any)}
4849
/>
4950
)

examples/playground/src/hooks/useAppConfigLoader.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ export default function useAppConfigLoader() {
1919
initializeApp(config)
2020

2121
setApp({ config, auth: getAuth() })
22-
}, [])
22+
}, [app, setApp])
2323
}

examples/playground/src/hooks/useUserUpdater.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ export default function useUserUpdater() {
1212
const unsubscribe = app?.auth.onAuthStateChanged(u => setUser(u))
1313

1414
return () => unsubscribe?.()
15-
}, [app?.auth])
15+
}, [app?.auth, setUser])
1616
}

examples/playground/src/pages/Amdb.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function AmdbPage({ amdb }: { amdb: ReturnType<typeof getAmdbAPI> }) {
3333
if (airport) {
3434
setMapCenter({ latLng: new LatLng(airport?.coordinates.lat, airport?.coordinates.lon), options: { zoom: 12 } })
3535
}
36-
}, [airport])
36+
}, [airport, setMapCenter])
3737

3838
if (isLoading) {
3939
return <SpinningCircles />

examples/playground/src/pages/App.tsx

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ export default function App() {
2929
}
3030
}, [config])
3131

32-
const editConfig = useCallback(() => {
32+
const editConfig = useCallback(async () => {
3333
if (!window.confirm("This will Sign Out any current logins")) return
3434

35-
auth?.signOut()
35+
await auth?.signOut()
3636

3737
localStorage.removeItem("NG_CONFIG")
3838

@@ -56,7 +56,7 @@ export default function App() {
5656
setApp({ config, auth: getAuth() })
5757

5858
setEditUnlocked(false)
59-
}, [clientId, clientSecret, scopes])
59+
}, [clientId, clientSecret, scopes, domain, setApp])
6060

6161
return (
6262
<div className="page-container flex flex-col items-center gap-3">
@@ -92,10 +92,11 @@ export default function App() {
9292
value={scope}
9393
checked={scopes?.includes(scope)}
9494
onChange={e => {
95-
if (scopes?.includes(e.target.value as Scope)) {
96-
setScopes(scopes.filter(scope => scope !== e.target.value))
95+
const value = e.target.value as Scope
96+
if (scopes?.includes(value)) {
97+
setScopes(scopes.filter(scope => scope !== value))
9798
} else {
98-
setScopes([e.target.value as Scope, ...scopes])
99+
setScopes([value, ...scopes])
99100
}
100101
}}
101102
/>

examples/playground/src/pages/Auth.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,13 @@ export default function Auth() {
2222
setParams(params)
2323
setError(null)
2424
})
25-
.catch(err => setError(err))
25+
.catch(err => {
26+
if (err instanceof Error) {
27+
setError(err)
28+
}
29+
})
2630
.finally(() => setParams(null))
27-
}, [app?.auth])
31+
}, [app?.auth, setParams])
2832

2933
if (!app) redirect("/")
3034

0 commit comments

Comments
 (0)