-
-
Notifications
You must be signed in to change notification settings - Fork 40
feat: implement Phase 1 frontend quality infrastructure #1055
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Core infrastructure changes only: - Add pre-commit hooks with husky + lint-staged configuration - Install bundle size monitoring with bundlesize tool - Create comprehensive frontend quality CI/CD pipeline - Add frontend-quality task to Taskfile for local development - Add security audit and dependency check scripts - Configure bundle analysis tools for performance monitoring This commit contains NO formatting changes - only essential infrastructure to enforce quality on future commits. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Warning Rate limit exceeded@tphakala has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 8 minutes and 55 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (2)
WalkthroughThis update introduces comprehensive frontend quality assurance automation. It adds a new GitHub Actions workflow for frontend checks, pre-commit linting via Husky, enhanced Taskfile tasks for type checking and quality, and expands the frontend's package.json with scripts and configurations for linting, auditing, bundle analysis, and size enforcement. The root package.json gains a Husky setup script. Changes
Sequence Diagram(s)sequenceDiagram
participant Dev as Developer
participant Git as Git (pre-commit)
participant Husky as Husky
participant LintStaged as lint-staged
participant CI as GitHub Actions
participant Task as Taskfile
participant NPM as npm scripts
Dev->>Git: git commit
Git->>Husky: Run pre-commit
Husky->>LintStaged: Lint staged files
LintStaged-->>Husky: Report/fix issues
Husky-->>Git: Allow/deny commit
Dev->>CI: Push/PR triggers
CI->>Task: Run frontend-quality
Task->>NPM: Run quality scripts (typecheck, lint, test, audit, build, analyze)
NPM-->>Task: Results
Task-->>CI: Pass/fail, upload artifacts
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~18 minutes Poem
✨ Finishing Touches🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 5
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
⛔ Files ignored due to path filters (1)
frontend/package-lock.json
is excluded by!**/package-lock.json
📒 Files selected for processing (6)
.github/workflows/frontend-quality.yml
(1 hunks).husky/pre-commit
(1 hunks)Taskfile.yml
(2 hunks)frontend/.husky/pre-commit
(1 hunks)frontend/package.json
(3 hunks)package.json
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
{.github/workflows/*,.gitlab-ci.yml}
📄 CodeRabbit Inference Engine (.cursor/rules/go.mdc)
Set up CI/CD pipelines with linter checks and tests.
Files:
.github/workflows/frontend-quality.yml
🧠 Learnings (7)
📓 Common learnings
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.{svelte,css} : Run `npm run lint:css` for Tailwind/CSS issues and fix major violations before commit
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Run `npm run check:all` before commits
Learnt from: CR
PR: tphakala/birdnet-go#0
File: .cursor/rules/go.mdc:0-0
Timestamp: 2025-07-18T14:45:53.478Z
Learning: Applies to {.github/workflows/*,.gitlab-ci.yml} : Set up CI/CD pipelines with linter checks and tests.
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: NEVER COMMIT CODE WITH: TypeScript compilation errors, ESLint errors, critical security issues, major CSS/style violations, missing imports or undefined variables, component type mismatches, or accessibility violations
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.a11y.test.{ts,js} : Run accessibility tests regularly using axe-core and ensure no accessibility violations in test files
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/src/lib/desktop/features/settings/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:32:20.392Z
Learning: Implement automated TypeScript interface validation in CI/CD.
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.{ts,svelte} : Review `eslint-plugin-security` warnings, especially for regex and filesystem usage
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.{ts,svelte} : Verify all imports resolve correctly
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.test.{ts,js} : Validate test file syntax and imports
.husky/pre-commit (10)
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Run npm run check:all
before commits
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.{svelte,css} : Run npm run lint:css
for Tailwind/CSS issues and fix major violations before commit
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/src/lib/desktop/features/settings/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:32:20.392Z
Learning: Use 'npm run build' to verify actual compilation versus IDE errors.
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.a11y.test.{ts,js} : Run accessibility tests regularly using axe-core and ensure no accessibility violations in test files
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.test.{ts,js} : Write and run Vitest tests
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/tools/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:32:43.506Z
Learning: Always run screenshot.js from the /frontend/tools directory (cd to the tools directory first before running the script)
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.{ts,svelte} : Verify all imports resolve correctly
Learnt from: CR
PR: tphakala/birdnet-go#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T12:31:02.363Z
Learning: Run golangci-lint run -v before EVERY commit
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.test.{ts,js} : Validate test file syntax and imports
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.{ts,svelte} : Review eslint-plugin-security
warnings, especially for regex and filesystem usage
package.json (1)
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Run npm run check:all
before commits
Taskfile.yml (16)
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.test.{ts,js} : Validate test file syntax and imports
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.svelte : Use TypeScript for all components
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/src/lib/desktop/features/settings/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:32:20.392Z
Learning: Implement automated TypeScript interface validation in CI/CD.
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.{ts,svelte} : Verify all imports resolve correctly
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.a11y.test.{ts,js} : Run accessibility tests regularly using axe-core and ensure no accessibility violations in test files
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Run npm run check:all
before commits
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.{ts,svelte} : Ensure no any
types without proper eslint-disable comments
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.{svelte,css} : Run npm run lint:css
for Tailwind/CSS issues and fix major violations before commit
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/src/lib/desktop/features/settings/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:32:20.392Z
Learning: Applies to frontend/src/lib/desktop/features/settings/**/*.{ts,svelte} : Apply type assertions strategically for complex derived scenarios to resolve TypeScript errors.
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.{ts,svelte} : Review eslint-plugin-security
warnings, especially for regex and filesystem usage
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/src/lib/desktop/features/settings/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:32:20.392Z
Learning: Use 'npm run build' to verify actual compilation versus IDE errors.
Learnt from: CR
PR: tphakala/birdnet-go#0
File: .cursor/rules/go.mdc:0-0
Timestamp: 2025-07-18T14:45:53.478Z
Learning: Applies to {README*,CONTRIBUTING*} : Document build and test procedures.
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.test.{ts,js} : Write and run Vitest tests
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/src/lib/desktop/components/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:16.387Z
Learning: Applies to frontend/src/lib/desktop/components/components/**/*.test.{ts,svelte} : Include comprehensive tests for each component
Learnt from: CR
PR: tphakala/birdnet-go#0
File: .cursor/rules/go.mdc:0-0
Timestamp: 2025-07-18T14:45:53.478Z
Learning: Applies to **/*.go : Run golangci-lint regularly with appropriate linters (durationcheck, errcheck, errorlint, gocognit, gocritic, gosimple, ineffassign, staticcheck, unconvert).
Learnt from: CR
PR: tphakala/birdnet-go#0
File: .cursor/rules/go.mdc:0-0
Timestamp: 2025-07-18T14:45:53.478Z
Learning: Applies to {.github/workflows/*,.gitlab-ci.yml} : Set up CI/CD pipelines with linter checks and tests.
frontend/.husky/pre-commit (12)
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Run npm run check:all
before commits
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.test.{ts,js} : Validate test file syntax and imports
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.a11y.test.{ts,js} : Run accessibility tests regularly using axe-core and ensure no accessibility violations in test files
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.{svelte,css} : Run npm run lint:css
for Tailwind/CSS issues and fix major violations before commit
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/src/lib/desktop/components/ui/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:28.981Z
Learning: Applies to frontend/src/lib/desktop/components/ui/**/*.test.ts : When creating a new component, create a .test.ts
file
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: NEVER COMMIT CODE WITH: TypeScript compilation errors, ESLint errors, critical security issues, major CSS/style violations, missing imports or undefined variables, component type mismatches, or accessibility violations
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.{ts,svelte} : Verify all imports resolve correctly
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.test.{ts,js} : Write and run Vitest tests
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/src/lib/desktop/components/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:16.387Z
Learning: Applies to frontend/src/lib/desktop/components/components/**/*.test.{ts,svelte} : Include comprehensive tests for each component
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/src/lib/desktop/components/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:16.387Z
Learning: Applies to frontend/src/lib/desktop/components/components/**/*.test.{ts,svelte} : Each component should have corresponding test files: Unit tests: .test.ts, Component tests: .test.svelte
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/src/lib/desktop/features/settings/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:32:20.392Z
Learning: Use 'npm run build' to verify actual compilation versus IDE errors.
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.a11y.test.{ts,js} : Create accessibility tests with 'Accessibility' in the describe block name and use expectNoA11yViolations
utility
.github/workflows/frontend-quality.yml (3)
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.a11y.test.{ts,js} : Run accessibility tests regularly using axe-core and ensure no accessibility violations in test files
Learnt from: CR
PR: tphakala/birdnet-go#0
File: .cursor/rules/go.mdc:0-0
Timestamp: 2025-07-18T14:45:53.478Z
Learning: Applies to {.github/workflows/*,.gitlab-ci.yml} : Set up CI/CD pipelines with linter checks and tests.
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.{svelte,css} : Run npm run lint:css
for Tailwind/CSS issues and fix major violations before commit
frontend/package.json (14)
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.{svelte,css} : Run npm run lint:css
for Tailwind/CSS issues and fix major violations before commit
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Run npm run check:all
before commits
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.{ts,svelte} : Review eslint-plugin-security
warnings, especially for regex and filesystem usage
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.{ts,svelte} : Verify all imports resolve correctly
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.test.{ts,js} : Validate test file syntax and imports
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.test.{ts,js} : Write and run Vitest tests
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.{ts,svelte} : Ensure no any
types without proper eslint-disable comments
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.a11y.test.{ts,js} : Run accessibility tests regularly using axe-core and ensure no accessibility violations in test files
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/src/lib/desktop/components/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:16.387Z
Learning: Applies to frontend/src/lib/desktop/components/components/**/*.test.{ts,svelte} : Include comprehensive tests for each component
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/src/lib/desktop/features/settings/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:32:20.392Z
Learning: Use 'npm run build' to verify actual compilation versus IDE errors.
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/src/lib/desktop/features/settings/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:32:20.392Z
Learning: Implement automated TypeScript interface validation in CI/CD.
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/src/lib/desktop/components/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:16.387Z
Learning: Applies to frontend/src/lib/desktop/components/components/**/*.test.{ts,svelte} : Each component should have corresponding test files: Unit tests: .test.ts, Component tests: .test.svelte
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: NEVER COMMIT CODE WITH: TypeScript compilation errors, ESLint errors, critical security issues, major CSS/style violations, missing imports or undefined variables, component type mismatches, or accessibility violations
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.svelte : Follow Svelte 5 patterns (runes, snippets)
🪛 YAMLlint (1.37.1)
.github/workflows/frontend-quality.yml
[warning] 3-3: truthy value should be one of [false, true]
(truthy)
[error] 26-26: trailing spaces
(trailing-spaces)
[error] 30-30: trailing spaces
(trailing-spaces)
[error] 37-37: trailing spaces
(trailing-spaces)
[error] 41-41: trailing spaces
(trailing-spaces)
[error] 45-45: trailing spaces
(trailing-spaces)
[error] 49-49: trailing spaces
(trailing-spaces)
[error] 53-53: trailing spaces
(trailing-spaces)
[error] 57-57: trailing spaces
(trailing-spaces)
[error] 61-61: trailing spaces
(trailing-spaces)
[error] 65-65: trailing spaces
(trailing-spaces)
[error] 70-70: trailing spaces
(trailing-spaces)
[error] 74-74: trailing spaces
(trailing-spaces)
[error] 78-78: trailing spaces
(trailing-spaces)
[error] 83-83: trailing spaces
(trailing-spaces)
[error] 90-90: no new line character at the end of file
(new-line-at-end-of-file)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: unit-tests
🔇 Additional comments (8)
package.json (1)
7-10
: LGTM - Correct Husky integration setup.The addition of the
prepare
script properly initializes Husky during package installation, aligning with the broader pre-commit hook infrastructure being established across the project..husky/pre-commit (1)
1-2
: LGTM - Well-structured pre-commit hook for lint-staged.The hook correctly changes to the frontend directory and runs lint-staged via npx, ensuring quality checks are applied to staged files before commits.
frontend/.husky/pre-commit (1)
1-1
: Consider running comprehensive quality checks instead of just tests.Based on the project's quality standards, this hook should run more comprehensive checks to align with the established learning that
npm run check:all
should be run before commits.-npm test +npm run check:allThis would ensure type checking, linting, tests, and other quality checks are all validated before commits, providing better coverage than tests alone.
Taskfile.yml (3)
157-167
: LGTM - Well-structured TypeScript type checking task.The task correctly depends on frontend-install, specifies appropriate sources for change detection, and integrates seamlessly with the build pipeline.
171-171
: Excellent addition of type checking as a build dependency.Enforcing strict type checking before building ensures type safety and aligns with the project's quality standards from the retrieved learnings.
218-229
: Comprehensive frontend quality task covers all essential checks.The task properly orchestrates all quality checks in the right sequence: linting, testing, security audits, circular dependency analysis, building, and bundle size validation. This aligns perfectly with the CI/CD pipeline being established.
.github/workflows/frontend-quality.yml (2)
66-69
: Appropriate use of continue-on-error for security audits.Using
continue-on-error: true
for security audits allows the pipeline to proceed while still logging security issues, which is a good balance for Phase 1 implementation.
79-82
: Good approach for bundle size monitoring.Using
continue-on-error: true
for bundle size checks allows monitoring without blocking deployments during the initial implementation phase, which aligns with the Phase 1 objectives.
- Remove duplicate husky directory in frontend (was auto-generated) - Fix lint-staged duplicate Svelte processing - now *.css only for stylelint - Remove vitest from pre-commit hooks for faster commits - Update bundle size thresholds based on actual build output: - charts.js: 75kb gzipped (current: 70.74kb) - index.js: 65kb gzipped (current: 58.40kb) - Settings.js: 45kb gzipped (current: 42.17kb) - Other JS files: 25kb gzipped - index.css: 30kb gzipped (current: 27.77kb) - Add missing CI path triggers: package.json, package-lock.json, Taskfile.yml - Remove slow precommit:check script (was running full test suite + audit) These changes improve developer experience by making commits faster while maintaining code quality through targeted pre-commit checks. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 3
♻️ Duplicate comments (3)
.github/workflows/frontend-quality.yml (1)
30-96
: Strip trailing whitespace and add missing EOF newline to satisfy YAML linters
yamllint
is still flagging trailing-space errors on multiple lines (32, 36, 43, 47, 51, 55, 59, 63, 67, 71, 76, 80, 84, 89) and the missing newline at the end of the file.
These keep the workflow from passing “strict” repo-level linters and make future diffs noisy.-runs-on: ubuntu-latest␠␠ +runs-on: ubuntu-latest … - retention-days: 7␠␠ + retention-days: 7 +Removing the spaces and ensuring the file ends with a newline is mechanical but prevents CI failures on repos that enforce
yamllint -d strict
.frontend/package.json (2)
40-43
:bundlesize
is unmaintained – prefersize-limit
This repeats the earlier feedback:
bundlesize
hasn’t been updated since 2019 and often mis-reports modern Vite chunks.size-limit
(orrollup-plugin-visualizer
) is actively maintained and supports Brotli.No action taken in this commit – please reconsider the switch.
81-119
: Version ranges still use^
for critical toolingCaret ranges (
^
) onhusky
,lint-staged
,bundlesize
, andvite-bundle-analyzer
allow unnoticed minor releases to break the quality gate.
Pin exact versions (or tilde) and rely on Renovate/Dependabot for upgrades.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/frontend-quality.yml
(1 hunks)frontend/package.json
(3 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.{svelte,css} : Run `npm run lint:css` for Tailwind/CSS issues and fix major violations before commit
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Run `npm run check:all` before commits
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/src/lib/desktop/features/settings/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:32:20.392Z
Learning: Implement automated TypeScript interface validation in CI/CD.
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.{ts,svelte} : Review `eslint-plugin-security` warnings, especially for regex and filesystem usage
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.a11y.test.{ts,js} : Run accessibility tests regularly using axe-core and ensure no accessibility violations in test files
Learnt from: CR
PR: tphakala/birdnet-go#0
File: .cursor/rules/go.mdc:0-0
Timestamp: 2025-07-18T14:45:53.478Z
Learning: Applies to {.github/workflows/*,.gitlab-ci.yml} : Set up CI/CD pipelines with linter checks and tests.
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.test.{ts,js} : Validate test file syntax and imports
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.{ts,svelte} : Verify all imports resolve correctly
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: NEVER COMMIT CODE WITH: TypeScript compilation errors, ESLint errors, critical security issues, major CSS/style violations, missing imports or undefined variables, component type mismatches, or accessibility violations
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.{ts,svelte} : Ensure no `any` types without proper eslint-disable comments
.github/workflows/frontend-quality.yml (8)
Learnt from: CR
PR: tphakala/birdnet-go#0
File: .cursor/rules/go.mdc:0-0
Timestamp: 2025-07-18T14:45:53.478Z
Learning: Applies to {.github/workflows/*,.gitlab-ci.yml} : Set up CI/CD pipelines with linter checks and tests.
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.a11y.test.{ts,js} : Run accessibility tests regularly using axe-core and ensure no accessibility violations in test files
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.{svelte,css} : Run npm run lint:css
for Tailwind/CSS issues and fix major violations before commit
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.{ts,svelte} : Review eslint-plugin-security
warnings, especially for regex and filesystem usage
Learnt from: tphakala
PR: #770
File: internal/errors/README.md:1-445
Timestamp: 2025-06-25T16:32:01.944Z
Learning: For markdown files in this repository, ignore minor formatting issues such as missing blank lines around lists and headings, missing trailing newlines, and similar linting-style issues. Focus on substantive content, structure, and significant readability concerns instead.
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Run npm run check:all
before commits
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: NEVER COMMIT CODE WITH: TypeScript compilation errors, ESLint errors, critical security issues, major CSS/style violations, missing imports or undefined variables, component type mismatches, or accessibility violations
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: MANDATORY: Run static analysis before EVERY commit - Check IDE diagnostics panel
frontend/package.json (31)
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.{svelte,css} : Run npm run lint:css
for Tailwind/CSS issues and fix major violations before commit
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.{ts,svelte} : Review eslint-plugin-security
warnings, especially for regex and filesystem usage
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Run npm run check:all
before commits
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.{ts,svelte} : Verify all imports resolve correctly
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.svelte : Document all components - Include comprehensive HTML comments at the top of each component describing purpose, usage, features, and props
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.{ts,svelte} : Ensure no any
types without proper eslint-disable comments
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.test.{ts,js} : Validate test file syntax and imports
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.svelte : Use TypeScript for all components
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.test.{ts,js} : Write and run Vitest tests
Learnt from: CR
PR: tphakala/birdnet-go#0
File: CLAUDE.md:0-0
Timestamp: 2025-07-21T12:31:02.363Z
Learning: Run golangci-lint run -v before EVERY commit
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: NEVER COMMIT CODE WITH: TypeScript compilation errors, ESLint errors, critical security issues, major CSS/style violations, missing imports or undefined variables, component type mismatches, or accessibility violations
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: MANDATORY: Run static analysis before EVERY commit - Check IDE diagnostics panel
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.a11y.test.{ts,js} : Run accessibility tests regularly using axe-core and ensure no accessibility violations in test files
Learnt from: CR
PR: tphakala/birdnet-go#0
File: .cursor/rules/go.mdc:0-0
Timestamp: 2025-07-18T14:45:53.478Z
Learning: Applies to {.github/workflows/*,.gitlab-ci.yml} : Set up CI/CD pipelines with linter checks and tests.
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.svelte : Follow Svelte 5 patterns (runes, snippets)
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/src/lib/desktop/components/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:16.387Z
Learning: Applies to frontend/src/lib/desktop/components/components/**/*.svelte : Follow Svelte 5 patterns (runes, snippets)
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.svelte : For TypeScript type assertions in Svelte bindings, use <!-- prettier-ignore -->
comments to avoid Prettier formatting issues
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:06.382Z
Learning: Applies to frontend/src/**/*.svelte : ALWAYS use centralized icons from $lib/utils/icons.ts
- NEVER create inline SVGs
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/src/lib/desktop/features/settings/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:32:20.392Z
Learning: Applies to frontend/src/lib/desktop/features/settings/**/*.svelte : Align change detection paths with the actual store structure to ensure correct change detection logic.
Learnt from: tphakala
PR: #1055
File: frontend/package.json:56-67
Timestamp: 2025-07-31T07:21:18.767Z
Learning: Always raise issues when encountering unmaintained packages in package.json dependencies and suggest actively maintained alternatives with better support for modern features.
Learnt from: tphakala
PR: #770
File: internal/errors/README.md:1-445
Timestamp: 2025-06-25T16:32:01.944Z
Learning: For markdown files in this repository, ignore minor formatting issues such as missing blank lines around lists and headings, missing trailing newlines, and similar linting-style issues. Focus on substantive content, structure, and significant readability concerns instead.
Learnt from: CR
PR: tphakala/birdnet-go#0
File: .cursor/rules/go.mdc:0-0
Timestamp: 2025-07-18T14:45:53.478Z
Learning: Applies to go.mod : Pin dependency versions.
Learnt from: tphakala
PR: #793
File: internal/observability/metrics/myaudio_test.go:69-82
Timestamp: 2025-06-27T09:02:44.970Z
Learning: Added comprehensive testing guidelines to CLAUDE.md including t.Parallel() recommendations for the birdnet-go project to ensure consistent modern Go testing practices.
Learnt from: tphakala
PR: #1054
File: frontend/src/lib/desktop/components/ui/Card.test.ts:7-10
Timestamp: 2025-07-31T06:48:16.616Z
Learning: Always raise and flag TypeScript type safety issues when encountered, including improper use of 'any' types, missing type annotations, and violations of strict typing guidelines.
Learnt from: tphakala
PR: #793
File: internal/observability/metrics/myaudio_test.go:97-106
Timestamp: 2025-06-27T09:01:30.848Z
Learning: User tphakala requested to update CLAUDE.md file with instructions to use range instead of for loop, indicating preference for modern Go 1.24+ range syntax in AI-generated code suggestions.
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/src/lib/desktop/features/settings/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:32:20.392Z
Learning: Implement automated TypeScript interface validation in CI/CD.
Learnt from: tphakala
PR: #770
File: CLAUDE.md:236-236
Timestamp: 2025-06-25T16:31:25.487Z
Learning: CLAUDE.md file should be ignored for linting and formatting issues as it is intended for AI tools, not human consumption, per user tphakala's preference.
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/src/lib/desktop/components/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:16.387Z
Learning: Applies to frontend/src/lib/desktop/components/components/**/*.test.{ts,svelte} : Include comprehensive tests for each component
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/src/lib/desktop/features/settings/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:32:20.392Z
Learning: Use 'npm run build' to verify actual compilation versus IDE errors.
Learnt from: CR
PR: tphakala/birdnet-go#0
File: frontend/src/lib/desktop/components/CLAUDE.md:0-0
Timestamp: 2025-07-24T19:31:16.387Z
Learning: Applies to frontend/src/lib/desktop/components/components/**/*.test.{ts,svelte} : Each component should have corresponding test files: Unit tests: .test.ts, Component tests: .test.svelte
Learnt from: CR
PR: tphakala/birdnet-go#0
File: .cursor/rules/go.mdc:0-0
Timestamp: 2025-07-18T14:45:53.478Z
Learning: Applies to {README*,CONTRIBUTING*} : Document build and test procedures.
🪛 YAMLlint (1.37.1)
.github/workflows/frontend-quality.yml
[warning] 3-3: truthy value should be one of [false, true]
(truthy)
[error] 32-32: trailing spaces
(trailing-spaces)
[error] 36-36: trailing spaces
(trailing-spaces)
[error] 43-43: trailing spaces
(trailing-spaces)
[error] 47-47: trailing spaces
(trailing-spaces)
[error] 51-51: trailing spaces
(trailing-spaces)
[error] 55-55: trailing spaces
(trailing-spaces)
[error] 59-59: trailing spaces
(trailing-spaces)
[error] 63-63: trailing spaces
(trailing-spaces)
[error] 67-67: trailing spaces
(trailing-spaces)
[error] 71-71: trailing spaces
(trailing-spaces)
[error] 76-76: trailing spaces
(trailing-spaces)
[error] 80-80: trailing spaces
(trailing-spaces)
[error] 84-84: trailing spaces
(trailing-spaces)
[error] 89-89: trailing spaces
(trailing-spaces)
[error] 96-96: no new line character at the end of file
(new-line-at-end-of-file)
frontend/package.json
Outdated
"bundlesize": [ | ||
{ | ||
"path": "./dist/charts.js", | ||
"maxSize": "75kb", | ||
"compression": "gzip" | ||
}, | ||
{ | ||
"path": "./dist/index.js", | ||
"maxSize": "65kb", | ||
"compression": "gzip" | ||
}, | ||
{ | ||
"path": "./dist/Settings.js", | ||
"maxSize": "45kb", | ||
"compression": "gzip" | ||
}, | ||
{ | ||
"path": "./dist/*.js", | ||
"maxSize": "25kb", | ||
"compression": "gzip" | ||
}, | ||
{ | ||
"path": "./dist/index.css", | ||
"maxSize": "30kb", | ||
"compression": "gzip" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Overlapping bundlesize
entries add noise
You already list explicit files (charts.js
, index.js
, Settings.js
) with generous limits, then a wildcard *.js
with a lower limit (25 KB).
The generic rule will run on the same files again and fail immediately, so the specific entries are never evaluated.
Either drop the wildcard or raise its limit above the specific ones.
🤖 Prompt for AI Agents
In frontend/package.json between lines 54 and 79, the bundlesize configuration
has overlapping entries where specific JS files have higher size limits but a
wildcard *.js entry has a lower limit of 25kb, causing the wildcard rule to fail
on those files first. To fix this, either remove the wildcard entry for *.js or
increase its maxSize limit to be higher than the largest specific file limit,
ensuring the specific entries are evaluated properly without immediate failure.
- Removed the `continue-on-error` option from the bundle size check in the GitHub Actions workflow to enforce stricter quality control. - Updated the `prepare` script in `package.json` to explicitly use `husky install` for better clarity. - Swapped the max size thresholds for JavaScript and CSS files in the bundle size configuration to ensure proper monitoring of file sizes. These changes enhance the reliability of the frontend quality checks and improve the clarity of the package configuration.
|
Summary
Implements Phase 1 frontend quality enhancements - essential infrastructure for automated code quality enforcement.
🛡️ Pre-commit Hooks
📊 Bundle Monitoring
🔄 CI/CD Quality Pipeline
.github/workflows/frontend-quality.yml
workflow🛠️ Developer Tools
task frontend-quality
- one-command comprehensive validationnpm run audit:security
- high-severity vulnerability scanningnpm run analyze:bundle:size
- bundle size monitoringnpm run precommit:check
- full pre-commit validationWhat This Prevents
Infrastructure-Only Commit
This PR contains NO formatting changes - only essential infrastructure files:
package.json
,Taskfile.yml
).github/workflows/frontend-quality.yml
).husky/pre-commit
)package-lock.json
)Existing linting issues in codebase were intentionally excluded to keep this PR focused and reviewable.
Test Plan
npm run analyze:bundle:size
)npm run audit:security
)task frontend-quality
)Next Steps (Phase 2)
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Chores