Contributing to @ainyc/aeo-audit
git clone https://github.com/Canonry/aeo-audit.git
cd aeo-audit
pnpm install
pnpm run typecheck
pnpm run build
pnpm test
Language: TypeScript (ESM)
Node version: >= 20
Build output: dist/
Typecheck: tsc --noEmit
Test runner: tsx --test
Linter: ESLint v9 flat config
Create src/analyzers/your-analyzer.ts exporting a function:
export function analyzeYourFactor ( context ) {
// context: { $, html, url, headers, auxiliary, structuredData, textContent, pageTitle }
return {
score : 0 - 100 ,
findings : [ { type : 'found' | 'missing' | 'info' | 'timeout' | 'unreachable' , message : '...' } ] ,
recommendations : [ '...' ] ,
}
}
Add the factor to FACTOR_DEFINITIONS in src/scoring.ts
Wire it up in src/index.ts (import + add to ANALYZER_BY_ID)
Add tests in test/analyzers/your-analyzer.test.ts
Ensure all weights still sum to 100%
pnpm run typecheck
pnpm run build
pnpm test
Functional style, no classes except AeoAuditError
Use clampScore() from helpers for all score calculations
Findings use types: found, missing, info, timeout, unreachable
Recommendations should be actionable and specific
Include tests for new analyzers or bug fixes
Run pnpm run build if you change the CLI packaging or published entrypoints
Run pnpm lint before submitting
Keep PRs focused on a single change