Boolean(slug)
instead 56 select: (serviceInfoResult) => serviceInfoResult.length !== 0,
57 }
58 )
59 const { data: alertData } = api.organization.getAlerts.useQuery({ slug }, { enabled: !!slug }) 60 const hasAlerts = Array.isArray(alertData) && alertData.length > 0
61 const { ref, width } = useElementSize()
62 const { searchState } = useSearchState()
Boolean(data?.id)
instead 52 const { data: hasRemote } = api.service.forServiceInfoCard.useQuery(
53 { parentId: data?.id ?? '', remoteOnly: true },
54 {
55 enabled: !!data?.id && data?.locations?.length > 1, 56 select: (serviceInfoResult) => serviceInfoResult.length !== 0,
57 }
58 )
Boolean(process.env.SENTRY_DEBUG)
instead13Sentry.init({
14 dsn: 'https://[email protected]/6751163',
15 enabled: isVercel,
16 debug: !!process.env.SENTRY_DEBUG,17 // Tracing rates
18 tracesSampleRate: 0.5,
19 profilesSampleRate: 0.5,
Boolean(process.env.SENTRY_DEBUG)
instead15 tracesSampleRate: 0.5,
16
17 // Setting this option to true will print useful information to the console while you're setting up Sentry.
18 debug: !!process.env.SENTRY_DEBUG,19})
Boolean(process.env.SENTRY_DEBUG)
instead16 enabled: isVercel,
17
18 // Setting this option to true will print useful information to the console while you're setting up Sentry.
19 debug: !!process.env.SENTRY_DEBUG,20
21 // Set sample rates
22 replaysOnErrorSampleRate: 1.0,
Prefer using explicit casts by calling Number
, Boolean
, or String
over using operators like +
, !!
or "" +
.
This is considered best practice as it improves readability.
const b = !!foo;
// The `+` operator does not change the value of its operand
// unless it's already a number.
let n = +foo;
n = 1 * foo;
const s = "" + foo;
const b = Boolean(foo);
const n = Number(foo);
const s = String(foo);