Skip to content

Commit

Permalink
fix: lint error
Browse files Browse the repository at this point in the history
  • Loading branch information
drakang4 committed Jan 15, 2025
1 parent d57fb5b commit 4887e37
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion packages/fetcher/src/safe-parse-json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default async function safeParseJson(
try {
const json = await response.json()
return json
} catch (error) {
} catch {
return undefined
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ async function importReactIntersectionObserver() {
}

return import('@titicaca/react-intersection-observer')
} catch (e) {
} catch {
return Promise.resolve(
(({ children }) =>
children || null) as FC<ReactIntersectionObserverProps>,
Expand Down
8 changes: 4 additions & 4 deletions packages/react-hooks/src/use-local-storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function trigger(key: string) {
function getSnapshot(key: string, initialValue: string | undefined) {
try {
return localStorage.getItem(key) ?? initialValue ?? null
} catch (error) {
} catch {
inMemoryStorage.set(key, initialValue ?? null)
return initialValue ?? null
}
Expand Down Expand Up @@ -55,7 +55,7 @@ export function useLocalStorage(
(value: string) => {
try {
localStorage.setItem(key, value)
} catch (error) {
} catch {
inMemoryStorage.set(key, value)
}

Expand All @@ -67,7 +67,7 @@ export function useLocalStorage(
const remove = useCallback(() => {
try {
localStorage.removeItem(key)
} catch (error) {
} catch {
inMemoryStorage.delete(key)
}

Expand All @@ -83,7 +83,7 @@ export function useLocalStorage(
if (localStorage.getItem(key) === null) {
localStorage.setItem(key, initialValue)
}
} catch (error) {
} catch {
if (inMemoryStorage.get(key) === undefined) {
inMemoryStorage.set(key, initialValue)
}
Expand Down
8 changes: 4 additions & 4 deletions packages/react-hooks/src/use-session-storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function trigger(key: string) {
function getSnapshot(key: string, initialValue: string | undefined) {
try {
return sessionStorage.getItem(key) ?? initialValue ?? null
} catch (error) {
} catch {
inMemoryStorage.set(key, initialValue ?? null)
return initialValue ?? null
}
Expand Down Expand Up @@ -55,7 +55,7 @@ export function useSessionStorage(
(value: string) => {
try {
sessionStorage.setItem(key, value)
} catch (error) {
} catch {
inMemoryStorage.set(key, value)
}

Expand All @@ -67,7 +67,7 @@ export function useSessionStorage(
const remove = useCallback(() => {
try {
sessionStorage.removeItem(key)
} catch (error) {
} catch {
inMemoryStorage.delete(key)
}

Expand All @@ -83,7 +83,7 @@ export function useSessionStorage(
if (sessionStorage.getItem(key) === null) {
sessionStorage.setItem(key, initialValue)
}
} catch (error) {
} catch {
if (inMemoryStorage.get(key) === undefined) {
inMemoryStorage.set(key, initialValue)
}
Expand Down
2 changes: 1 addition & 1 deletion packages/tds-widget/src/chat/utils/image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export function getProfileImageUrl(user: UserInterface) {
let imageNumber = 0
try {
imageNumber = parseInt(user.id.substr(0, 4), 16) % 5
} catch (e) {
} catch {
imageNumber = 0
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ export function getFirebaseAnalytics() {
const analytics = getAnalytics(app)

return analytics
} catch (error) {}
} catch {}
}
3 changes: 1 addition & 2 deletions packages/view-utilities/src/strict-query/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ function normalizeToBoolean(query: RawQuery) {
)
}

// eslint-disable-next-line @typescript-eslint/ban-types
class StrictQuery<Resolved = {}> {
class StrictQuery<Resolved = object> {
private raw: { [key: string]: RawQuery }

private resolved: Resolved
Expand Down

0 comments on commit 4887e37

Please sign in to comment.