Skip to content

chore: add code quality tooling (Biome + Knip) and apply formatting - #2

Merged
JonasJesus42 merged 2 commits into
mainfrom
chore/code-quality-tooling
Mar 11, 2026
Merged

chore: add code quality tooling (Biome + Knip) and apply formatting#2
JonasJesus42 merged 2 commits into
mainfrom
chore/code-quality-tooling

Conversation

@JonasJesus42

@JonasJesus42 JonasJesus42 commented Mar 10, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add Biome 2.4.6 for linting and formatting — configured with recommended rules, relaxed for framework patterns (noDangerouslySetInnerHtml off for LiveControls/inline scripts, noExplicitAny off for generic utilities)
  • Add Knip for dead code detection — catches unused exports, files, and dependencies
  • Add scripts: lint, lint:fix, lint:unused, format, format:fix, check (runs all quality checks)
  • Auto-format all 36 source files with Biome (import ordering, consistent spacing, trailing commas)
  • Fix dead else if branch in generate-schema.ts — the nullable string condition on line 185 was unreachable because the non-nullable string branch above already matched the same case

All checks pass:

✅ tsc --noEmit (zero errors)
✅ biome check (zero errors, 12 warnings)
✅ knip (zero issues)

Test plan

  • npm run check passes (typecheck + lint + knip)
  • npm run build succeeds
  • Storefront still renders correctly after formatting changes
  • Admin protocol endpoints still work (/live/_meta, /.decofile, /live/previews)

Made with Cursor


Summary by cubic

Add @biomejs/biome and knip to standardize code quality and catch dead code, then apply project-wide formatting. Also fixes an unreachable branch in the schema generator.

  • Dependencies

    • Add @biomejs/biome 2.4.6 for linting/formatting with recommended rules (disable noDangerouslySetInnerHtml, noExplicitAny, noNonNullAssertion).
    • Add knip for detecting unused files/exports/dependencies.
    • New scripts: lint, lint:fix, lint:unused, format, format:fix, check.
  • Bug Fixes

    • Remove unreachable else-if in scripts/generate-schema.ts (nullable string branch was shadowed).

Written for commit 624cca1. Summary will update on new commits.

- Add Biome 2.4.6 for linting and formatting
- Add Knip for dead code detection
- Add scripts: lint, lint:fix, lint:unused, format, format:fix, check
- Configure biome.json with recommended rules (noExplicitAny off, noDangerouslySetInnerHtml off for framework needs)
- Configure knip.json to detect unused exports

Made-with: Cursor
- Auto-format all source files with Biome (import ordering, consistent spacing, trailing commas)
- Fix duplicate else-if condition in generate-schema.ts (line 185: nullable string branch was unreachable because the non-nullable string branch above already matched)

All checks pass: tsc --noEmit, biome check, knip

Made-with: Cursor

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

1 issue found across 40 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="src/sdk/instrumentedFetch.ts">

<violation number="1" location="src/sdk/instrumentedFetch.ts:122">
P1: `instrumentFetch` ignores the `originalFetch` argument and always uses `globalThis.fetch`, so custom client fetch behavior is bypassed.</violation>
</file>

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

Comment thread src/sdk/instrumentedFetch.ts
@JonasJesus42
JonasJesus42 merged commit ba90ba6 into main Mar 11, 2026
1 check passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 0.16.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant