Skip to content

fix: resolve biome-ignore lint suppressions#2028

Open
johnib wants to merge 4 commits intoopenstatusHQ:mainfrom
johnib:fix/biome-ignore-826
Open

fix: resolve biome-ignore lint suppressions#2028
johnib wants to merge 4 commits intoopenstatusHQ:mainfrom
johnib:fix/biome-ignore-826

Conversation

@johnib
Copy link
Copy Markdown
Contributor

@johnib johnib commented Mar 28, 2026

Hey! This PR tackles the long-standing biome-ignore cleanup from #826.

What changed

I went through all ~80 biome-ignore comments in the codebase and fixed the ones where the underlying code could genuinely be improved:

  • Accumulating spread in reduce — Replaced the reduce+spread pattern with Object.fromEntries in the monitor/check route files. Besides satisfying the linter, this is actually faster (O(n) vs O(n²))
  • Node imports — Added node: prefix to crypto imports, which is the modern convention
  • Assignments in expressions — Extracted a couple of inline assignments for readability
  • Untyped test mocks — Gave proper types to fetchMock and a few other any uses
  • Dead suppression comments — Removed noForEach ignores that were redundant since the rule is already turned off globally
  • Misc — Unused variable cleanup, class sorting

About half the comments (~42) are legitimately needed — things like React hook deps that are intentionally omitted, dangerouslySetInnerHTML for JSON-LD, and tRPC generics that genuinely need any. I left those alone.

Closes #826

johnib added 2 commits March 28, 2026 01:30
- Replace `import crypto from "crypto"` with `node:crypto` protocol (2 files)
- Replace O(n^2) accumulating spread reduces with Object.fromEntries (11 files)
- Fix noAssignInExpressions with for-of loops and if-assign patterns (2 files)
- Type test fetch mocks as ReturnType<typeof spyOn> instead of any (12 test files)
- Replace `any` with `unknown`/proper types in data-table, slack, notification, theme-sidebar, server index (6 files)
- Remove redundant noForEach comments since rule is globally disabled (3 files)
- Remove unused stringToArrayProcess function, prefix unused params with _ (3 files)
- Fix parameter reassignment in domain.ts with local variable (1 file)
- Fix useSortedClasses by simplifying template literal (1 file)
…n.ts

Cast to readonly string[] only at the .includes() call site instead of
widening the variable type, keeping compile-time literal type safety.
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 28, 2026

@johnib is attempting to deploy a commit to the OpenStatus Team on Vercel.

A member of the Team first needs to authorize it.

Copy link
Copy Markdown

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 41 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="apps/status-page/src/lib/domain.ts">

<violation number="1" location="apps/status-page/src/lib/domain.ts:14">
P1: Double-escaped backslashes in this regex literal cause the IP-address branch to silently never match. `\\.` in a regex literal matches a literal backslash followed by any character, not a literal dot. Similarly, `\\d` matches a literal `\d` rather than a digit class. As a result, hosts like `127.0.0.1` or `192.168.1.1` pass through and may be incorrectly treated as subdomains. Use single backslashes (`\.` and `\d`) inside the regex literal.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

johnib and others added 2 commits March 28, 2026 14:29
The regex literal used double-escaped backslashes (e.g. `\\.` and `\\d`)
which match literal backslash sequences instead of dots and digits,
causing IP addresses like 192.168.1.1 to slip through as subdomains.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix biome-ignore

1 participant