Skip to content

Commit

Permalink
fix: Lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
usame-algan committed May 30, 2024
1 parent 3810194 commit 15a1b54
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 10 deletions.
1 change: 1 addition & 0 deletions next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
/// <reference types="next/navigation-types/compat/navigation" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
2 changes: 1 addition & 1 deletion src/components/common/BuyCryptoButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const useOnrampAppUrl = (): string | undefined => {

const useBuyCryptoHref = (): LinkProps['href'] | undefined => {
const query = useSearchParams()
const safe = query.get('safe')
const safe = query?.get('safe')
const appUrl = useOnrampAppUrl()

return useMemo(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/common/SafeTokenWidget/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const SafeTokenWidget = () => {

const url = {
pathname: AppRoutes.apps.open,
query: { safe: query.get('safe'), appUrl: GOVERNANCE_APP_URL },
query: { safe: query?.get('safe'), appUrl: GOVERNANCE_APP_URL },
}

const canRedeemSep5 = canRedeemSep5Airdrop(allocationData)
Expand Down
2 changes: 1 addition & 1 deletion src/components/tx-flow/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const TxModalProvider = ({ children }: { children: ReactNode }): ReactEle
const safeId = useChainId() + useSafeAddress()
const prevSafeId = useRef<string>(safeId ?? '')
const pathname = usePathname()
const prevPathname = useRef<string>(pathname)
const prevPathname = useRef<string | null>(pathname)

const handleModalClose = useCallback(() => {
if (shouldWarn.current && !confirmClose()) {
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useIsSidebarRoute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const TOGGLE_SIDEBAR_ROUTES = [AppRoutes.apps.open]
*/
export function useIsSidebarRoute(pathname?: string): [boolean, boolean] {
const clientPathname = usePathname()
const route = pathname || clientPathname
const route = pathname || clientPathname || ''
const noSidebar = NO_SIDEBAR_ROUTES.includes(route)
const toggledSidebar = TOGGLE_SIDEBAR_ROUTES.includes(route)
const router = useRouter()
Expand Down
36 changes: 30 additions & 6 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
{
"compilerOptions": {
"target": "es2020",
"lib": ["dom", "dom.iterable", "esnext"],
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
Expand All @@ -16,11 +20,31 @@
"incremental": true,
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"],
"@/public/*": ["./public/*"]
"@/*": [
"./src/*"
],
"@/public/*": [
"./public/*"
]
},
"plugins": [{ "name": "typescript-plugin-css-modules" }]
"plugins": [
{
"name": "typescript-plugin-css-modules"
},
{
"name": "next"
}
]
},
"include": ["next-env.d.ts", "src/definitions.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules", "src/types/contracts"]
"include": [
"next-env.d.ts",
"src/definitions.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts"
],
"exclude": [
"node_modules",
"src/types/contracts"
]
}

0 comments on commit 15a1b54

Please sign in to comment.