
lighthouse-ci-audit
by Bedriftsgrafen
Full-stack business intelligence platform tracking 1.1M+ Norwegian companies with real-time analytics | React 19 | FastAPI | PostgreSQL
SKILL.md
name: Lighthouse CI Audit description: Run comprehensive Lighthouse performance, accessibility, SEO, and best practices audits using the project's Lighthouse CI configuration.
Lighthouse CI Audit
This skill runs Lighthouse CI audits on the Bedriftsgrafen.no frontend, producing comprehensive performance, accessibility, SEO, and best practices reports.
Prerequisites
- Dependencies installed: Ensure
npm installhas been run at the root level (installs@lhci/cli). - Frontend built: The audit runs against the production build, not the dev server.
- No backend required: The audit tests static pages only (pages requiring backend data are excluded).
Quick Run
# From project root - builds frontend first, then runs Lighthouse CI
npm run lighthouse
What Gets Audited
The following pages are audited (configured in lighthouserc.cjs):
| Page | URL | Purpose |
|---|---|---|
| Home | / | Main landing/search page |
| Search | /search | Search results page |
| About | /om | About page |
| Industries | /bransjer | Industry explorer |
| Bankruptcies | /konkurser | Bankruptcy listings |
| New Establishments | /nyetableringer | New company listings |
| Explore | /utforsk | Data exploration |
Excluded pages: /kart (requires backend), /bedrift/:orgnr (dynamic data)
Note: The preview server runs on port 5174 (configured in
vite.config.ts).
Thresholds
Current score thresholds (defined in lighthouserc.cjs):
| Category | Minimum Score | Level |
|---|---|---|
| Accessibility | 85% | Error (blocks CI) |
| SEO | 90% | Warn |
| Best Practices | 80% | Warn |
| Performance | 50% | Warn |
Note: Performance is relaxed due to third-party scripts and dynamic content. Focus on accessibility and SEO first.
Report Output
After running, Lighthouse CI:
- Creates reports in
.lighthouseci/directory - Uploads to temporary-public-storage (auto-deletes after 7 days)
- Prints a shareable link to view the full report online
Interpreting Results
Pass Example
✅ All assertions passed.
Failure Example
❌ categories:accessibility assertion failed.
Expected minScore >= 0.85, got 0.78
URL: http://localhost:4173/konkurser
Failing audit: button-name
- Fix: Add accessible names to all buttons
Manual Steps
Step 1: Build Frontend
cd frontend && npm run build
Step 2: Run Lighthouse CI
# From project root
npx lhci autorun
Step 3: Review Report
- Check terminal output for summary
- Click the temporary-public-storage link for full interactive report
- Review
.lighthouseci/directory for JSON reports
Troubleshooting
"No Chrome found"
Lighthouse needs Chrome/Chromium. Install with:
# Ubuntu/Debian
sudo apt install chromium-browser
# Or set Chrome path
export CHROME_PATH=/path/to/chrome
"Port 5174 in use"
Kill existing preview servers:
fuser -k 5174/tcp
Slow Performance Scores
For local testing, scores may vary. Use --numberOfRuns=5 for more stable results:
npx lhci autorun --collect.numberOfRuns=5
Configuration Reference
| File | Purpose |
|---|---|
lighthouserc.cjs | Main Lighthouse CI config |
package.json | Contains npm run lighthouse script |
.lighthouseci/ | Report output directory (gitignored) |
Disabled Audits
The following audits are intentionally disabled:
valid-source-maps- Not needed in productionuses-http2- Environment-dependenterrors-in-console- Only issues if backend not runningunused-javascript- Informational, not actionable- Individual performance metrics - Tracked via category score only
Best Practices
- Run before major releases to catch accessibility regressions
- Compare report links over time to track improvements
- Fix accessibility issues first - they have the strictest threshold
- Don't chase 100 Performance - focus on Core Web Vitals that matter
スコア
総合スコア
リポジトリの品質指標に基づく評価
SKILL.mdファイルが含まれている
ライセンスが設定されている
100文字以上の説明がある
GitHub Stars 100以上
3ヶ月以内に更新がある
10回以上フォークされている
オープンIssueが50未満
プログラミング言語が設定されている
1つ以上のタグが設定されている
レビュー
レビュー機能は近日公開予定です