File .deepsource.toml
not found in the default branch of the repository root. Please refer to the docs.
Boolean(cursor)
instead.123 </ul>
124 </Paper>
125
126 {!activityItems && !!cursor && (127 <div className="loadMoreSpinner">
128 <LoadingSpinner />.
129 </div>
Boolean(currentMetric)
instead.194 }}
195 options={false}
196 />
197 {!!currentMetric && (198 <MetricDetails
199 metric={currentMetric}
200 onclose={() => setCurrentMetric(null)}
Boolean(metric.event_type)
instead.111 {metric.metric_type === "stateful" && (
112 <p>
113 <b className="mr-2">Event Type:</b>
114 {!!metric.event_type ? <Tag>{metric.event_type}</Tag> : "N/A"}115 </p>
116 )}
117 </div>
Boolean(metric.billable_aggregation_type)
instead.101 {metric.metric_type === "rate" && (
102 <p>
103 <b className="mr-2">Aggregation Type:</b>
104 {!!metric.billable_aggregation_type ? (105 <Tag>{metric.billable_aggregation_type}</Tag>
106 ) : (
107 "N/A"
Boolean(cursor)
instead. 99 className="hover:bg-background"
100 style={{ background: "#ffffff" }}
101 >
102 {!data && !!cursor && (103 <div className="loadMoreSpinner">
104 <LoadingSpinner />.
105 </div>
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);