Enable astro/tsconfigs/strictest in the shared package (#2836)

This commit is contained in:
Paweł Kuna
2026-08-08 01:27:03 +02:00
committed by GitHub
parent 16e1403bc8
commit e520b327c1
57 changed files with 147 additions and 116 deletions
+4 -3
View File
@@ -3,6 +3,7 @@ import Avatar from '@ui/Avatar.astro'
import CardTitle from '@ui/CardTitle.astro'
import people from '@data/people.json'
import { randomNumber, timeagoLabel } from '@shared/lib/pseudo-random'
import { requireIndex } from '@shared/lib/array'
interface Person {
full_name?: string
@@ -19,12 +20,12 @@ interface Props {
const { limit = 10, offset = 0, title = 'Top users', class: className } = Astro.props
const colors = 'green,red,yellow,x,x'.split(',')
const statusLabels: Record<string, string> = { green: 'Online', red: 'Busy', yellow: 'Away', x: 'Offline' }
const colors = ['green', 'red', 'yellow', 'x', 'x'] as const
const statusLabels: Record<(typeof colors)[number], string> = { green: 'Online', red: 'Busy', yellow: 'Away', x: 'Offline' }
const rows = (people as Person[]).slice(offset, offset + limit).map((person, idx) => {
const index = idx + 1 // forloop.index (1-based)
const status = colors[randomNumber(index + 5, 0, colors.length - 1)]
const status = requireIndex(colors, randomNumber(index + 5, 0, colors.length - 1))
return {
person,
status: status !== 'x' ? status : 'secondary',