Files
git.stella-ops.org/src/Web/StellaOps.Web/.lighthouserc.js
StellaOps Bot b058dbe031 up
2025-12-14 23:20:14 +02:00

79 lines
2.3 KiB
JavaScript

/**
* Lighthouse CI Configuration
*
* Quality gates aligned with StellaOps advisory:
* - Performance: >= 90
* - Accessibility: >= 95
* - Best Practices: >= 90
* - SEO: >= 90
*/
module.exports = {
ci: {
collect: {
staticDistDir: './dist/stella-ops-web/browser',
numberOfRuns: 3,
settings: {
// Mobile-first testing
formFactor: 'mobile',
throttling: {
rttMs: 150,
throughputKbps: 1638.4,
cpuSlowdownMultiplier: 4,
},
screenEmulation: {
mobile: true,
width: 375,
height: 667,
deviceScaleFactor: 2,
disabled: false,
},
// Skip audits that don't apply to SPAs
skipAudits: [
'uses-http2', // Often depends on server config
'redirects-http', // Handled by deployment
],
},
},
assert: {
preset: 'lighthouse:recommended',
assertions: {
// Performance budget
'categories:performance': ['warn', { minScore: 0.9 }],
'first-contentful-paint': ['warn', { maxNumericValue: 2000 }],
'largest-contentful-paint': ['warn', { maxNumericValue: 2500 }],
'cumulative-layout-shift': ['error', { maxNumericValue: 0.1 }],
'total-blocking-time': ['warn', { maxNumericValue: 300 }],
// Accessibility (strict - these are blocking)
'categories:accessibility': ['error', { minScore: 0.95 }],
'color-contrast': 'error',
'document-title': 'error',
'html-has-lang': 'error',
'image-alt': 'error',
'label': 'error',
'link-name': 'error',
'meta-viewport': 'error',
'button-name': 'error',
'aria-roles': 'error',
'aria-valid-attr': 'error',
'aria-valid-attr-value': 'error',
// Best Practices
'categories:best-practices': ['warn', { minScore: 0.9 }],
'is-on-https': 'off', // Handled by deployment
'no-vulnerable-libraries': 'error',
// SEO
'categories:seo': ['warn', { minScore: 0.9 }],
'meta-description': 'warn',
'robots-txt': 'off', // Handled by deployment
},
},
upload: {
target: 'filesystem',
outputDir: './lighthouse-results',
reportFilenamePattern: '%%PATHNAME%%-%%DATETIME%%-report.%%EXTENSION%%',
},
},
};