Skip to content

build: configure oxlint, oxfmt, commitlint, lefthook, and knip#18

Closed
vanceingalls wants to merge 16 commits intomainfrom
vance/va-851-pre-migration-configure-eslint-prettier-and-conventional
Closed

build: configure oxlint, oxfmt, commitlint, lefthook, and knip#18
vanceingalls wants to merge 16 commits intomainfrom
vance/va-851-pre-migration-configure-eslint-prettier-and-conventional

Conversation

@vanceingalls
Copy link
Copy Markdown
Collaborator

Summary

Closes VA-851

  • Linting: oxlint with correctness rules, React plugin, and TypeScript plugin (~10ms on 193 files)
  • Formatting: oxfmt with double quotes, semicolons, 2-space indent, trailing commas, 100 print width (~915ms on 426 files)
  • Commit enforcement: commitlint + @commitlint/config-conventional on every commit via lefthook git hooks
  • Git hooks: lefthook runs oxlint + oxfmt in parallel on pre-commit, commitlint on commit-msg
  • Unused code detection: knip configured for all 5 packages
  • Editor consistency: .editorconfig for indent, charset, line endings
  • CI: New lint-and-format job in GitHub Actions
  • Docs: CONTRIBUTING.md updated with new tooling and commit conventions
  • Baseline formatting: All source files formatted with oxfmt in a single commit

All existing code passes lint + format checks with zero errors. Build, typecheck, and all 348 tests pass.

Test plan

  • pnpm lint — 0 errors (193 files, 85 rules)
  • pnpm format:check — all 426 files formatted
  • pnpm -r typecheck — all 5 packages pass
  • pnpm build — all 5 packages build
  • pnpm --filter @hyperframes/core test — 330 tests pass
  • pnpm --filter @hyperframes/engine test — 18 tests pass
  • Git hooks reject bad commit messages (commitlint)
  • Git hooks reject unformatted staged files (oxfmt --check)
  • Git hooks pass for valid commits

🤖 Generated with Claude Code

vanceingalls and others added 15 commits March 23, 2026 10:10
VA-851: Design spec for oxlint + oxfmt + commitlint + lefthook + knip
configuration at monorepo root, reviewed and approved.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…al commits

VA-851: Step-by-step plan for oxlint + oxfmt + commitlint + lefthook + knip
setup, reviewed and corrected.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
VA-851

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- oxlint category: recommended → correctness (oxlint has no recommended)
- lefthook commands: bare binaries → npx prefix (required for PATH)

VA-851
@linear
Copy link
Copy Markdown

linear Bot commented Mar 23, 2026

VA-851 [Pre-Migration] Configure ESLint, Prettier, and conventional commits

Context

The codebase currently has no linting or formatting enforcement. Code is clean by convention, but OSS contributors need automated guardrails. Team feedback: "I love when an open source repo has this."

What to do

  1. ESLint — add configuration at monorepo root with TypeScript rules. Extend from @typescript-eslint/recommended.
  2. Prettier — add .prettierrc at root. Configure for the existing code style (double quotes, no semicolons or with — match what's already there).
  3. Conventional commits — add commitlint config enforcing conventional commit format (feat:, fix:, refactor:, etc.). This enables automated changelog generation later.
  4. Run formatter across all source files to establish baseline (single "format" commit in internal repo before port).
  5. Add lint/format scripts to root package.json: pnpm lint, pnpm format, pnpm format:check
  6. Verify all existing code passes lint + format checks with zero errors

Why before port

We want the OSS repo's first commit to already have these configs in place and all code conforming. No "fix linting" commits in public history.

miguel-heygen added a commit that referenced this pull request Mar 31, 2026
…tsx split (#144)

## Summary

Full code quality review of the studio package, fixing 22 of 25 findings. Removes dead code, extracts modules from App.tsx, fixes accessibility and performance issues.

## Critical fixes (3)

- **`aria-valuenow`** on seek bar now updates imperatively via `liveTime.subscribe` — screen readers previously always reported position 0
- **Speed menu** closes on outside click (was permanently stuck open)
- **RenderQueue auto-scroll** moved from render phase to `useEffect` (was violating React render purity via `queueMicrotask` during render)

## Dead code removed (-331 lines)

| File | Lines | Why dead |
|---|---|---|
| `PreviewPanel.tsx` | 180 | Replaced by NLELayout + NLEPreview |
| `useCodeEditor.ts` | 80 | Exported but never imported |
| `formatTick` alias | 2 | Deprecated, unused |
| `onClipChange` prop | 5 | Declared, never used |
| `trackH` prop | 5 | Declared, never used |
| `editRange*` + updaters in store | 60 | Never read or written |

## App.tsx extraction

| Extracted to | Lines | What |
|---|---|---|
| `components/LintModal.tsx` | 130 | Lint results modal + LintFinding type |
| `components/MediaPreview.tsx` | 75 | Image/video/audio/font file previewer |
| `utils/mediaTypes.ts` | 15 | Shared regex constants (App.tsx and AssetsTab.tsx had diverged copies) |

## Performance fixes

- `useMemo` for `compositions`/`assets` derivation from `fileTree`
- `useMemo` for `buildTree(files)` in FileTree
- Debounced `handleContentChange` PUT (600ms — was firing on every keystroke)
- CompositionsTab iframe hover debounced (300ms — was mounting immediately)
- `VideoFrameThumbnail` re-extracts frame when `src` prop changes

## Not addressed (3 — low priority)

- #6: SystemIcons consolidation (large refactor across many files)
- #16-17: Overlay dismiss pattern standardization
- #18: Inline SVG → Phosphor replacement (gradual, per-PR)

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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.

1 participant