Skip to content

style(web): sort imports in error-toast.ts to unblock the Biome check - #1666

Merged
MODSetter merged 1 commit into
MODSetter:devfrom
Yigtwxx:fix/web-organize-imports-error-toast
Aug 7, 2026
Merged

style(web): sort imports in error-toast.ts to unblock the Biome check#1666
MODSetter merged 1 commit into
MODSetter:devfrom
Yigtwxx:fix/web-organize-imports-error-toast

Conversation

@Yigtwxx

@Yigtwxx Yigtwxx commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Frontend Quality — and with it the Quality Gate aggregator — currently fails on every pull request opened against dev, including ones that change no TypeScript at all. This is the one unsorted import causing it.

Description

surfsense_web/lib/error-toast.ts imports ./error before ./env-config, which Biome's assist/source/organizeImports reports as an error. The fix is Biome's own suggested safe fix, applied verbatim — two import lines swapped, nothing else in the file touched.

Why one import breaks unrelated pull requests. The hook is declared in .pre-commit-config.yaml:

- id: biome-check-web
  entry: bash -c 'cd surfsense_web && npx @biomejs/biome@2.4.6 check --diagnostic-level=error .'
  files: ^surfsense_web/
  pass_filenames: false
  always_run: true

always_run: true makes pre-commit run the hook whatever the changed-file set is, so the files: filter never gets to exclude it, and pass_filenames: false plus the trailing . means the entry checks the whole surfsense_web tree rather than the changed files. The --from-ref/--to-ref invocation in .github/workflows/code-quality.yml therefore narrows nothing for this hook: any pull request, on any path, is measured against every file in surfsense_web.

That is why the job is red on PRs that touch only documentation, and why it is red on merged PRs too — #1663 carries the same Frontend Quality and Quality Gate failures. dev's own Code Quality runs have been failing since late July.

I am reporting the hook behaviour, not changing it. Whether always_run is intentional (a deliberate "always check the whole app" policy) or an oversight is a maintainer's call, and either way this file has to be sorted first.

Motivation and Context

No linked issue. Found while opening #1665, a documentation-only PR that came back red on a TypeScript check.

Screenshots

Not applicable — no UI change. The file's runtime behaviour is unchanged; only the order of two import statements differs.

API Changes

  • This PR includes API changes

Change Type

  • Bug fix
  • New feature
  • Performance improvement
  • Refactoring
  • Documentation
  • Dependency/Build system
  • Breaking change
  • Other (specify):

Marked as a bug fix because the effect is on CI rather than on the file itself; the edit is pure formatting.

Testing Performed

  • Tested locally

npx @biomejs/biome@2.4.6 check --diagnostic-level=error lib/error-toast.ts from surfsense_web:

before after
lib/error-toast.ts Found 1 errorassist/source/organizeImports Checked 1 file. No fixes applied.

The failing run this PR addresses is the Frontend Quality job on #1665, whose log reports exactly one diagnostic across the tree: Checked 1055 files in 1479ms. Found 1 error. — this file. So the tree is clean once this lands, rather than this being the first of many.

Runtime behaviour is untested because there is none to test: reordering two side-effect-free ES module imports of local modules cannot change evaluation order in a way this file observes, and no other file changed.

Checklist

  • Follows project coding standards and conventions
  • Documentation updated as needed
  • Dependencies updated as needed
  • No lint/build errors or new warnings
  • All relevant tests are passing

High-level PR Summary

This PR fixes a failing CI check by reordering two import statements in error-toast.ts to comply with Biome's import sorting rules. The file was causing the Frontend Quality check to fail on all pull requests (including unrelated ones) because the pre-commit hook runs Biome against the entire surfsense_web directory regardless of which files were changed. The fix simply swaps the position of two imports so that ./env-config comes before ./error, which is Biome's expected alphabetical order.

⏱️ Estimated Review Time: 5-15 minutes

💡 Review Order Suggestion
Order File Path
1 surfsense_web/lib/error-toast.ts

Need help? Join our Discord

The biome-check-web hook is declared with always_run: true and
pass_filenames: false, so it checks all of surfsense_web on every run
regardless of which files a change touches. One unsorted import in
lib/error-toast.ts therefore fails Frontend Quality, and with it the
Quality Gate aggregator, on every pull request against dev.

Applies Biome's own safe fix and nothing else.
@vercel

vercel Bot commented Aug 6, 2026

Copy link
Copy Markdown

@Yigtwxx is attempting to deploy a commit to the Rohan Verma's projects Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f2316ee5-d015-490c-b5f9-9e89b3f114fd

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@MODSetter
MODSetter merged commit 1e4c572 into MODSetter:dev Aug 7, 2026
6 of 9 checks passed
@Yigtwxx
Yigtwxx deleted the fix/web-organize-imports-error-toast branch August 7, 2026 06:11
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.

2 participants