thedaviddias/Front-End-Checklist / packages/cli
frontendchecklist
VerifiedReview frontend code and live pages against the Front-End Checklist (380+ rules for accessibility, performance, SEO, security, HTML, CSS, JavaScript, images, i18n, privacy, testing) using the `frontendchecklist` CLI. Use when writing, reviewing, or shipping HTML/CSS/JS/JSX/TSX/Vue/Svelte/Astro code, before a commit or PR, or when asked to audit a public URL.
| File | Kind | Size |
|---|---|---|
| .gitignore | other | 6 B |
| README.md | markdown | 2.4 KB |
| SKILL.md | skill md | 2.7 KB |
| package.json | manifest | 1.5 KB |
| scripts/build.ts | script | 1.9 KB |
| src/args.ts | script | 5.5 KB |
| src/commands/audit.ts | script | 2.8 KB |
| src/commands/lookup.ts | script | 5.0 KB |
| src/commands/review.ts | script | 3.9 KB |
| src/content.ts | script | 1.5 KB |
| src/index.ts | script | 2.9 KB |
| src/output.ts | script | 3.3 KB |
| src/spec.ts | script | 5.1 KB |
| tests/cli.test.mjs | script | 4.6 KB |
| tsconfig.json | config | 202 B |
src/output.ts
View on GitHubimport type { Priority } from '@repo/types'
import type { OutputFormat } from './args'
/** One finding, normalized across `review` (per file) and `audit` (per URL). */
export interface Finding {
target: string
rule: string
title: string
priority: Priority
issue: string
fix?: string
}
/**
* Write a JSON document to stdout (machine-readable contract).
*
* @param value - Serializable value.
*/
export function writeJson(value: unknown): void {
process.stdout.write(`${JSON.stringify(value, null, 2)}\n`)
}
/**
* Write plain lines to stdout.
*
* @param lines - Lines to print.
*/
export function writeLines(lines: string[]): void {
process.stdout.write(`${lines.join('\n')}\n`)
}
/**
* Escape text for HTML output.
*
* @param text - Raw text.
* @returns Escaped text.
*/
function escapeHtml(text: string): string {
return text
.replace(/&/g, '&')
.replace(/</g, '<')
.replace(/>/g, '>')
.replace(/"/g, '"')
}
/**
* Render findings as Markdown.
*
* @param title - Report heading.
* @param findings - Findings to list.
* @returns Markdown text.
*/
function findingsMarkdown(title: string, findings: Finding[]): string {
const rows = findings.map(
f => `| ${f.priority} | \`${f.rule}\` | ${f.target} | ${f.issue.replace(/\|/g, '\\|')} |`
)
return [
`# ${title}`,
'',
`${findings.length} issue(s).`,
'',
'| Priority | Rule | Target | Issue |',
'| --- | --- | --- | --- |',
...rows
].join('\n')
}
/**
* Render findings as a standalone HTML page.
*
* @param title - Report heading.
* @param findings - Findings to list.
* @returns HTML document.
*/
function findingsHtml(title: string, findings: Finding[]): string {
const rows = findings
.map(
f =>
`<tr><td>${escapeHtml(f.priority)}</td><td><code>${escapeHtml(f.rule)}</code></td><td>${escapeHtml(f.target)}</td><td>${escapeHtml(f.issue)}</td></tr>`
)
.join('\n')
return `<!doctype html><html lang="en"><head><meta charset="utf-8"><title>${escapeHtml(title)}</title></head><body><h1>${escapeHtml(title)}</h1><table><thead><tr><th>Priority</th><th>Rule</th><th>Target</th><th>Issue</th></tr></thead><tbody>${rows}</tbody></table></body></html>`
}
/**
* Render findings for a terminal.
*
* @param title - Report heading.
* @param findings - Findings to list.
* @returns Lines of text.
*/
function findingsText(title: string, findings: Finding[]): string[] {
if (findings.length === 0) return [title, '', 'No provable static issues found.']
return [
title,
'',
...findings.map(
f => `[${f.priority.toUpperCase()}] ${f.title} (${f.rule}) — ${f.target}\n ${f.issue}`
),
'',
`${findings.length} issue(s). Details: frontendchecklist rule <slug>`
]
}
/**
* Print a findings report in the requested format.
*
* @param format - Output format.
* @param title - Report heading.
* @param findings - Findings to print.
* @param payload - Full JSON payload for `json` output.
*/
export function printFindings(
format: OutputFormat,
title: string,
findings: Finding[],
payload: unknown
): void {
if (format === 'json') {
writeJson(payload)
} else if (format === 'md') {
writeLines([findingsMarkdown(title, findings)])
} else if (format === 'html') {
writeLines([findingsHtml(title, findings)])
} else {
writeLines(findingsText(title, findings))
}
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |