ConditionalReactQueryDevtool
8 { ssr: false }
9)
10
11export const ConditionalReactQueryDevtool = () => {12 const { data: session, status: authStatus } = useSession()
13 const isLoggedIn = !!session && authStatus === 'authenticated'
14 // don't do anything on server or if we're in prod
MyApp
58 )
59}
60
61const MyApp = (appProps: AppPropsWithGridSwitch) => { 62 const {
63 pageProps: { session },
64 } = appProps
PageContent
46 appEvent.webVitals(stats)
47}
48
49const PageContent = ({ Component, pageProps }: AppPropsWithGridSwitch) => { 50 const router = useRouter()
51 const autoResetState = Component.autoResetState ? { key: router.asPath } : {}
52 return Component.omitGrid ? (
reportWebVitals
42 ],
43} satisfies DefaultSeoProps
44
45export function reportWebVitals(stats: NextWebVitalsMetric) { 46 appEvent.webVitals(stats)
47}
48
areWeStillLoading
66 }
67 }
68
69 const areWeStillLoading = () => { 70 if (loading || status === 'loading') {
71 return true
72 }
It is recommended to have documentation comments above, or right inside a function/class declaration. This helps developers, users and even the author understand the purpose of a code snippet or API function in the future.
NOTE: If you want to stop this issue from getting raised on certain constructs (arrow functions, class expressions, methods etc.), consider using the skipdoccoverage option under the analyzers.meta
property in your .deepsource.toml
file.
For example, the following configuration will silence this issue for class expressions and method definitions:
[analyzers.meta]
skip_doc_coverage = ["class-expression", "method-definition"]
function sum(a, b) {
return a + b;
}
/**
* Function to add two numbers
* @param a The first number to add
* @param b The second number to add
* @returns The sum of two numbers
*/
function sum(a, b) {
return a + b;
}