Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
- name: Setup Biome CLI
uses: biomejs/setup-biome@v2
with:
version: 2.4.9
version: latest

- name: Run Biome
run: biome ci --error-on-warnings .
Expand Down
4 changes: 2 additions & 2 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/2.4.9/schema.json",
"$schema": "https://biomejs.dev/schemas/2.5.7/schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
Expand Down Expand Up @@ -35,7 +35,7 @@
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"preset": "recommended",
"suspicious": {
"noUnknownAtRules": "off"
}
Expand Down
4 changes: 2 additions & 2 deletions scripts/backfill-review-request-requested-at.ts
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ async function fetchReviewRequestsWithEvents(
const latestEventByReviewer = new Map<string, string>(); // reviewerId -> createdAt
for (const event of events) {
const reviewer = event.requestedReviewer;
if (!reviewer || reviewer.__typename !== "User") {
if (reviewer?.__typename !== "User") {
continue;
}
const existing = latestEventByReviewer.get(reviewer.id);
Expand All @@ -275,7 +275,7 @@ async function fetchReviewRequestsWithEvents(

for (const node of reviewRequestNodes) {
const reviewer = node.requestedReviewer;
if (!reviewer || reviewer.__typename !== "User") {
if (reviewer?.__typename !== "User") {
continue;
}
const createdAt = latestEventByReviewer.get(reviewer.id) ?? null;
Expand Down
2 changes: 1 addition & 1 deletion src/app/api/activity/[id]/project-fields/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ function sanitizePayloadValue(key: ProjectFieldKey, raw: unknown) {

async function resolveIssueItem(id: string) {
const detail = await getActivityItemDetail(id);
if (!detail || detail.item.type !== "issue") {
if (detail?.item.type !== "issue") {
return null;
}
return detail;
Expand Down
2 changes: 1 addition & 1 deletion src/app/api/activity/[id]/status/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function isIssueProjectStatus(value: unknown): value is IssueProjectStatus {
async function resolveIssueItem(id: string) {
await ensureSchema();
const detail = await getActivityItemDetail(id);
if (!detail || detail.item.type !== "issue") {
if (detail?.item.type !== "issue") {
return null;
}
return detail;
Expand Down
10 changes: 6 additions & 4 deletions src/lib/dashboard/analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,18 @@ export async function getDashboardAnalytics(
const timeZone = userTimeSettings.timezone;
const dateTimeFormat = userTimeSettings.dateTimeFormat;
const weekStart: WeekStart = userTimeSettings.weekStart;
const rawExcludedUserIds = config?.excluded_user_ids;
const excludedUserIds = new Set<string>(
Array.isArray(config?.excluded_user_ids)
? (config?.excluded_user_ids as string[]).filter(
Array.isArray(rawExcludedUserIds)
? (rawExcludedUserIds as string[]).filter(
(id) => typeof id === "string" && id.trim().length > 0,
)
: [],
);
const rawExcludedRepositoryIds = config?.excluded_repository_ids;
const excludedRepositoryIds = new Set<string>(
Array.isArray(config?.excluded_repository_ids)
? (config?.excluded_repository_ids as string[]).filter(
Array.isArray(rawExcludedRepositoryIds)
? (rawExcludedRepositoryIds as string[]).filter(
(id) => typeof id === "string" && id.trim().length > 0,
)
: [],
Expand Down
10 changes: 6 additions & 4 deletions src/lib/dashboard/attention.ts
Original file line number Diff line number Diff line change
Expand Up @@ -257,16 +257,18 @@ export async function getAttentionInsights(options?: {
const organizationHolidaySet = await loadCombinedHolidaySet(
organizationHolidayCodes,
);
const rawExcludedUserIds = config?.excluded_user_ids;
const excludedUserIds = new Set<string>(
Array.isArray(config?.excluded_user_ids)
? (config?.excluded_user_ids as string[]).filter(
Array.isArray(rawExcludedUserIds)
? (rawExcludedUserIds as string[]).filter(
(id) => typeof id === "string" && id.trim().length > 0,
)
: [],
);
const rawExcludedRepositoryIds = config?.excluded_repository_ids;
const excludedRepositoryIds = new Set<string>(
Array.isArray(config?.excluded_repository_ids)
? (config?.excluded_repository_ids as string[]).filter(
Array.isArray(rawExcludedRepositoryIds)
? (rawExcludedRepositoryIds as string[]).filter(
(id) => typeof id === "string" && id.trim().length > 0,
)
: [],
Expand Down
2 changes: 1 addition & 1 deletion src/lib/db/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ let ensurePromise: Promise<void> | null = null;

function isPublicSchemaPermissionError(error: unknown) {
const dbError = error as DatabaseError | null;
if (!dbError || dbError.code !== "42501") {
if (dbError?.code !== "42501") {
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib/github/collectors/issues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ async function fetchDiscussionCommentRepliesConnection(
},
);
const node = data.node;
if (!node || node.__typename !== "DiscussionComment") {
if (node?.__typename !== "DiscussionComment") {
return null;
}
return node.replies ?? null;
Expand Down
2 changes: 1 addition & 1 deletion src/lib/github/collectors/pull-requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ async function syncReviewRequestsSnapshot(

const latestEventByReviewer = new Map<string, string>(); // reviewerId -> createdAt
for (const node of events) {
if (!node || node.__typename !== "ReviewRequestedEvent") {
if (node?.__typename !== "ReviewRequestedEvent") {
continue;
}
const reviewer = node.requestedReviewer;
Expand Down
Loading