lintpage 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +171 -0
- package/dist/cli.js +2624 -14
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +2618 -12
- package/dist/cli.mjs.map +1 -1
- package/package.json +6 -4
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli.ts","../src/formatter.ts","../src/reporter.ts"],"sourcesContent":["import cac from 'cac';\nimport chalk from 'chalk';\nimport {\n auditPage,\n loadConfig,\n createDefaultConfig,\n type RulePlugin,\n} from '@lintpage/core';\nimport { loadProPlugin, validateLicense } from '@lintpage/pro';\nimport { format, type Format } from './formatter';\nimport { reportResults } from './reporter';\nimport { writeFileSync, readFileSync, existsSync } from 'fs';\nimport { join } from 'path';\n\nconst cli = cac('lintpage');\n\n// Exit codes\nconst EXIT_PASS = 0;\nconst EXIT_FAIL = 1;\nconst EXIT_ERROR = 2;\n\ncli\n .command('<url>', 'Run an audit on a URL')\n .option('--format <format>', 'Output format: text, json, github', {\n default: 'text',\n })\n .option('--fail-on-warning', 'Exit 1 on warnings (not just criticals)')\n .option('--report', 'Send results to dashboard API')\n .option('--quiet', 'Minimal output (counts only)')\n .option('--pro <key>', 'Enable pro rules with license key')\n .action(async (url: string, options: Record<string, unknown>) => {\n const fmt = (options.format as Format) || 'text';\n const failOnWarning = Boolean(options.failOnWarning);\n const report = Boolean(options.report);\n const quiet = Boolean(options.quiet);\n const proKey = (options.pro as string | undefined) || process.env.LINTPAGE_PRO_KEY;\n\n try {\n // Normalize URL\n let targetUrl = url;\n if (!targetUrl.startsWith('http://') && !targetUrl.startsWith('https://')) {\n targetUrl = `https://${targetUrl}`;\n }\n\n // Load config\n const config = loadConfig() ?? undefined;\n\n // Load plugins\n const plugins: RulePlugin[] = [];\n if (proKey) {\n const licenseResult = await validateLicense(proKey);\n if (!licenseResult.valid) {\n console.error(\n chalk.red(`Invalid license key: ${licenseResult.error}`)\n );\n process.exit(EXIT_ERROR);\n }\n plugins.push(loadProPlugin());\n if (!quiet && fmt === 'text') {\n console.log(chalk.dim('Pro rules enabled'));\n }\n }\n\n // Run audit\n if (!quiet && fmt === 'text') {\n console.log(chalk.dim(`Auditing ${targetUrl}...`));\n }\n\n const result = await auditPage(targetUrl, { plugins, config });\n\n // Output\n console.log(format(result, fmt, quiet));\n\n // Report to dashboard\n if (report) {\n const apiUrl =\n process.env.LINTPAGE_API_URL || 'https://lintpage.com';\n const token = process.env.LINTPAGE_API_TOKEN || proKey;\n if (!token) {\n console.error(\n chalk.red(\n 'Missing API token for --report. Set LINTPAGE_API_TOKEN or LINTPAGE_PRO_KEY, or pass --pro <key>.'\n )\n );\n process.exit(EXIT_ERROR);\n }\n try {\n await reportResults(result, { apiUrl, token });\n if (!quiet && fmt === 'text') {\n console.log(chalk.green('Results reported to dashboard'));\n }\n } catch (err) {\n console.error(\n chalk.red(\n `Failed to report: ${err instanceof Error ? err.message : err}`\n )\n );\n process.exit(EXIT_ERROR);\n }\n }\n\n // Exit code\n const hasCritical = result.results.some(\n (r) => r.severity === 'CRITICAL'\n );\n const hasWarning = result.results.some(\n (r) => r.severity === 'WARNING'\n );\n\n if (hasCritical) {\n process.exit(EXIT_FAIL);\n }\n if (failOnWarning && hasWarning) {\n process.exit(EXIT_FAIL);\n }\n process.exit(EXIT_PASS);\n } catch (err) {\n if (fmt === 'json') {\n console.error(\n JSON.stringify({\n error: err instanceof Error ? err.message : String(err),\n })\n );\n } else {\n console.error(\n chalk.red(\n `Error: ${err instanceof Error ? err.message : String(err)}`\n )\n );\n }\n process.exit(EXIT_ERROR);\n }\n });\n\ncli\n .command('init', 'Generate a .lintpagerc.json config file')\n .action(() => {\n const configPath = join(process.cwd(), '.lintpagerc.json');\n if (existsSync(configPath)) {\n console.log(chalk.yellow('.lintpagerc.json already exists'));\n process.exit(EXIT_PASS);\n }\n const config = createDefaultConfig();\n writeFileSync(configPath, JSON.stringify(config, null, 2) + '\\n');\n console.log(chalk.green('Created .lintpagerc.json'));\n process.exit(EXIT_PASS);\n });\n\ncli.help();\n\n// Read version dynamically from package.json\nconst pkgPath = join(__dirname, '..', 'package.json');\nconst pkgJson = existsSync(pkgPath)\n ? JSON.parse(readFileSync(pkgPath, 'utf-8'))\n : { version: '0.0.0' };\ncli.version(pkgJson.version);\n\ncli.parse();\n","import chalk from 'chalk';\nimport type { PageResult, RuleResult, Severity } from '@lintpage/core';\n\nexport type Format = 'text' | 'json' | 'github';\n\n// ── Text formatter ─────────────────────────────────────────────\n\nconst SEVERITY_ICON: Record<Severity, string> = {\n CRITICAL: chalk.red.bold('✗'),\n WARNING: chalk.yellow('⚠'),\n INFO: chalk.blue('ℹ'),\n};\n\nconst SEVERITY_LABEL: Record<Severity, string> = {\n CRITICAL: chalk.red.bold('CRITICAL'),\n WARNING: chalk.yellow('WARNING'),\n INFO: chalk.blue('INFO'),\n};\n\nfunction groupByCategory(results: RuleResult[]): Record<string, RuleResult[]> {\n const groups: Record<string, RuleResult[]> = {};\n for (const r of results) {\n (groups[r.category] ??= []).push(r);\n }\n return groups;\n}\n\nexport function formatText(result: PageResult, quiet: boolean): string {\n const lines: string[] = [];\n\n const statusColor = result.overallStatus === 'PASS' ? chalk.green : chalk.red;\n lines.push('');\n lines.push(\n `${chalk.bold('LintPage')} audit for ${chalk.underline(result.url)}`\n );\n lines.push(\n `Score: ${statusColor.bold(String(result.score))}/100 Status: ${statusColor.bold(result.overallStatus)}`\n );\n lines.push('');\n\n if (result.results.length === 0) {\n lines.push(chalk.green(' No issues found!'));\n lines.push('');\n return lines.join('\\n');\n }\n\n if (quiet) {\n const critical = result.results.filter((r) => r.severity === 'CRITICAL').length;\n const warnings = result.results.filter((r) => r.severity === 'WARNING').length;\n const info = result.results.filter((r) => r.severity === 'INFO').length;\n lines.push(\n ` ${chalk.red.bold(`${critical} critical`)} ${chalk.yellow(`${warnings} warnings`)} ${chalk.blue(`${info} info`)}`\n );\n lines.push('');\n return lines.join('\\n');\n }\n\n // Category scores\n for (const [category, scores] of Object.entries(result.categoryScores)) {\n const pct = scores.max > 0 ? Math.round((scores.score / scores.max) * 100) : 100;\n const color = pct >= 80 ? chalk.green : pct >= 50 ? chalk.yellow : chalk.red;\n lines.push(\n ` ${chalk.bold(category.padEnd(16))} ${color(`${scores.score}/${scores.max}`)} ${chalk.dim(`(${pct}%)`)}`\n );\n }\n lines.push('');\n\n // Issues grouped by category\n const grouped = groupByCategory(result.results);\n for (const [category, issues] of Object.entries(grouped)) {\n lines.push(chalk.bold.underline(` ${category}`));\n for (const issue of issues) {\n lines.push(\n ` ${SEVERITY_ICON[issue.severity]} ${SEVERITY_LABEL[issue.severity].padEnd(20)} ${issue.message}`\n );\n if (issue.fix) {\n lines.push(` ${chalk.dim(issue.fix)}`);\n }\n }\n lines.push('');\n }\n\n return lines.join('\\n');\n}\n\n// ── JSON formatter ─────────────────────────────────────────────\n\nexport function formatJson(result: PageResult): string {\n return JSON.stringify(result, null, 2);\n}\n\n// ── GitHub Actions formatter ───────────────────────────────────\n\nconst GH_LEVEL: Record<Severity, string> = {\n CRITICAL: 'error',\n WARNING: 'warning',\n INFO: 'notice',\n};\n\nexport function formatGithub(result: PageResult): string {\n const lines: string[] = [];\n\n for (const issue of result.results) {\n const level = GH_LEVEL[issue.severity];\n const title = `[${issue.ruleId}] ${issue.ruleName}`;\n // GitHub annotation format: ::level title=TITLE::MESSAGE\n lines.push(`::${level} title=${title}::${issue.message}`);\n }\n\n // Summary annotation\n const statusEmoji = result.overallStatus === 'PASS' ? '✅' : '❌';\n lines.push(\n `::notice title=LintPage Score::${statusEmoji} ${result.url} — Score: ${result.score}/100 (${result.overallStatus})`\n );\n\n return lines.join('\\n');\n}\n\n// ── Dispatcher ─────────────────────────────────────────────────\n\nexport function format(\n result: PageResult,\n fmt: Format,\n quiet: boolean\n): string {\n switch (fmt) {\n case 'json':\n return formatJson(result);\n case 'github':\n return formatGithub(result);\n case 'text':\n default:\n return formatText(result, quiet);\n }\n}\n","import type { PageResult } from '@lintpage/core';\n\nexport interface ReportOptions {\n apiUrl: string;\n token: string;\n}\n\nexport async function reportResults(\n result: PageResult,\n options: ReportOptions\n): Promise<void> {\n const url = options.apiUrl.replace(/\\/$/, '') + '/api/v1/reports';\n\n const response = await fetch(url, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: `Bearer ${options.token}`,\n },\n body: JSON.stringify(result),\n });\n\n if (!response.ok) {\n const body = await response.text().catch(() => '');\n throw new Error(\n `Failed to report results: ${response.status} ${response.statusText}${body ? ` — ${body}` : ''}`\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iBAAgB;AAChB,IAAAA,gBAAkB;AAClB,kBAKO;AACP,iBAA+C;;;ACR/C,mBAAkB;AAOlB,IAAM,gBAA0C;AAAA,EAC9C,UAAU,aAAAC,QAAM,IAAI,KAAK,QAAG;AAAA,EAC5B,SAAS,aAAAA,QAAM,OAAO,QAAG;AAAA,EACzB,MAAM,aAAAA,QAAM,KAAK,QAAG;AACtB;AAEA,IAAM,iBAA2C;AAAA,EAC/C,UAAU,aAAAA,QAAM,IAAI,KAAK,UAAU;AAAA,EACnC,SAAS,aAAAA,QAAM,OAAO,SAAS;AAAA,EAC/B,MAAM,aAAAA,QAAM,KAAK,MAAM;AACzB;AAEA,SAAS,gBAAgB,SAAqD;AAC5E,QAAM,SAAuC,CAAC;AAC9C,aAAW,KAAK,SAAS;AACvB,KAAC,OAAO,EAAE,QAAQ,MAAM,CAAC,GAAG,KAAK,CAAC;AAAA,EACpC;AACA,SAAO;AACT;AAEO,SAAS,WAAW,QAAoB,OAAwB;AACrE,QAAM,QAAkB,CAAC;AAEzB,QAAM,cAAc,OAAO,kBAAkB,SAAS,aAAAA,QAAM,QAAQ,aAAAA,QAAM;AAC1E,QAAM,KAAK,EAAE;AACb,QAAM;AAAA,IACJ,GAAG,aAAAA,QAA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SAAS;AACxB,CAAC;AAEH,IAAI,KAAK;AAGT,IAAM,cAAU,kBAAK,WAAW,MAAM,cAAc;AACpD,IAAM,cAAU,sBAAW,OAAO,IAC9B,KAAK,UAAM,wBAAa,SAAS,OAAO,CAAC,IACzC,EAAE,SAAS,QAAQ;AACvB,IAAI,QAAQ,QAAQ,OAAO;AAE3B,IAAI,MAAM;","names":["import_chalk","chalk","cac","chalk"]}
|
|
1
|
+
{"version":3,"sources":["../src/cli.ts","../../core/src/rules/title.ts","../../core/src/rules/meta-description.ts","../../core/src/rules/og-title.ts","../../core/src/rules/og-description.ts","../../core/src/rules/og-image.ts","../../core/src/rules/og-url.ts","../../core/src/rules/twitter-card.ts","../../core/src/rules/canonical-url.ts","../../core/src/rules/robots-noindex.ts","../../core/src/rules/heading-structure.ts","../../core/src/rules/html-lang.ts","../../core/src/rules/viewport.ts","../../core/src/rules/favicon.ts","../../core/src/rules/index.ts","../../core/src/fetcher.ts","../../core/src/runner.ts","../../core/src/config.ts","../../core/src/utils.ts","../../pro/src/rules/ssl.ts","../../pro/src/rules/robots-txt-check.ts","../../pro/src/rules/sitemap-presence.ts","../../pro/src/rules/tracking.ts","../../pro/src/rules/x-robots-tag.ts","../../pro/src/rules/thin-content.ts","../../pro/src/rules/duplicate-meta.ts","../../pro/src/rules/structured-data.ts","../../pro/src/rules/charset.ts","../../pro/src/rules/image-alt-text.ts","../../pro/src/rules/accessibility.ts","../../pro/src/rules/semantic-structure.ts","../../pro/src/rules/performance.ts","../../pro/src/rules/image-dimensions.ts","../../pro/src/rules/ttfb.ts","../../pro/src/rules/mixed-content.ts","../../pro/src/rules/security-headers.ts","../../pro/src/rules/og-image-size.ts","../../pro/src/rules/og-image-type.ts","../../pro/src/rules/twitter-image.ts","../../pro/src/rules/social-preview-render.ts","../../pro/src/rules/title-keyword-stuffing.ts","../../pro/src/rules/content-to-html-ratio.ts","../../pro/src/rules/title-uniqueness.ts","../../pro/src/rules/description-uniqueness.ts","../../pro/src/rules/structured-data-validate.ts","../../pro/src/rules/hreflang.ts","../../pro/src/rules/canonical-self-referencing.ts","../../pro/src/rules/meta-render-blocking.ts","../../pro/src/rules/lazy-load-lcp.ts","../../pro/src/rules/https-links.ts","../../pro/src/rules/meta-refresh-redirect.ts","../../pro/src/rules/nofollow-audit.ts","../../pro/src/rules/index.ts","../../pro/src/license.ts","../../pro/src/index.ts","../src/formatter.ts","../src/reporter.ts"],"sourcesContent":["import cac from 'cac';\nimport chalk from 'chalk';\nimport {\n auditPage,\n loadConfig,\n createDefaultConfig,\n type RulePlugin,\n} from '@lintpage/core';\nimport { loadProPlugin, validateLicense } from '@lintpage/pro';\nimport { format, type Format } from './formatter';\nimport { reportResults } from './reporter';\nimport { writeFileSync, readFileSync, existsSync } from 'fs';\nimport { join } from 'path';\n\nconst cli = cac('lintpage');\n\n// Exit codes\nconst EXIT_PASS = 0;\nconst EXIT_FAIL = 1;\nconst EXIT_ERROR = 2;\n\ncli\n .command('<url>', 'Run an audit on a URL')\n .option('--format <format>', 'Output format: text, json, github', {\n default: 'text',\n })\n .option('--fail-on-warning', 'Exit 1 on warnings (not just criticals)')\n .option('--report', 'Send results to dashboard API')\n .option('--quiet', 'Minimal output (counts only)')\n .option('--pro <key>', 'Enable pro rules with license key')\n .action(async (url: string, options: Record<string, unknown>) => {\n const fmt = (options.format as Format) || 'text';\n const failOnWarning = Boolean(options.failOnWarning);\n const report = Boolean(options.report);\n const quiet = Boolean(options.quiet);\n const proKey = (options.pro as string | undefined) || process.env.LINTPAGE_PRO_KEY;\n\n try {\n // Normalize URL\n let targetUrl = url;\n if (!targetUrl.startsWith('http://') && !targetUrl.startsWith('https://')) {\n targetUrl = `https://${targetUrl}`;\n }\n\n // Load config\n const config = loadConfig() ?? undefined;\n\n // Load plugins\n const plugins: RulePlugin[] = [];\n if (proKey) {\n const licenseResult = await validateLicense(proKey);\n if (!licenseResult.valid) {\n console.error(\n chalk.red(`Invalid license key: ${licenseResult.error}`)\n );\n process.exit(EXIT_ERROR);\n }\n plugins.push(loadProPlugin());\n if (!quiet && fmt === 'text') {\n console.log(chalk.dim('Pro rules enabled'));\n }\n }\n\n // Run audit\n if (!quiet && fmt === 'text') {\n console.log(chalk.dim(`Auditing ${targetUrl}...`));\n }\n\n const result = await auditPage(targetUrl, { plugins, config });\n\n // Output\n console.log(format(result, fmt, quiet));\n\n // Report to dashboard\n if (report) {\n const apiUrl =\n process.env.LINTPAGE_API_URL || 'https://lintpage.com';\n const token = process.env.LINTPAGE_API_TOKEN || proKey;\n if (!token) {\n console.error(\n chalk.red(\n 'Missing API token for --report. Set LINTPAGE_API_TOKEN or LINTPAGE_PRO_KEY, or pass --pro <key>.'\n )\n );\n process.exit(EXIT_ERROR);\n }\n try {\n await reportResults(result, { apiUrl, token });\n if (!quiet && fmt === 'text') {\n console.log(chalk.green('Results reported to dashboard'));\n }\n } catch (err) {\n console.error(\n chalk.red(\n `Failed to report: ${err instanceof Error ? err.message : err}`\n )\n );\n process.exit(EXIT_ERROR);\n }\n }\n\n // Exit code\n const hasCritical = result.results.some(\n (r) => r.severity === 'CRITICAL'\n );\n const hasWarning = result.results.some(\n (r) => r.severity === 'WARNING'\n );\n\n if (hasCritical) {\n process.exit(EXIT_FAIL);\n }\n if (failOnWarning && hasWarning) {\n process.exit(EXIT_FAIL);\n }\n process.exit(EXIT_PASS);\n } catch (err) {\n if (fmt === 'json') {\n console.error(\n JSON.stringify({\n error: err instanceof Error ? err.message : String(err),\n })\n );\n } else {\n console.error(\n chalk.red(\n `Error: ${err instanceof Error ? err.message : String(err)}`\n )\n );\n }\n process.exit(EXIT_ERROR);\n }\n });\n\ncli\n .command('init', 'Generate a .lintpagerc.json config file')\n .action(() => {\n const configPath = join(process.cwd(), '.lintpagerc.json');\n if (existsSync(configPath)) {\n console.log(chalk.yellow('.lintpagerc.json already exists'));\n process.exit(EXIT_PASS);\n }\n const config = createDefaultConfig();\n writeFileSync(configPath, JSON.stringify(config, null, 2) + '\\n');\n console.log(chalk.green('Created .lintpagerc.json'));\n process.exit(EXIT_PASS);\n });\n\ncli.help();\n\n// Read version dynamically from package.json\nconst pkgPath = join(__dirname, '..', 'package.json');\nconst pkgJson = existsSync(pkgPath)\n ? JSON.parse(readFileSync(pkgPath, 'utf-8'))\n : { version: '0.0.0' };\ncli.version(pkgJson.version);\n\ncli.parse();\n","import type { Rule, RuleContext, RuleResult } from '../types';\n\nexport const titleRule: Rule = {\n meta: {\n id: 'title',\n name: 'Page Title',\n category: 'SEO',\n tier: 'free',\n description: 'Checks for the presence and length of the <title> tag',\n },\n run(context: RuleContext): RuleResult[] {\n const { document } = context;\n const results: RuleResult[] = [];\n\n const titleElement = document.querySelector('title');\n const value = titleElement?.textContent?.trim() || '';\n const length = value.length;\n\n if (!value) {\n results.push({\n ruleId: 'title',\n ruleName: 'Page Title',\n message: 'Missing title tag',\n severity: 'WARNING',\n category: 'SEO',\n tier: 'free',\n fix: 'Add a <title>Your Page Title</title> tag inside your <head> element. Keep it 50-60 characters.',\n data: { value, length },\n });\n } else if (length < 30) {\n results.push({\n ruleId: 'title',\n ruleName: 'Page Title',\n message: 'Title is too short (recommended: 50-60 characters)',\n severity: 'WARNING',\n category: 'SEO',\n tier: 'free',\n fix: 'Expand your title to 50-60 characters. Include your primary keyword and make it compelling for click-through.',\n data: { value, length },\n });\n } else if (length > 60) {\n results.push({\n ruleId: 'title',\n ruleName: 'Page Title',\n message: 'Title is too long (recommended: 50-60 characters)',\n severity: 'WARNING',\n category: 'SEO',\n tier: 'free',\n fix: 'Shorten your title to under 60 characters to prevent truncation in search results.',\n data: { value, length },\n });\n }\n\n return results;\n },\n};\n","import type { Rule, RuleContext, RuleResult } from '../types';\n\nexport const metaDescriptionRule: Rule = {\n meta: {\n id: 'meta-description',\n name: 'Meta Description',\n category: 'SEO',\n tier: 'free',\n description: 'Checks for the presence and length of the meta description tag',\n },\n run(context: RuleContext): RuleResult[] {\n const { document } = context;\n const results: RuleResult[] = [];\n\n const metaDesc = document.querySelector('meta[name=\"description\"]');\n const value = metaDesc?.getAttribute('content')?.trim() || '';\n const length = value.length;\n\n if (!value) {\n results.push({\n ruleId: 'meta-description',\n ruleName: 'Meta Description',\n message: 'Missing meta description',\n severity: 'WARNING',\n category: 'SEO',\n tier: 'free',\n fix: 'Add <meta name=\"description\" content=\"Your description here\" /> to your <head> tag. Aim for 150-160 characters.',\n data: { value, length },\n });\n } else if (length < 120) {\n results.push({\n ruleId: 'meta-description',\n ruleName: 'Meta Description',\n message: 'Meta description is too short (recommended: 150-160 characters)',\n severity: 'WARNING',\n category: 'SEO',\n tier: 'free',\n fix: 'Expand your meta description to 150-160 characters. Include a compelling summary with your target keyword.',\n data: { value, length },\n });\n } else if (length > 160) {\n results.push({\n ruleId: 'meta-description',\n ruleName: 'Meta Description',\n message: 'Meta description is too long (recommended: 150-160 characters)',\n severity: 'WARNING',\n category: 'SEO',\n tier: 'free',\n fix: 'Shorten your meta description to under 160 characters to prevent truncation in search results.',\n data: { value, length },\n });\n }\n\n return results;\n },\n};\n","import type { Rule, RuleContext, RuleResult } from '../types';\n\nexport const ogTitleRule: Rule = {\n meta: {\n id: 'og-title',\n name: 'Open Graph Title',\n category: 'SEO',\n tier: 'free',\n description: 'Checks for the og:title meta tag',\n },\n run(context: RuleContext): RuleResult[] {\n const { document } = context;\n const results: RuleResult[] = [];\n\n const ogTitle = document.querySelector('meta[property=\"og:title\"]');\n if (!ogTitle?.getAttribute('content')) {\n results.push({\n ruleId: 'og-title',\n ruleName: 'Open Graph Title',\n message: 'Missing og:title tag - social media shares will have no title preview',\n severity: 'WARNING',\n category: 'SEO',\n tier: 'free',\n fix: 'Add <meta property=\"og:title\" content=\"Your Page Title\" /> to your <head> tag.',\n });\n }\n\n return results;\n },\n};\n","import type { Rule, RuleContext, RuleResult } from '../types';\n\nexport const ogDescriptionRule: Rule = {\n meta: {\n id: 'og-description',\n name: 'Open Graph Description',\n category: 'SEO',\n tier: 'free',\n description: 'Checks for the og:description meta tag',\n },\n run(context: RuleContext): RuleResult[] {\n const { document } = context;\n const results: RuleResult[] = [];\n\n const ogDesc = document.querySelector('meta[property=\"og:description\"]');\n if (!ogDesc?.getAttribute('content')) {\n results.push({\n ruleId: 'og-description',\n ruleName: 'Open Graph Description',\n message: 'Missing og:description tag - social media shares will have no description preview',\n severity: 'WARNING',\n category: 'SEO',\n tier: 'free',\n fix: 'Add <meta property=\"og:description\" content=\"Your description\" /> to your <head> tag.',\n });\n }\n\n return results;\n },\n};\n","import type { Rule, RuleContext, RuleResult } from '../types';\n\nexport const ogImageRule: Rule = {\n meta: {\n id: 'og-image',\n name: 'Open Graph Image',\n category: 'SEO',\n tier: 'free',\n description: 'Checks for the og:image meta tag',\n },\n run(context: RuleContext): RuleResult[] {\n const { document } = context;\n const results: RuleResult[] = [];\n\n const ogImage = document.querySelector('meta[property=\"og:image\"]');\n if (!ogImage?.getAttribute('content')) {\n results.push({\n ruleId: 'og-image',\n ruleName: 'Open Graph Image',\n message: 'Missing og:image tag - social media shares will have no image preview',\n severity: 'WARNING',\n category: 'SEO',\n tier: 'free',\n fix: 'Add <meta property=\"og:image\" content=\"https://yoursite.com/image.jpg\" /> to your <head> tag.',\n });\n }\n\n return results;\n },\n};\n","import type { Rule, RuleContext, RuleResult } from '../types';\n\nexport const ogUrlRule: Rule = {\n meta: {\n id: 'og-url',\n name: 'Open Graph URL',\n category: 'SEO',\n tier: 'free',\n description: 'Checks for the og:url meta tag',\n },\n run(context: RuleContext): RuleResult[] {\n const { document } = context;\n const results: RuleResult[] = [];\n\n const ogUrl = document.querySelector('meta[property=\"og:url\"]');\n if (!ogUrl?.getAttribute('content')) {\n results.push({\n ruleId: 'og-url',\n ruleName: 'Open Graph URL',\n message: 'Missing og:url tag - social media may not show the correct URL',\n severity: 'WARNING',\n category: 'SEO',\n tier: 'free',\n fix: 'Add <meta property=\"og:url\" content=\"https://yoursite.com/page\" /> to your <head> tag.',\n });\n }\n\n return results;\n },\n};\n","import type { Rule, RuleContext, RuleResult } from '../types';\n\nexport const twitterCardRule: Rule = {\n meta: {\n id: 'twitter-card',\n name: 'Twitter Card',\n category: 'SEO',\n tier: 'free',\n description: 'Checks for Twitter Card meta tags',\n },\n run(context: RuleContext): RuleResult[] {\n const { document } = context;\n const results: RuleResult[] = [];\n\n const twitterCard = document.querySelector('meta[name=\"twitter:card\"]');\n if (!twitterCard?.getAttribute('content')) {\n results.push({\n ruleId: 'twitter-card',\n ruleName: 'Twitter Card',\n message: 'Missing Twitter Card tags - tweets with your URL will have no preview card',\n severity: 'WARNING',\n category: 'SEO',\n tier: 'free',\n fix: 'Add <meta name=\"twitter:card\" content=\"summary_large_image\" />, <meta name=\"twitter:title\" content=\"...\" />, and <meta name=\"twitter:image\" content=\"...\" /> to your <head>.',\n });\n }\n\n return results;\n },\n};\n","import type { Rule, RuleContext, RuleResult } from '../types';\n\nexport const canonicalUrlRule: Rule = {\n meta: {\n id: 'canonical-url',\n name: 'Canonical URL',\n category: 'SEO',\n tier: 'free',\n description: 'Checks for a canonical link tag and validates the URL',\n },\n run(context: RuleContext): RuleResult[] {\n const { document } = context;\n const results: RuleResult[] = [];\n\n const canonical = document.querySelector('link[rel=\"canonical\"]');\n const value = canonical?.getAttribute('href') || undefined;\n\n if (!canonical) {\n results.push({\n ruleId: 'canonical-url',\n ruleName: 'Canonical URL',\n message: 'No canonical link found (recommended for SEO)',\n severity: 'INFO',\n category: 'SEO',\n tier: 'free',\n fix: 'Add <link rel=\"canonical\" href=\"https://yoursite.com/this-page\" /> to your <head> tag to prevent duplicate content issues.',\n data: { present: false },\n });\n } else if (value && !value.startsWith('http')) {\n results.push({\n ruleId: 'canonical-url',\n ruleName: 'Canonical URL',\n message: 'Canonical URL should be absolute (include protocol and domain)',\n severity: 'WARNING',\n category: 'SEO',\n tier: 'free',\n fix: 'Change your canonical href to an absolute URL starting with https:// (e.g., href=\"https://yoursite.com/page\").',\n data: { present: true, value },\n });\n }\n\n return results;\n },\n};\n","import type { Rule, RuleContext, RuleResult } from '../types';\n\nexport const robotsNoindexRule: Rule = {\n meta: {\n id: 'robots-noindex',\n name: 'Robots Noindex',\n category: 'Pre-Launch',\n tier: 'free',\n description: 'Checks for noindex/nofollow in the robots meta tag',\n },\n run(context: RuleContext): RuleResult[] {\n const { document } = context;\n const results: RuleResult[] = [];\n\n const metaRobots = document.querySelector('meta[name=\"robots\"]');\n const content = metaRobots?.getAttribute('content') || '';\n\n if (content.includes('noindex')) {\n results.push({\n ruleId: 'robots-noindex',\n ruleName: 'Robots Noindex',\n message: \"Page has noindex meta tag - WILL NOT BE INDEXED by search engines! Remove this before launch or you'll get ZERO organic traffic.\",\n severity: 'CRITICAL',\n category: 'Pre-Launch',\n tier: 'free',\n fix: 'Remove the <meta name=\"robots\" content=\"noindex\" /> tag from your <head>, or change it to content=\"index, follow\".',\n data: { metaRobots: content },\n });\n }\n\n if (content.includes('nofollow')) {\n results.push({\n ruleId: 'robots-noindex',\n ruleName: 'Robots Noindex',\n message: 'Page has nofollow meta tag - links will not be followed',\n severity: 'WARNING',\n category: 'SEO',\n tier: 'free',\n fix: 'Remove \"nofollow\" from your <meta name=\"robots\"> content if you want search engines to follow your links.',\n data: { metaRobots: content },\n });\n }\n\n return results;\n },\n};\n","import type { Rule, RuleContext, RuleResult } from '../types';\n\nexport const headingStructureRule: Rule = {\n meta: {\n id: 'heading-structure',\n name: 'Heading Structure',\n category: 'SEO',\n tier: 'free',\n description: 'Validates H1 tag presence, count, and heading hierarchy',\n },\n run(context: RuleContext): RuleResult[] {\n const { document } = context;\n const results: RuleResult[] = [];\n\n // Check H1 tags\n const h1Elements = document.querySelectorAll('h1');\n const count = h1Elements.length;\n const values = Array.from(h1Elements).map(\n (h1) => h1.textContent?.trim() || ''\n );\n\n if (count === 0) {\n results.push({\n ruleId: 'heading-structure',\n ruleName: 'Heading Structure',\n message: 'No H1 tag found',\n severity: 'WARNING',\n category: 'SEO',\n tier: 'free',\n fix: 'Add a single <h1> tag to your page with a clear, descriptive heading that includes your primary keyword.',\n data: { h1Count: count },\n });\n } else if (count > 1) {\n results.push({\n ruleId: 'heading-structure',\n ruleName: 'Heading Structure',\n message: `Multiple H1 tags found (${count}). Recommended: 1 per page`,\n severity: 'WARNING',\n category: 'SEO',\n tier: 'free',\n fix: 'Keep only one <h1> tag per page. Use <h2>-<h6> for subheadings.',\n data: { h1Count: count, h1Values: values },\n });\n }\n\n values.forEach((value, index) => {\n if (!value) {\n results.push({\n ruleId: 'heading-structure',\n ruleName: 'Heading Structure',\n message: `H1 #${index + 1} is empty`,\n severity: 'WARNING',\n category: 'SEO',\n tier: 'free',\n fix: 'Add descriptive text content to your <h1> tag.',\n });\n } else if (value.length > 70) {\n results.push({\n ruleId: 'heading-structure',\n ruleName: 'Heading Structure',\n message: `H1 #${index + 1} is too long (${value.length} characters)`,\n severity: 'INFO',\n category: 'SEO',\n tier: 'free',\n fix: 'Shorten your H1 to under 70 characters for better readability and SEO.',\n });\n }\n });\n\n // Check heading hierarchy\n const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');\n let lastLevel = 0;\n\n Array.from(headings).forEach((heading) => {\n const level = Number.parseInt(heading.tagName[1] ?? '1', 10);\n if (level - lastLevel > 1) {\n const text = heading.textContent?.trim().substring(0, 40) || '...';\n results.push({\n ruleId: 'heading-structure',\n ruleName: 'Heading Structure',\n message: `${heading.tagName} skips heading level from h${lastLevel} (content: \"${text}\")`,\n severity: 'INFO',\n category: 'SEO',\n tier: 'free',\n fix: `Don't skip heading levels. Use h${lastLevel + 1} instead of ${heading.tagName} to maintain proper hierarchy.`,\n });\n }\n lastLevel = level;\n });\n\n return results;\n },\n};\n","import type { Rule, RuleContext, RuleResult } from '../types';\n\nexport const htmlLangRule: Rule = {\n meta: {\n id: 'html-lang',\n name: 'HTML Lang Attribute',\n category: 'Accessibility',\n tier: 'free',\n description: 'Checks for the lang attribute on the <html> tag',\n },\n run(context: RuleContext): RuleResult[] {\n const { document } = context;\n const results: RuleResult[] = [];\n\n const html = document.documentElement;\n const lang = html.getAttribute('lang');\n\n if (!lang) {\n results.push({\n ruleId: 'html-lang',\n ruleName: 'HTML Lang Attribute',\n message: 'Missing lang attribute on <html> tag',\n severity: 'WARNING',\n category: 'Accessibility',\n tier: 'free',\n fix: 'Add lang=\"en\" (or your language code) to your <html> tag: <html lang=\"en\">.',\n data: { present: false },\n });\n }\n\n return results;\n },\n};\n","import type { Rule, RuleContext, RuleResult } from '../types';\n\nexport const viewportRule: Rule = {\n meta: {\n id: 'viewport',\n name: 'Viewport Meta Tag',\n category: 'SEO',\n tier: 'free',\n description: 'Checks for the viewport meta tag for mobile responsiveness',\n },\n run(context: RuleContext): RuleResult[] {\n const { document } = context;\n const results: RuleResult[] = [];\n\n const viewport = document.querySelector('meta[name=\"viewport\"]');\n\n if (!viewport) {\n results.push({\n ruleId: 'viewport',\n ruleName: 'Viewport Meta Tag',\n message: 'Missing viewport meta tag - page will not render properly on mobile devices',\n severity: 'WARNING',\n category: 'SEO',\n tier: 'free',\n fix: 'Add <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" /> to your <head> tag.',\n data: { present: false },\n });\n }\n\n return results;\n },\n};\n","import type { Rule, RuleContext, RuleResult } from '../types';\n\nexport const faviconRule: Rule = {\n meta: {\n id: 'favicon',\n name: 'Favicon',\n category: 'SEO',\n tier: 'free',\n description: 'Checks for the presence of a favicon link tag',\n },\n run(context: RuleContext): RuleResult[] {\n const { document } = context;\n const results: RuleResult[] = [];\n\n const favicon = document.querySelector('link[rel*=\"icon\"]');\n\n if (!favicon) {\n results.push({\n ruleId: 'favicon',\n ruleName: 'Favicon',\n message: 'No favicon found - browsers will show a default icon in tabs and bookmarks',\n severity: 'WARNING',\n category: 'SEO',\n tier: 'free',\n fix: 'Add <link rel=\"icon\" href=\"/favicon.ico\" /> to your <head> tag. Include multiple sizes for best results.',\n data: { present: false },\n });\n }\n\n return results;\n },\n};\n","import type { Rule } from '../types';\nimport { titleRule } from './title';\nimport { metaDescriptionRule } from './meta-description';\nimport { ogTitleRule } from './og-title';\nimport { ogDescriptionRule } from './og-description';\nimport { ogImageRule } from './og-image';\nimport { ogUrlRule } from './og-url';\nimport { twitterCardRule } from './twitter-card';\nimport { canonicalUrlRule } from './canonical-url';\nimport { robotsNoindexRule } from './robots-noindex';\nimport { headingStructureRule } from './heading-structure';\nimport { htmlLangRule } from './html-lang';\nimport { viewportRule } from './viewport';\nimport { faviconRule } from './favicon';\n\nexport const coreRules: Rule[] = [\n titleRule,\n metaDescriptionRule,\n ogTitleRule,\n ogDescriptionRule,\n ogImageRule,\n ogUrlRule,\n twitterCardRule,\n canonicalUrlRule,\n robotsNoindexRule,\n headingStructureRule,\n htmlLangRule,\n viewportRule,\n faviconRule,\n];\n\nexport const ruleRegistry = new Map<string, Rule>(\n coreRules.map((rule) => [rule.meta.id, rule])\n);\n\nexport {\n titleRule,\n metaDescriptionRule,\n ogTitleRule,\n ogDescriptionRule,\n ogImageRule,\n ogUrlRule,\n twitterCardRule,\n canonicalUrlRule,\n robotsNoindexRule,\n headingStructureRule,\n htmlLangRule,\n viewportRule,\n faviconRule,\n};\n","import { JSDOM } from 'jsdom';\n\nexport interface FetchResult {\n document: Document;\n response: Response;\n html: string;\n ttfbMs: number;\n}\n\nexport async function fetchPage(url: string): Promise<FetchResult> {\n const fetchStart = Date.now();\n\n const response = await fetch(url, {\n headers: {\n 'User-Agent': 'LintPage-Bot/1.0',\n },\n signal: AbortSignal.timeout(30_000),\n });\n\n const ttfbMs = Date.now() - fetchStart;\n\n if (!response.ok) {\n throw new Error(\n `Failed to fetch URL: ${response.status} ${response.statusText}`\n );\n }\n\n const html = await response.text();\n const dom = new JSDOM(html);\n\n return {\n document: dom.window.document,\n response,\n html,\n ttfbMs,\n };\n}\n","import type {\n Rule,\n StandaloneRule,\n RulePlugin,\n RuleResult,\n RuleContext,\n PageResult,\n AuditResult,\n LintPageConfig,\n} from './types';\nimport { coreRules } from './rules';\nimport { fetchPage } from './fetcher';\n\nconst CATEGORY_WEIGHTS: Record<string, number> = {\n 'Pre-Launch': 30,\n SEO: 35,\n Accessibility: 20,\n Performance: 15,\n};\n\nexport function calculateCategoryScores(\n results: RuleResult[]\n): Record<string, { score: number; max: number; deductionPercent: number }> {\n const categoryIssues: Record<\n string,\n { critical: number; warning: number; info: number }\n > = {};\n for (const category of Object.keys(CATEGORY_WEIGHTS)) {\n categoryIssues[category] = { critical: 0, warning: 0, info: 0 };\n }\n\n for (const result of results) {\n const cat = result.category;\n if (!categoryIssues[cat]) {\n categoryIssues[cat] = { critical: 0, warning: 0, info: 0 };\n }\n if (result.severity === 'CRITICAL') categoryIssues[cat].critical++;\n else if (result.severity === 'WARNING') categoryIssues[cat].warning++;\n else categoryIssues[cat].info++;\n }\n\n const scores: Record<\n string,\n { score: number; max: number; deductionPercent: number }\n > = {};\n for (const [category, weight] of Object.entries(CATEGORY_WEIGHTS)) {\n const counts = categoryIssues[category] || {\n critical: 0,\n warning: 0,\n info: 0,\n };\n const deductionPercent = Math.min(\n 100,\n counts.critical * 30 + counts.warning * 5 + counts.info * 1\n );\n scores[category] = {\n score:\n Math.round(weight * (1 - deductionPercent / 100) * 10) / 10,\n max: weight,\n deductionPercent,\n };\n }\n\n return scores;\n}\n\nexport function calculateScore(results: RuleResult[]): number {\n const categoryScores = calculateCategoryScores(results);\n const total = Object.values(categoryScores).reduce(\n (sum, cat) => sum + cat.score,\n 0\n );\n return Math.round(total);\n}\n\nexport function runRules(\n rules: Rule[],\n context: RuleContext,\n config?: LintPageConfig\n): RuleResult[] {\n const results: RuleResult[] = [];\n\n for (const rule of rules) {\n // Check if rule is disabled in config\n if (config?.rules) {\n const ruleConfig = config.rules[rule.meta.id];\n if (ruleConfig === false) continue;\n if (\n typeof ruleConfig === 'object' &&\n ruleConfig.enabled === false\n )\n continue;\n }\n\n try {\n const ruleResults = rule.run(context);\n results.push(...ruleResults);\n } catch (err) {\n console.warn(\n `[lintpage] Rule \"${rule.meta.id}\" threw an error: ${err instanceof Error ? err.message : String(err)}`\n );\n }\n }\n\n return results;\n}\n\nexport async function runStandaloneRules(\n rules: StandaloneRule[],\n url: string,\n config?: LintPageConfig\n): Promise<RuleResult[]> {\n const results: RuleResult[] = [];\n\n for (const rule of rules) {\n if (config?.rules) {\n const ruleConfig = config.rules[rule.meta.id];\n if (ruleConfig === false) continue;\n if (\n typeof ruleConfig === 'object' &&\n ruleConfig.enabled === false\n )\n continue;\n }\n\n try {\n const ruleResults = await rule.run(url);\n results.push(...ruleResults);\n } catch (err) {\n console.warn(\n `[lintpage] Standalone rule \"${rule.meta.id}\" threw an error: ${err instanceof Error ? err.message : String(err)}`\n );\n }\n }\n\n return results;\n}\n\nexport async function auditPage(\n url: string,\n options?: {\n plugins?: RulePlugin[];\n config?: LintPageConfig;\n }\n): Promise<PageResult> {\n const { document, response, ttfbMs } = await fetchPage(url);\n const isHttps = url.startsWith('https://');\n\n const context: RuleContext = {\n document,\n url,\n response,\n isHttps,\n };\n\n // Run core rules\n const allRules: Rule[] = [...coreRules];\n const allStandaloneRules: StandaloneRule[] = [];\n\n // Add plugin rules\n if (options?.plugins) {\n for (const plugin of options.plugins) {\n allRules.push(...plugin.rules);\n if (plugin.standaloneRules) {\n allStandaloneRules.push(...plugin.standaloneRules);\n }\n }\n }\n\n const results = runRules(allRules, context, options?.config);\n\n // Run standalone rules (make their own HTTP requests)\n if (allStandaloneRules.length > 0) {\n const standaloneResults = await runStandaloneRules(\n allStandaloneRules,\n url,\n options?.config\n );\n results.push(...standaloneResults);\n }\n\n // Add TTFB as a result if significant\n if (ttfbMs > 2000) {\n results.push({\n ruleId: 'ttfb',\n ruleName: 'Time to First Byte',\n message: `Slow server response time (TTFB: ${ttfbMs}ms) - aim for under 800ms`,\n severity: 'WARNING',\n category: 'Performance',\n tier: 'free',\n fix: 'Optimize server response time: enable caching, use a CDN, optimize database queries, or upgrade hosting.',\n data: { ms: ttfbMs },\n });\n } else if (ttfbMs > 800) {\n results.push({\n ruleId: 'ttfb',\n ruleName: 'Time to First Byte',\n message: `Server response time could be improved (TTFB: ${ttfbMs}ms) - aim for under 800ms`,\n severity: 'INFO',\n category: 'Performance',\n tier: 'free',\n fix: 'Consider enabling server-side caching or using a CDN to reduce response time.',\n data: { ms: ttfbMs },\n });\n }\n\n const categoryScores = calculateCategoryScores(results);\n const score = Object.values(categoryScores).reduce(\n (sum, cat) => sum + cat.score,\n 0\n );\n const hasCritical = results.some((r) => r.severity === 'CRITICAL');\n\n return {\n url,\n timestamp: new Date().toISOString(),\n results,\n score: Math.round(score),\n overallStatus: hasCritical ? 'FAIL' : 'PASS',\n categoryScores,\n };\n}\n\nexport async function audit(\n urls: string[],\n options?: {\n plugins?: RulePlugin[];\n config?: LintPageConfig;\n }\n): Promise<AuditResult> {\n const pages: PageResult[] = [];\n\n for (const url of urls) {\n const page = await auditPage(url, options);\n pages.push(page);\n }\n\n return {\n pages,\n timestamp: new Date().toISOString(),\n };\n}\n","import type { LintPageConfig } from './types';\nimport { readFileSync, existsSync } from 'fs';\nimport { join } from 'path';\n\nconst CONFIG_FILES = [\n '.lintpagerc.json',\n '.lintpagerc',\n 'lintpage.config.json',\n];\n\nexport function loadConfig(cwd?: string): LintPageConfig | null {\n const dir = cwd || process.cwd();\n\n for (const file of CONFIG_FILES) {\n const path = join(dir, file);\n if (existsSync(path)) {\n try {\n const content = readFileSync(path, 'utf-8');\n return JSON.parse(content) as LintPageConfig;\n } catch {\n return null;\n }\n }\n }\n\n return null;\n}\n\nexport function createDefaultConfig(): LintPageConfig {\n return {\n rules: {},\n };\n}\n","export function getElementIdentifier(\n element: Element,\n index: number,\n tagName: string\n): string {\n const parts: string[] = [`${tagName} #${index + 1}`];\n\n const id = element.getAttribute('id');\n if (id) {\n parts.push(`id=\"${id}\"`);\n }\n\n const classes = element.getAttribute('class');\n if (classes) {\n const firstClass = classes.trim().split(/\\s+/)[0];\n if (firstClass) {\n parts.push(`class=\"${firstClass}\"`);\n }\n }\n\n const text = element.textContent?.trim();\n if (text && text.length > 0) {\n const preview = text.length > 40 ? text.substring(0, 40) + '...' : text;\n parts.push(`text=\"${preview}\"`);\n }\n\n return parts.join(', ');\n}\n","import type { Rule, RuleContext, RuleResult } from '@lintpage/core';\n\nexport const sslRule: Rule = {\n meta: {\n id: 'ssl',\n name: 'SSL / HTTPS',\n category: 'Pre-Launch',\n tier: 'pro',\n description: 'Checks that the site is served over HTTPS',\n },\n run(context: RuleContext): RuleResult[] {\n const results: RuleResult[] = [];\n\n if (!context.isHttps) {\n results.push({\n ruleId: 'ssl',\n ruleName: 'SSL / HTTPS',\n message:\n 'Site is not using HTTPS — required for SEO and user trust. Search engines penalize HTTP sites.',\n severity: 'CRITICAL',\n category: 'Pre-Launch',\n tier: 'pro',\n fix: \"Install an SSL certificate and redirect all HTTP traffic to HTTPS. Most hosting providers offer free SSL via Let's Encrypt.\",\n });\n }\n\n return results;\n },\n};\n","import type { StandaloneRule, RuleResult } from '@lintpage/core';\n\nexport const robotsTxtCheckRule: StandaloneRule = {\n meta: {\n id: 'robots-txt-check',\n name: 'robots.txt Check',\n category: 'Pre-Launch',\n tier: 'pro',\n description: 'Fetches and validates robots.txt for proper directives',\n },\n async run(url: string): Promise<RuleResult[]> {\n const results: RuleResult[] = [];\n\n try {\n const robotsUrl = new URL('/robots.txt', url).href;\n const response = await fetch(robotsUrl, {\n headers: { 'User-Agent': 'LintPage-Bot/1.0' },\n });\n\n if (!response.ok) {\n results.push({\n ruleId: 'robots-txt-check',\n ruleName: 'robots.txt Check',\n message: 'No robots.txt file found — recommended to have one',\n severity: 'WARNING',\n category: 'Pre-Launch',\n tier: 'pro',\n fix: 'Create a robots.txt file at your site root with at least \"User-Agent: *\" and \"Allow: /\" directives.',\n });\n return results;\n }\n\n const content = await response.text();\n const lines = content.split('\\n').map((line) => line.trim());\n const rules: Map<string, { disallow: string[]; allow: string[] }> =\n new Map();\n let currentUserAgent = '*';\n\n for (const line of lines) {\n if (!line || line.startsWith('#')) continue;\n\n const [directive, ...valueParts] = line\n .split(':')\n .map((part) => part.trim());\n const value = valueParts.join(':').trim();\n if (!directive || !value) continue;\n\n const upper = directive.toUpperCase();\n if (upper === 'USER-AGENT') {\n currentUserAgent = value;\n if (!rules.has(currentUserAgent)) {\n rules.set(currentUserAgent, { disallow: [], allow: [] });\n }\n } else if (upper === 'DISALLOW') {\n const r = rules.get(currentUserAgent) || {\n disallow: [],\n allow: [],\n };\n r.disallow.push(value);\n rules.set(currentUserAgent, r);\n } else if (upper === 'ALLOW') {\n const r = rules.get(currentUserAgent) || {\n disallow: [],\n allow: [],\n };\n r.allow.push(value);\n rules.set(currentUserAgent, r);\n }\n }\n\n const wildcard = rules.get('*');\n if (wildcard && wildcard.disallow.includes('/')) {\n results.push({\n ruleId: 'robots-txt-check',\n ruleName: 'robots.txt Check',\n message:\n 'robots.txt contains \"Disallow: /\" for User-Agent: * — this blocks ALL search engines from crawling your entire site!',\n severity: 'CRITICAL',\n category: 'Pre-Launch',\n tier: 'pro',\n fix: 'Change \"Disallow: /\" to \"Allow: /\" in your robots.txt, or remove the Disallow directive entirely.',\n });\n }\n\n if (!content.toLowerCase().includes('sitemap')) {\n results.push({\n ruleId: 'robots-txt-check',\n ruleName: 'robots.txt Check',\n message:\n 'robots.txt does not reference sitemap.xml — consider adding a Sitemap directive',\n severity: 'INFO',\n category: 'Pre-Launch',\n tier: 'pro',\n fix: 'Add \"Sitemap: https://yoursite.com/sitemap.xml\" to the end of your robots.txt file.',\n });\n }\n\n const hasMalformedLines = lines.some((line) => {\n if (!line || line.startsWith('#')) return false;\n return !line.includes(':') && line.length > 0;\n });\n\n if (hasMalformedLines) {\n results.push({\n ruleId: 'robots-txt-check',\n ruleName: 'robots.txt Check',\n message:\n 'robots.txt may have syntax errors — ensure each directive follows \"Directive: value\" format',\n severity: 'WARNING',\n category: 'Pre-Launch',\n tier: 'pro',\n fix: 'Review each line in robots.txt. Every directive must follow the \"Directive: value\" format (e.g., \"User-Agent: *\").',\n });\n }\n\n if (rules.size === 0 || (rules.size === 1 && !rules.has('*'))) {\n results.push({\n ruleId: 'robots-txt-check',\n ruleName: 'robots.txt Check',\n message:\n 'robots.txt exists but has no rules defined — add User-Agent and Disallow/Allow directives',\n severity: 'INFO',\n category: 'Pre-Launch',\n tier: 'pro',\n fix: 'Add at minimum \"User-Agent: *\" followed by \"Allow: /\" to your robots.txt.',\n });\n }\n } catch {\n results.push({\n ruleId: 'robots-txt-check',\n ruleName: 'robots.txt Check',\n message:\n 'Could not fetch robots.txt — ensure it exists at root domain',\n severity: 'WARNING',\n category: 'Pre-Launch',\n tier: 'pro',\n fix: 'Create a robots.txt file at your domain root (e.g., https://yoursite.com/robots.txt).',\n });\n }\n\n return results;\n },\n};\n","import type { StandaloneRule, RuleResult } from '@lintpage/core';\n\nexport const sitemapPresenceRule: StandaloneRule = {\n meta: {\n id: 'sitemap-presence',\n name: 'Sitemap Presence',\n category: 'Pre-Launch',\n tier: 'pro',\n description: 'Checks for the existence and validity of sitemap.xml',\n },\n async run(url: string): Promise<RuleResult[]> {\n const results: RuleResult[] = [];\n\n try {\n const sitemapUrl = new URL('/sitemap.xml', url).href;\n const response = await fetch(sitemapUrl, {\n headers: { 'User-Agent': 'LintPage-Bot/1.0' },\n });\n\n if (!response.ok) {\n results.push({\n ruleId: 'sitemap-presence',\n ruleName: 'Sitemap Presence',\n message:\n 'No sitemap.xml found — recommended for search engines to discover your pages',\n severity: 'WARNING',\n category: 'Pre-Launch',\n tier: 'pro',\n fix: 'Generate a sitemap.xml and place it at your domain root. Most frameworks (Next.js, WordPress) have built-in sitemap generation.',\n });\n return results;\n }\n\n const content = await response.text();\n\n if (!content.includes('<?xml') || !content.includes('<urlset')) {\n results.push({\n ruleId: 'sitemap-presence',\n ruleName: 'Sitemap Presence',\n message: 'sitemap.xml exists but may not be valid XML format',\n severity: 'WARNING',\n category: 'Pre-Launch',\n tier: 'pro',\n fix: 'Ensure your sitemap.xml starts with <?xml version=\"1.0\"?> and uses the <urlset> element with proper namespace.',\n });\n }\n\n const urlMatches = content.match(/<loc>/g);\n const urlCount = urlMatches ? urlMatches.length : 0;\n\n if (urlCount === 0) {\n results.push({\n ruleId: 'sitemap-presence',\n ruleName: 'Sitemap Presence',\n message:\n 'sitemap.xml is empty — add URLs to help search engines discover content',\n severity: 'WARNING',\n category: 'Pre-Launch',\n tier: 'pro',\n fix: 'Add <url><loc>https://yoursite.com/page</loc></url> entries to your sitemap for each page you want indexed.',\n });\n }\n } catch {\n results.push({\n ruleId: 'sitemap-presence',\n ruleName: 'Sitemap Presence',\n message: 'Could not fetch sitemap.xml — create one at /sitemap.xml',\n severity: 'WARNING',\n category: 'Pre-Launch',\n tier: 'pro',\n fix: \"Create a sitemap.xml at your domain root. Use a sitemap generator or your framework's built-in sitemap feature.\",\n });\n }\n\n return results;\n },\n};\n","import type { Rule, RuleContext, RuleResult } from '@lintpage/core';\n\nexport const trackingRule: Rule = {\n meta: {\n id: 'tracking',\n name: 'Analytics Tracking',\n category: 'Pre-Launch',\n tier: 'pro',\n description:\n 'Checks for Google Analytics, Google Tag Manager, or Facebook Pixel',\n },\n run(context: RuleContext): RuleResult[] {\n const { document } = context;\n const results: RuleResult[] = [];\n\n let foundGA = false;\n let foundGTM = false;\n\n const scripts = document.querySelectorAll('script');\n scripts.forEach((script) => {\n const src = script.getAttribute('src') || '';\n const content = script.textContent || '';\n\n if (\n src.includes('googletagmanager.com/gtag/js') ||\n content.includes('gtag(')\n ) {\n foundGA = true;\n }\n if (\n src.includes('googletagmanager.com/gtm.js') ||\n content.includes('GTM-')\n ) {\n foundGTM = true;\n }\n });\n\n if (!foundGA && !foundGTM) {\n results.push({\n ruleId: 'tracking',\n ruleName: 'Analytics Tracking',\n message:\n \"No Google Analytics or Tag Manager found — you won't be able to track traffic after launch\",\n severity: 'WARNING',\n category: 'Pre-Launch',\n tier: 'pro',\n fix: 'Add Google Analytics (gtag.js) or Google Tag Manager script to your <head> tag. Get your tracking ID from analytics.google.com.',\n data: { googleAnalytics: foundGA, googleTagManager: foundGTM },\n });\n }\n\n return results;\n },\n};\n","import type { Rule, RuleContext, RuleResult } from '@lintpage/core';\n\nexport const xRobotsTagRule: Rule = {\n meta: {\n id: 'x-robots-tag',\n name: 'X-Robots-Tag Header',\n category: 'Pre-Launch',\n tier: 'pro',\n description: 'Checks the X-Robots-Tag HTTP header for noindex/nofollow',\n },\n run(context: RuleContext): RuleResult[] {\n const { response } = context;\n const results: RuleResult[] = [];\n\n const value = response.headers.get('x-robots-tag');\n if (!value) return results;\n\n const lower = value.toLowerCase();\n\n if (lower.includes('noindex')) {\n results.push({\n ruleId: 'x-robots-tag',\n ruleName: 'X-Robots-Tag Header',\n message:\n 'X-Robots-Tag HTTP header contains \"noindex\" — page will NOT be indexed by search engines!',\n severity: 'CRITICAL',\n category: 'Pre-Launch',\n tier: 'pro',\n fix: 'Remove the X-Robots-Tag header from your server configuration, or change its value to \"index, follow\".',\n data: { value },\n });\n }\n\n if (lower.includes('nofollow')) {\n results.push({\n ruleId: 'x-robots-tag',\n ruleName: 'X-Robots-Tag Header',\n message:\n 'X-Robots-Tag HTTP header contains \"nofollow\" — links will not be followed by search engines',\n severity: 'WARNING',\n category: 'SEO',\n tier: 'pro',\n fix: 'Remove \"nofollow\" from the X-Robots-Tag header if you want search engines to follow your links.',\n data: { value },\n });\n }\n\n return results;\n },\n};\n","import type { Rule, RuleContext, RuleResult } from '@lintpage/core';\n\nexport const thinContentRule: Rule = {\n meta: {\n id: 'thin-content',\n name: 'Thin Content',\n category: 'SEO',\n tier: 'pro',\n description:\n 'Checks that the page has sufficient text content for search engines',\n },\n run(context: RuleContext): RuleResult[] {\n const { document } = context;\n const results: RuleResult[] = [];\n\n const bodyText = document.body?.textContent || '';\n const wordCount = bodyText\n .trim()\n .split(/\\s+/)\n .filter(Boolean).length;\n\n if (wordCount < 300) {\n results.push({\n ruleId: 'thin-content',\n ruleName: 'Thin Content',\n message: `Page has thin content (${wordCount} words) — search engines prefer pages with substantial content (300+ words)`,\n severity: 'INFO',\n category: 'SEO',\n tier: 'pro',\n fix: 'Add more meaningful text content to the page. Search engines rank pages with substantial, relevant content higher.',\n data: { wordCount },\n });\n }\n\n return results;\n },\n};\n","import type { Rule, RuleContext, RuleResult } from '@lintpage/core';\n\nexport const duplicateMetaRule: Rule = {\n meta: {\n id: 'duplicate-meta',\n name: 'Duplicate Meta Tags',\n category: 'SEO',\n tier: 'pro',\n description:\n 'Checks for duplicate title, meta description, and canonical tags',\n },\n run(context: RuleContext): RuleResult[] {\n const { document } = context;\n const results: RuleResult[] = [];\n\n const titleTags = document.querySelectorAll('title');\n if (titleTags.length > 1) {\n results.push({\n ruleId: 'duplicate-meta',\n ruleName: 'Duplicate Meta Tags',\n message: `Found ${titleTags.length} <title> tags — should have exactly one`,\n severity: 'WARNING',\n category: 'SEO',\n tier: 'pro',\n fix: 'Remove duplicate <title> tags. Keep only one in your <head> element.',\n data: { count: titleTags.length, tag: 'title' },\n });\n }\n\n const descriptionTags = document.querySelectorAll(\n 'meta[name=\"description\"]'\n );\n if (descriptionTags.length > 1) {\n results.push({\n ruleId: 'duplicate-meta',\n ruleName: 'Duplicate Meta Tags',\n message: `Found ${descriptionTags.length} meta description tags — should have exactly one`,\n severity: 'WARNING',\n category: 'SEO',\n tier: 'pro',\n fix: 'Remove duplicate <meta name=\"description\"> tags. Keep only one in your <head> element.',\n data: { count: descriptionTags.length, tag: 'meta-description' },\n });\n }\n\n const canonicalTags = document.querySelectorAll('link[rel=\"canonical\"]');\n if (canonicalTags.length > 1) {\n results.push({\n ruleId: 'duplicate-meta',\n ruleName: 'Duplicate Meta Tags',\n message: `Found ${canonicalTags.length} canonical link tags — should have exactly one`,\n severity: 'WARNING',\n category: 'SEO',\n tier: 'pro',\n fix: 'Remove duplicate <link rel=\"canonical\"> tags. Keep only one in your <head> element.',\n data: { count: canonicalTags.length, tag: 'canonical' },\n });\n }\n\n return results;\n },\n};\n","import type { Rule, RuleContext, RuleResult } from '@lintpage/core';\n\nexport const structuredDataRule: Rule = {\n meta: {\n id: 'structured-data',\n name: 'Structured Data',\n category: 'SEO',\n tier: 'pro',\n description: 'Checks for the presence and validity of JSON-LD structured data',\n },\n run(context: RuleContext): RuleResult[] {\n const { document } = context;\n const results: RuleResult[] = [];\n\n const jsonLdScripts = document.querySelectorAll(\n 'script[type=\"application/ld+json\"]'\n );\n const types: string[] = [];\n\n jsonLdScripts.forEach((script) => {\n try {\n const data = JSON.parse(script.textContent || '');\n if (data['@type']) {\n types.push(data['@type']);\n }\n } catch {\n results.push({\n ruleId: 'structured-data',\n ruleName: 'Structured Data',\n message: 'Invalid JSON-LD structured data found',\n severity: 'WARNING',\n category: 'SEO',\n tier: 'pro',\n fix: \"Validate your JSON-LD using Google's Rich Results Test tool and fix any JSON syntax errors.\",\n });\n }\n });\n\n if (types.length === 0) {\n results.push({\n ruleId: 'structured-data',\n ruleName: 'Structured Data',\n message: 'No structured data (JSON-LD) found',\n severity: 'INFO',\n category: 'SEO',\n tier: 'pro',\n fix: 'Add a <script type=\"application/ld+json\"> block with Organization, WebPage, or other relevant schema.org types.',\n data: { types },\n });\n }\n\n return results;\n },\n};\n","import type { Rule, RuleContext, RuleResult } from '@lintpage/core';\n\nexport const charsetRule: Rule = {\n meta: {\n id: 'charset',\n name: 'Character Encoding',\n category: 'SEO',\n tier: 'pro',\n description: 'Checks for a proper charset/encoding declaration',\n },\n run(context: RuleContext): RuleResult[] {\n const { document } = context;\n const results: RuleResult[] = [];\n\n const charsetMeta = document.querySelector('meta[charset]');\n const httpEquivMeta = document.querySelector(\n 'meta[http-equiv=\"Content-Type\"]'\n );\n\n if (!charsetMeta && !httpEquivMeta) {\n results.push({\n ruleId: 'charset',\n ruleName: 'Character Encoding',\n message:\n 'Missing character encoding declaration — may cause rendering issues with special characters',\n severity: 'WARNING',\n category: 'SEO',\n tier: 'pro',\n fix: 'Add <meta charset=\"utf-8\" /> as the first element in your <head> tag.',\n });\n }\n\n return results;\n },\n};\n","import type { Rule, RuleContext, RuleResult } from '@lintpage/core';\n\nexport const imageAltTextRule: Rule = {\n meta: {\n id: 'image-alt-text',\n name: 'Image Alt Text',\n category: 'Accessibility',\n tier: 'pro',\n description: 'Checks that all images have alt attributes',\n },\n run(context: RuleContext): RuleResult[] {\n const { document } = context;\n const results: RuleResult[] = [];\n\n const images = document.querySelectorAll('img');\n let missingAlt = 0;\n\n images.forEach((img) => {\n const alt = img.getAttribute('alt');\n if (alt === null || alt === undefined) {\n missingAlt++;\n }\n });\n\n if (missingAlt > 0) {\n results.push({\n ruleId: 'image-alt-text',\n ruleName: 'Image Alt Text',\n message: `${missingAlt} of ${images.length} images missing alt attributes`,\n severity: 'WARNING',\n category: 'Accessibility',\n tier: 'pro',\n fix: 'Add descriptive alt attributes to all images. Screen readers use alt text to describe images to visually impaired users. Use alt=\"\" for decorative images.',\n data: { total: images.length, missingAlt },\n });\n }\n\n return results;\n },\n};\n","import type { Rule, RuleContext, RuleResult } from '@lintpage/core';\n\nexport const accessibilityRule: Rule = {\n meta: {\n id: 'accessibility',\n name: 'Accessibility & ARIA',\n category: 'Accessibility',\n tier: 'pro',\n description:\n 'Checks buttons, links, inputs, and ARIA attributes for accessibility',\n },\n run(context: RuleContext): RuleResult[] {\n const { document } = context;\n const results: RuleResult[] = [];\n\n // Buttons without accessible names\n const buttons = document.querySelectorAll('button');\n let inaccessibleButtons = 0;\n buttons.forEach((button) => {\n const hasText = button.textContent?.trim();\n const hasAriaLabel = button.getAttribute('aria-label');\n const hasAriaLabelledBy = button.getAttribute('aria-labelledby');\n if (!hasText && !hasAriaLabel && !hasAriaLabelledBy) {\n inaccessibleButtons++;\n }\n });\n if (inaccessibleButtons > 0) {\n results.push({\n ruleId: 'accessibility',\n ruleName: 'Accessibility & ARIA',\n message: `${inaccessibleButtons} button(s) missing accessible name (no text, aria-label, or aria-labelledby)`,\n severity: 'WARNING',\n category: 'Accessibility',\n tier: 'pro',\n fix: 'Add visible text content, an aria-label, or aria-labelledby attribute to each button.',\n data: { inaccessibleButtons },\n });\n }\n\n // Links without accessible names\n const links = document.querySelectorAll('a');\n let inaccessibleLinks = 0;\n links.forEach((link) => {\n const hasText = link.textContent?.trim();\n const hasAriaLabel = link.getAttribute('aria-label');\n if (!hasText && !hasAriaLabel) {\n inaccessibleLinks++;\n }\n });\n if (inaccessibleLinks > 0) {\n results.push({\n ruleId: 'accessibility',\n ruleName: 'Accessibility & ARIA',\n message: `${inaccessibleLinks} link(s) missing accessible name (no text or aria-label)`,\n severity: 'WARNING',\n category: 'Accessibility',\n tier: 'pro',\n fix: 'Add descriptive text content or an aria-label attribute to each link so screen readers can identify it.',\n data: { inaccessibleLinks },\n });\n }\n\n // Inputs without labels\n const inputs = document.querySelectorAll(\"input:not([type='hidden'])\");\n let unlabeledInputs = 0;\n inputs.forEach((input) => {\n const id = input.getAttribute('id');\n const ariaLabel = input.getAttribute('aria-label');\n const ariaLabelledBy = input.getAttribute('aria-labelledby');\n const hasLabel = id && document.querySelector(`label[for=\"${id}\"]`);\n if (!hasLabel && !ariaLabel && !ariaLabelledBy) {\n unlabeledInputs++;\n }\n });\n if (unlabeledInputs > 0) {\n results.push({\n ruleId: 'accessibility',\n ruleName: 'Accessibility & ARIA',\n message: `${unlabeledInputs} input(s) missing associated label`,\n severity: 'WARNING',\n category: 'Accessibility',\n tier: 'pro',\n fix: 'Add a <label for=\"inputId\"> element, or add an aria-label attribute to each input.',\n data: { unlabeledInputs },\n });\n }\n\n // Interactive divs without role\n const divButtons = document.querySelectorAll(\n 'div[onclick], span[onclick]'\n );\n let missingRoles = 0;\n divButtons.forEach((el) => {\n if (!el.getAttribute('role')) missingRoles++;\n });\n if (missingRoles > 0) {\n results.push({\n ruleId: 'accessibility',\n ruleName: 'Accessibility & ARIA',\n message: `${missingRoles} interactive div/span element(s) missing role attribute`,\n severity: 'WARNING',\n category: 'Accessibility',\n tier: 'pro',\n fix: 'Use a <button> element instead, or add role=\"button\" and an aria-label to interactive elements.',\n data: { missingRoles },\n });\n }\n\n // Navigation without labels\n const navElements = document.querySelectorAll(\n 'nav, [role=\"navigation\"]'\n );\n let unlabeledNav = 0;\n navElements.forEach((nav) => {\n const ariaLabel = nav.getAttribute('aria-label');\n const ariaLabelledBy = nav.getAttribute('aria-labelledby');\n if (!ariaLabel && !ariaLabelledBy) unlabeledNav++;\n });\n if (unlabeledNav > 0) {\n results.push({\n ruleId: 'accessibility',\n ruleName: 'Accessibility & ARIA',\n message: `${unlabeledNav} navigation element(s) missing aria-label or aria-labelledby`,\n severity: 'INFO',\n category: 'Accessibility',\n tier: 'pro',\n fix: 'Add aria-label=\"Main navigation\" (or similar descriptive label) to your <nav> elements.',\n data: { unlabeledNav },\n });\n }\n\n return results;\n },\n};\n","import type { Rule, RuleContext, RuleResult } from '@lintpage/core';\n\nexport const semanticStructureRule: Rule = {\n meta: {\n id: 'semantic-structure',\n name: 'Semantic Structure',\n category: 'Accessibility',\n tier: 'pro',\n description:\n 'Checks for proper semantic HTML: landmarks, lists, tables, articles',\n },\n run(context: RuleContext): RuleResult[] {\n const { document } = context;\n const results: RuleResult[] = [];\n\n // Check for <main> landmark\n const main = document.querySelector('main');\n if (!main) {\n results.push({\n ruleId: 'semantic-structure',\n ruleName: 'Semantic Structure',\n message:\n 'Missing <main> element — should wrap primary page content for better structure',\n severity: 'WARNING',\n category: 'Pre-Launch',\n tier: 'pro',\n fix: 'Wrap your primary page content in a <main> element. There should be exactly one per page.',\n });\n }\n\n // Check for semantic regions\n const semanticElements = document.querySelectorAll(\n 'main, section, article, aside, nav'\n );\n if (semanticElements.length === 0) {\n results.push({\n ruleId: 'semantic-structure',\n ruleName: 'Semantic Structure',\n message:\n 'Missing semantic page regions — use <main>, <section>, <article>, <nav>, <aside> instead of generic divs',\n severity: 'WARNING',\n category: 'Pre-Launch',\n tier: 'pro',\n fix: 'Replace generic <div> containers with semantic elements: <main>, <nav>, <section>, <article>, <aside>.',\n });\n }\n\n // Check for <li> outside <ul>/<ol>\n const listItems = document.querySelectorAll('li');\n let orphanedLi = 0;\n listItems.forEach((li) => {\n const parent = li.parentElement;\n if (parent?.tagName !== 'UL' && parent?.tagName !== 'OL') {\n orphanedLi++;\n }\n });\n if (orphanedLi > 0) {\n results.push({\n ruleId: 'semantic-structure',\n ruleName: 'Semantic Structure',\n message: `${orphanedLi} <li> element(s) found outside of <ul> or <ol> — breaks semantic structure`,\n severity: 'WARNING',\n category: 'Accessibility',\n tier: 'pro',\n fix: 'Wrap <li> elements inside a <ul> (unordered) or <ol> (ordered) list element.',\n data: { orphanedLi },\n });\n }\n\n // Check tables for proper structure\n const tables = document.querySelectorAll('table');\n let tablesWithoutThead = 0;\n tables.forEach((table) => {\n if (!table.querySelector('thead')) tablesWithoutThead++;\n });\n if (tablesWithoutThead > 0) {\n results.push({\n ruleId: 'semantic-structure',\n ruleName: 'Semantic Structure',\n message: `${tablesWithoutThead} table(s) missing <thead> element`,\n severity: 'INFO',\n category: 'Accessibility',\n tier: 'pro',\n fix: 'Add a <thead> element with <th> cells to define table column headers.',\n data: { tablesWithoutThead },\n });\n }\n\n // Check articles for headings\n const articles = document.querySelectorAll('article');\n let articlesWithoutHeading = 0;\n articles.forEach((article) => {\n if (!article.querySelector('h1, h2, h3, h4, h5, h6')) {\n articlesWithoutHeading++;\n }\n });\n if (articlesWithoutHeading > 0) {\n results.push({\n ruleId: 'semantic-structure',\n ruleName: 'Semantic Structure',\n message: `${articlesWithoutHeading} <article> element(s) without a heading`,\n severity: 'INFO',\n category: 'Accessibility',\n tier: 'pro',\n fix: 'Add a heading (h2-h6) inside each <article> element to provide context.',\n data: { articlesWithoutHeading },\n });\n }\n\n return results;\n },\n};\n","import type { Rule, RuleContext, RuleResult } from '@lintpage/core';\n\nexport const performanceRule: Rule = {\n meta: {\n id: 'performance',\n name: 'Performance Hints',\n category: 'Performance',\n tier: 'pro',\n description:\n 'Checks for inline styles, lazy loading, and script count',\n },\n run(context: RuleContext): RuleResult[] {\n const { document } = context;\n const results: RuleResult[] = [];\n\n // Excessive inline styles\n const inlineStyles = document.querySelectorAll('[style]');\n if (inlineStyles.length > 10) {\n results.push({\n ruleId: 'performance',\n ruleName: 'Performance Hints',\n message: `Reduce inline styles (${inlineStyles.length} elements) — use CSS classes instead`,\n severity: 'INFO',\n category: 'Performance',\n tier: 'pro',\n fix: 'Move inline styles to CSS classes for better cacheability and maintainability.',\n data: { inlineStyleCount: inlineStyles.length },\n });\n }\n\n // Images without lazy loading\n const images = document.querySelectorAll('img');\n let noLazyLoad = 0;\n images.forEach((img) => {\n if (!img.getAttribute('loading')) noLazyLoad++;\n });\n if (noLazyLoad > 3) {\n results.push({\n ruleId: 'performance',\n ruleName: 'Performance Hints',\n message: `${noLazyLoad} images without loading attribute — add lazy loading`,\n severity: 'INFO',\n category: 'Performance',\n tier: 'pro',\n fix: 'Add loading=\"lazy\" to images below the fold to defer loading until they are near the viewport.',\n data: { noLazyLoad, totalImages: images.length },\n });\n }\n\n // Excessive external scripts\n const scripts = document.querySelectorAll('script[src]');\n if (scripts.length > 10) {\n results.push({\n ruleId: 'performance',\n ruleName: 'Performance Hints',\n message: `Consider reducing external scripts (${scripts.length} found) for better performance`,\n severity: 'INFO',\n category: 'Performance',\n tier: 'pro',\n fix: 'Audit your scripts and remove unused ones. Consider bundling or deferring non-critical scripts.',\n data: { scriptCount: scripts.length },\n });\n }\n\n return results;\n },\n};\n","import type { Rule, RuleContext, RuleResult } from '@lintpage/core';\n\nexport const imageDimensionsRule: Rule = {\n meta: {\n id: 'image-dimensions',\n name: 'Image Dimensions',\n category: 'Performance',\n tier: 'pro',\n description:\n 'Checks that images have explicit width and height to prevent layout shift (CLS)',\n },\n run(context: RuleContext): RuleResult[] {\n const { document } = context;\n const results: RuleResult[] = [];\n\n const images = document.querySelectorAll('img');\n let missingCount = 0;\n\n images.forEach((img) => {\n const hasWidth = img.getAttribute('width');\n const hasHeight = img.getAttribute('height');\n if (!hasWidth || !hasHeight) missingCount++;\n });\n\n if (missingCount > 0) {\n results.push({\n ruleId: 'image-dimensions',\n ruleName: 'Image Dimensions',\n message: `${missingCount} image${missingCount !== 1 ? 's' : ''} missing explicit width/height attributes — causes layout shift (CLS)`,\n severity: 'INFO',\n category: 'Performance',\n tier: 'pro',\n fix: 'Add width and height attributes to <img> tags to reserve space and prevent layout shift.',\n data: { missingCount, totalImages: images.length },\n });\n }\n\n return results;\n },\n};\n","import type { StandaloneRule, RuleResult } from '@lintpage/core';\n\nexport const ttfbRule: StandaloneRule = {\n meta: {\n id: 'ttfb-pro',\n name: 'Time to First Byte (Pro)',\n category: 'Performance',\n tier: 'pro',\n description: 'Measures server response time (TTFB) with detailed thresholds',\n },\n async run(url: string): Promise<RuleResult[]> {\n const results: RuleResult[] = [];\n\n try {\n const start = Date.now();\n await fetch(url, {\n headers: { 'User-Agent': 'LintPage-Bot/1.0' },\n });\n const ttfbMs = Date.now() - start;\n\n if (ttfbMs > 2000) {\n results.push({\n ruleId: 'ttfb-pro',\n ruleName: 'Time to First Byte (Pro)',\n message: `Slow server response time (TTFB: ${ttfbMs}ms) — aim for under 800ms`,\n severity: 'WARNING',\n category: 'Performance',\n tier: 'pro',\n fix: 'Optimize server response time: enable caching, use a CDN, optimize database queries, or upgrade hosting.',\n data: { ms: ttfbMs },\n });\n } else if (ttfbMs > 800) {\n results.push({\n ruleId: 'ttfb-pro',\n ruleName: 'Time to First Byte (Pro)',\n message: `Server response time could be improved (TTFB: ${ttfbMs}ms) — aim for under 800ms`,\n severity: 'INFO',\n category: 'Performance',\n tier: 'pro',\n fix: 'Consider enabling server-side caching or using a CDN to reduce response time.',\n data: { ms: ttfbMs },\n });\n }\n } catch {\n results.push({\n ruleId: 'ttfb-pro',\n ruleName: 'Time to First Byte (Pro)',\n message: 'Could not measure TTFB — server may be unreachable',\n severity: 'WARNING',\n category: 'Performance',\n tier: 'pro',\n fix: 'Ensure your server is accessible and responding to requests.',\n });\n }\n\n return results;\n },\n};\n","import type { Rule, RuleContext, RuleResult } from '@lintpage/core';\n\nexport const mixedContentRule: Rule = {\n meta: {\n id: 'mixed-content',\n name: 'Mixed Content',\n category: 'Pre-Launch',\n tier: 'pro',\n description:\n 'Checks for HTTP resources loaded on an HTTPS page (mixed content)',\n },\n run(context: RuleContext): RuleResult[] {\n const { document, isHttps } = context;\n const results: RuleResult[] = [];\n\n if (!isHttps) return results;\n\n const selectors = [\n 'img[src^=\"http:\"]',\n 'script[src^=\"http:\"]',\n 'link[href^=\"http:\"]',\n 'iframe[src^=\"http:\"]',\n 'video[src^=\"http:\"]',\n 'audio[src^=\"http:\"]',\n ];\n\n let count = 0;\n selectors.forEach((selector) => {\n count += document.querySelectorAll(selector).length;\n });\n\n if (count > 0) {\n results.push({\n ruleId: 'mixed-content',\n ruleName: 'Mixed Content',\n message: `Found ${count} mixed content resource${count !== 1 ? 's' : ''} (HTTP on HTTPS page) — browsers may block these`,\n severity: 'WARNING',\n category: 'Pre-Launch',\n tier: 'pro',\n fix: 'Change all resource URLs from http:// to https:// or use protocol-relative URLs (//).',\n data: { count },\n });\n }\n\n return results;\n },\n};\n","import type { Rule, RuleContext, RuleResult } from '@lintpage/core';\n\nexport const securityHeadersRule: Rule = {\n meta: {\n id: 'security-headers',\n name: 'Security Headers',\n category: 'Performance',\n tier: 'pro',\n description:\n 'Checks for important security headers (CSP, HSTS, X-Content-Type-Options, X-Frame-Options)',\n },\n run(context: RuleContext): RuleResult[] {\n const { response } = context;\n const results: RuleResult[] = [];\n\n const headers = [\n { name: 'content-security-policy', label: 'Content-Security-Policy' },\n {\n name: 'strict-transport-security',\n label: 'Strict-Transport-Security (HSTS)',\n },\n { name: 'x-content-type-options', label: 'X-Content-Type-Options' },\n { name: 'x-frame-options', label: 'X-Frame-Options' },\n ];\n\n const missing: string[] = [];\n headers.forEach(({ name, label }) => {\n if (!response.headers.get(name)) missing.push(label);\n });\n\n if (missing.length > 0) {\n results.push({\n ruleId: 'security-headers',\n ruleName: 'Security Headers',\n message: `Missing security headers: ${missing.join(', ')}`,\n severity: 'INFO',\n category: 'Performance',\n tier: 'pro',\n fix: 'Configure your server or hosting provider to send these security headers. Most can be set in next.config.js headers() or your CDN settings.',\n data: { missing },\n });\n }\n\n return results;\n },\n};\n","import type { Rule, RuleContext, RuleResult } from '@lintpage/core';\n\nexport const ogImageSizeRule: Rule = {\n meta: {\n id: 'og-image-size',\n name: 'OG Image Size',\n category: 'SEO',\n tier: 'pro',\n description:\n 'Checks that the og:image URL exists and advises on recommended dimensions (1200x630)',\n },\n run(context: RuleContext): RuleResult[] {\n const { document } = context;\n const results: RuleResult[] = [];\n\n const ogImage = document.querySelector('meta[property=\"og:image\"]');\n const imageUrl = ogImage?.getAttribute('content')?.trim();\n\n if (!imageUrl) return results;\n\n // Check og:image:width and og:image:height meta tags\n const ogWidth = document.querySelector('meta[property=\"og:image:width\"]');\n const ogHeight = document.querySelector(\n 'meta[property=\"og:image:height\"]'\n );\n const width = Number.parseInt(\n ogWidth?.getAttribute('content') || '',\n 10\n );\n const height = Number.parseInt(\n ogHeight?.getAttribute('content') || '',\n 10\n );\n\n if (!ogWidth || !ogHeight || Number.isNaN(width) || Number.isNaN(height)) {\n results.push({\n ruleId: 'og-image-size',\n ruleName: 'OG Image Size',\n message:\n 'Missing og:image:width and og:image:height meta tags — social platforms may crop your image incorrectly',\n severity: 'WARNING',\n category: 'SEO',\n tier: 'pro',\n fix: 'Add <meta property=\"og:image:width\" content=\"1200\" /> and <meta property=\"og:image:height\" content=\"630\" /> to your <head>.',\n });\n return results;\n }\n\n if (width < 1200 || height < 630) {\n results.push({\n ruleId: 'og-image-size',\n ruleName: 'OG Image Size',\n message: `OG image dimensions (${width}x${height}) are below recommended 1200x630 — may appear blurry on social platforms`,\n severity: 'WARNING',\n category: 'SEO',\n tier: 'pro',\n fix: 'Use an image at least 1200x630 pixels for best display on Facebook, LinkedIn, and other social platforms.',\n data: { width, height },\n });\n }\n\n return results;\n },\n};\n","import type { Rule, RuleContext, RuleResult } from '@lintpage/core';\n\nconst SUPPORTED_TYPES = new Set([\n 'image/jpeg',\n 'image/png',\n 'image/gif',\n 'image/webp',\n]);\n\nconst SUPPORTED_EXTENSIONS = new Set([\n '.jpg',\n '.jpeg',\n '.png',\n '.gif',\n '.webp',\n]);\n\nexport const ogImageTypeRule: Rule = {\n meta: {\n id: 'og-image-type',\n name: 'OG Image Type',\n category: 'SEO',\n tier: 'pro',\n description:\n 'Checks that the og:image type is a widely-supported format (JPEG, PNG, GIF, WebP)',\n },\n run(context: RuleContext): RuleResult[] {\n const { document } = context;\n const results: RuleResult[] = [];\n\n const ogImage = document.querySelector('meta[property=\"og:image\"]');\n const imageUrl = ogImage?.getAttribute('content')?.trim();\n if (!imageUrl) return results;\n\n // Check og:image:type if present\n const ogType = document\n .querySelector('meta[property=\"og:image:type\"]')\n ?.getAttribute('content')\n ?.trim();\n\n if (ogType && !SUPPORTED_TYPES.has(ogType.toLowerCase())) {\n results.push({\n ruleId: 'og-image-type',\n ruleName: 'OG Image Type',\n message: `OG image type \"${ogType}\" may not be supported by all social platforms`,\n severity: 'WARNING',\n category: 'SEO',\n tier: 'pro',\n fix: 'Use JPEG or PNG for og:image. These formats are supported by all social platforms.',\n data: { type: ogType },\n });\n return results;\n }\n\n // Infer from URL extension if no og:image:type\n if (!ogType) {\n try {\n const url = new URL(imageUrl, 'https://example.com');\n const ext = url.pathname\n .substring(url.pathname.lastIndexOf('.'))\n .toLowerCase();\n\n if (ext && !SUPPORTED_EXTENSIONS.has(ext)) {\n results.push({\n ruleId: 'og-image-type',\n ruleName: 'OG Image Type',\n message: `OG image URL has extension \"${ext}\" which may not be supported by all social platforms`,\n severity: 'INFO',\n category: 'SEO',\n tier: 'pro',\n fix: 'Use JPEG or PNG for og:image, and add <meta property=\"og:image:type\" content=\"image/jpeg\" /> to your <head>.',\n data: { extension: ext },\n });\n }\n } catch {\n // URL parsing failed, skip\n }\n }\n\n return results;\n },\n};\n","import type { Rule, RuleContext, RuleResult } from '@lintpage/core';\n\nexport const twitterImageRule: Rule = {\n meta: {\n id: 'twitter-image',\n name: 'Twitter/X Image',\n category: 'SEO',\n tier: 'pro',\n description:\n 'Checks for twitter:image meta tag for rich card previews on X/Twitter',\n },\n run(context: RuleContext): RuleResult[] {\n const { document } = context;\n const results: RuleResult[] = [];\n\n const twitterCard = document.querySelector('meta[name=\"twitter:card\"]');\n if (!twitterCard) return results; // No twitter card at all, covered by core rule\n\n const twitterImage = document.querySelector(\n 'meta[name=\"twitter:image\"]'\n );\n const ogImage = document.querySelector('meta[property=\"og:image\"]');\n\n if (!twitterImage && !ogImage) {\n results.push({\n ruleId: 'twitter-image',\n ruleName: 'Twitter/X Image',\n message:\n 'Twitter card present but no twitter:image or og:image found — tweets will have no image preview',\n severity: 'WARNING',\n category: 'SEO',\n tier: 'pro',\n fix: 'Add <meta name=\"twitter:image\" content=\"https://yoursite.com/image.png\" /> to your <head>.',\n });\n } else if (!twitterImage && ogImage) {\n results.push({\n ruleId: 'twitter-image',\n ruleName: 'Twitter/X Image',\n message:\n 'No explicit twitter:image — falling back to og:image. Consider adding twitter:image for optimal display.',\n severity: 'INFO',\n category: 'SEO',\n tier: 'pro',\n fix: 'Add <meta name=\"twitter:image\" content=\"...\" /> for more control over how your image appears on X/Twitter.',\n });\n }\n\n return results;\n },\n};\n","import type { Rule, RuleContext, RuleResult } from '@lintpage/core';\n\nexport const socialPreviewRenderRule: Rule = {\n meta: {\n id: 'social-preview-render',\n name: 'Social Preview Completeness',\n category: 'SEO',\n tier: 'pro',\n description:\n 'Checks that all essential meta tags for social sharing previews are present and consistent',\n },\n run(context: RuleContext): RuleResult[] {\n const { document } = context;\n const results: RuleResult[] = [];\n\n const ogTitle = document\n .querySelector('meta[property=\"og:title\"]')\n ?.getAttribute('content');\n const ogDesc = document\n .querySelector('meta[property=\"og:description\"]')\n ?.getAttribute('content');\n const ogImage = document\n .querySelector('meta[property=\"og:image\"]')\n ?.getAttribute('content');\n const ogUrl = document\n .querySelector('meta[property=\"og:url\"]')\n ?.getAttribute('content');\n const ogType = document\n .querySelector('meta[property=\"og:type\"]')\n ?.getAttribute('content');\n\n const title = document.querySelector('title')?.textContent?.trim();\n const metaDesc = document\n .querySelector('meta[name=\"description\"]')\n ?.getAttribute('content');\n\n // Check for og:type\n if (!ogType) {\n results.push({\n ruleId: 'social-preview-render',\n ruleName: 'Social Preview Completeness',\n message:\n 'Missing og:type meta tag — social platforms may not render the preview correctly',\n severity: 'INFO',\n category: 'SEO',\n tier: 'pro',\n fix: 'Add <meta property=\"og:type\" content=\"website\" /> (or \"article\" for blog posts) to your <head>.',\n });\n }\n\n // Check og:title matches page title\n if (ogTitle && title && ogTitle.length > 0 && title.length > 0) {\n if (ogTitle.length > 70) {\n results.push({\n ruleId: 'social-preview-render',\n ruleName: 'Social Preview Completeness',\n message: `og:title is ${ogTitle.length} characters — may be truncated on social platforms (recommended: under 70)`,\n severity: 'INFO',\n category: 'SEO',\n tier: 'pro',\n fix: 'Keep og:title under 70 characters for best display on social platforms.',\n data: { ogTitleLength: ogTitle.length },\n });\n }\n }\n\n // Check og:description length\n if (ogDesc && ogDesc.length > 200) {\n results.push({\n ruleId: 'social-preview-render',\n ruleName: 'Social Preview Completeness',\n message: `og:description is ${ogDesc.length} characters — may be truncated on social platforms (recommended: under 200)`,\n severity: 'INFO',\n category: 'SEO',\n tier: 'pro',\n fix: 'Keep og:description under 200 characters for best display on social platforms.',\n data: { ogDescLength: ogDesc.length },\n });\n }\n\n // Check og:url is absolute\n if (ogUrl && !ogUrl.startsWith('http')) {\n results.push({\n ruleId: 'social-preview-render',\n ruleName: 'Social Preview Completeness',\n message:\n 'og:url should be an absolute URL starting with https://',\n severity: 'WARNING',\n category: 'SEO',\n tier: 'pro',\n fix: 'Change og:url to an absolute URL (e.g., https://yoursite.com/page).',\n });\n }\n\n // Check og:image is absolute\n if (ogImage && !ogImage.startsWith('http')) {\n results.push({\n ruleId: 'social-preview-render',\n ruleName: 'Social Preview Completeness',\n message:\n 'og:image should be an absolute URL starting with https://',\n severity: 'WARNING',\n category: 'SEO',\n tier: 'pro',\n fix: 'Change og:image to an absolute URL (e.g., https://yoursite.com/image.png).',\n });\n }\n\n return results;\n },\n};\n","import type { Rule, RuleContext, RuleResult } from '@lintpage/core';\n\nexport const titleKeywordStuffingRule: Rule = {\n meta: {\n id: 'title-keyword-stuffing',\n name: 'Title Keyword Stuffing',\n category: 'SEO',\n tier: 'pro',\n description:\n 'Detects potential keyword stuffing in the page title',\n },\n run(context: RuleContext): RuleResult[] {\n const { document } = context;\n const results: RuleResult[] = [];\n\n const title = document.querySelector('title')?.textContent?.trim();\n if (!title) return results;\n\n // Count word frequency\n const words = title.toLowerCase().split(/[\\s\\-|:,]+/).filter((w) => w.length > 3);\n const wordCounts = new Map<string, number>();\n for (const word of words) {\n wordCounts.set(word, (wordCounts.get(word) || 0) + 1);\n }\n\n // Flag words repeated 3+ times\n const stuffedWords: string[] = [];\n for (const [word, count] of wordCounts) {\n if (count >= 3) stuffedWords.push(`\"${word}\" (${count}x)`);\n }\n\n if (stuffedWords.length > 0) {\n results.push({\n ruleId: 'title-keyword-stuffing',\n ruleName: 'Title Keyword Stuffing',\n message: `Potential keyword stuffing in title: ${stuffedWords.join(', ')}`,\n severity: 'WARNING',\n category: 'SEO',\n tier: 'pro',\n fix: 'Write a natural, readable title. Avoid repeating the same keyword more than twice. Search engines may penalize keyword stuffing.',\n data: { title, stuffedWords },\n });\n }\n\n // Check for pipe/separator spam (e.g., \"keyword | keyword | keyword | brand\")\n const separatorCount = (title.match(/[|–—]/g) || []).length;\n if (separatorCount >= 3) {\n results.push({\n ruleId: 'title-keyword-stuffing',\n ruleName: 'Title Keyword Stuffing',\n message: `Title has ${separatorCount} separators — may appear spammy to search engines`,\n severity: 'INFO',\n category: 'SEO',\n tier: 'pro',\n fix: 'Simplify your title. Use at most one separator (|, – or —) to separate the page name from your brand.',\n data: { separatorCount },\n });\n }\n\n return results;\n },\n};\n","import type { Rule, RuleContext, RuleResult } from '@lintpage/core';\n\nexport const contentToHtmlRatioRule: Rule = {\n meta: {\n id: 'content-to-html-ratio',\n name: 'Content-to-HTML Ratio',\n category: 'SEO',\n tier: 'pro',\n description:\n 'Checks the ratio of visible text to total HTML markup',\n },\n run(context: RuleContext): RuleResult[] {\n const { document } = context;\n const results: RuleResult[] = [];\n\n const htmlLength = document.documentElement?.outerHTML?.length || 0;\n if (htmlLength === 0) return results;\n\n const textContent = document.body?.textContent || '';\n const textLength = textContent.replace(/\\s+/g, ' ').trim().length;\n\n const ratio = Math.round((textLength / htmlLength) * 100);\n\n if (ratio < 10) {\n results.push({\n ruleId: 'content-to-html-ratio',\n ruleName: 'Content-to-HTML Ratio',\n message: `Low content-to-HTML ratio (${ratio}%) — search engines may view this as thin or boilerplate content`,\n severity: 'WARNING',\n category: 'SEO',\n tier: 'pro',\n fix: 'Increase meaningful text content relative to HTML markup. Remove unnecessary divs, inline styles, and JavaScript.',\n data: { ratio, textLength, htmlLength },\n });\n } else if (ratio < 20) {\n results.push({\n ruleId: 'content-to-html-ratio',\n ruleName: 'Content-to-HTML Ratio',\n message: `Content-to-HTML ratio is ${ratio}% — could be improved (aim for 25%+)`,\n severity: 'INFO',\n category: 'SEO',\n tier: 'pro',\n fix: 'Consider adding more text content or reducing unnecessary HTML markup to improve the ratio.',\n data: { ratio, textLength, htmlLength },\n });\n }\n\n return results;\n },\n};\n","import type { Rule, RuleContext, RuleResult } from '@lintpage/core';\n\nexport const titleUniquenessRule: Rule = {\n meta: {\n id: 'title-uniqueness',\n name: 'Title Uniqueness',\n category: 'SEO',\n tier: 'pro',\n description:\n 'Flags titles that appear generic or auto-generated (single-page heuristic)',\n },\n run(context: RuleContext): RuleResult[] {\n const { document, url } = context;\n const results: RuleResult[] = [];\n\n const title = document.querySelector('title')?.textContent?.trim();\n if (!title) return results;\n\n // Detect generic/default titles\n const genericPatterns = [\n /^home$/i,\n /^untitled/i,\n /^page \\d+$/i,\n /^welcome$/i,\n /^index$/i,\n /^document$/i,\n /^my site$/i,\n /^my website$/i,\n /^website$/i,\n /^new page$/i,\n ];\n\n for (const pattern of genericPatterns) {\n if (pattern.test(title)) {\n results.push({\n ruleId: 'title-uniqueness',\n ruleName: 'Title Uniqueness',\n message: `Title \"${title}\" appears to be a generic/default title — use a unique, descriptive title`,\n severity: 'WARNING',\n category: 'SEO',\n tier: 'pro',\n fix: 'Write a unique, descriptive title for each page that includes your target keyword.',\n data: { title },\n });\n break;\n }\n }\n\n // Detect title that's just the domain name\n try {\n const hostname = new URL(url).hostname.replace('www.', '');\n const domainName = hostname.split('.')[0];\n if (\n domainName &&\n title.toLowerCase() === domainName.toLowerCase()\n ) {\n results.push({\n ruleId: 'title-uniqueness',\n ruleName: 'Title Uniqueness',\n message:\n 'Title is just the domain name — add a descriptive page-specific title',\n severity: 'WARNING',\n category: 'SEO',\n tier: 'pro',\n fix: 'Include a page-specific description in your title, e.g., \"Product Name — Your Brand\".',\n data: { title, hostname },\n });\n }\n } catch {\n // URL parsing failed, skip\n }\n\n return results;\n },\n};\n","import type { Rule, RuleContext, RuleResult } from '@lintpage/core';\n\nexport const descriptionUniquenessRule: Rule = {\n meta: {\n id: 'description-uniqueness',\n name: 'Description Uniqueness',\n category: 'SEO',\n tier: 'pro',\n description:\n 'Flags meta descriptions that appear generic or auto-generated (single-page heuristic)',\n },\n run(context: RuleContext): RuleResult[] {\n const { document } = context;\n const results: RuleResult[] = [];\n\n const metaDesc = document.querySelector('meta[name=\"description\"]');\n const description = metaDesc?.getAttribute('content')?.trim();\n if (!description) return results;\n\n // Check for generic/boilerplate descriptions\n const genericPatterns = [\n /^welcome to/i,\n /^this is a website/i,\n /^a website about/i,\n /^home page/i,\n /^we are a company/i,\n /^default description/i,\n ];\n\n for (const pattern of genericPatterns) {\n if (pattern.test(description)) {\n results.push({\n ruleId: 'description-uniqueness',\n ruleName: 'Description Uniqueness',\n message: `Meta description appears generic — write a unique, compelling description for this page`,\n severity: 'WARNING',\n category: 'SEO',\n tier: 'pro',\n fix: 'Write a unique meta description for each page that summarizes the specific content and includes a call to action.',\n data: { description },\n });\n break;\n }\n }\n\n // Check for description that's identical to the title\n const title = document.querySelector('title')?.textContent?.trim();\n if (title && description.toLowerCase() === title.toLowerCase()) {\n results.push({\n ruleId: 'description-uniqueness',\n ruleName: 'Description Uniqueness',\n message:\n 'Meta description is identical to the title — they should be different and complementary',\n severity: 'WARNING',\n category: 'SEO',\n tier: 'pro',\n fix: 'Write a meta description that expands on your title with more detail, a value proposition, or a call to action.',\n data: { description, title },\n });\n }\n\n return results;\n },\n};\n","import type { Rule, RuleContext, RuleResult } from '@lintpage/core';\n\nconst REQUIRED_FIELDS: Record<string, string[]> = {\n Organization: ['name', 'url'],\n WebSite: ['name', 'url'],\n WebPage: ['name'],\n Article: ['headline', 'author', 'datePublished'],\n Product: ['name', 'image'],\n BreadcrumbList: ['itemListElement'],\n FAQPage: ['mainEntity'],\n LocalBusiness: ['name', 'address'],\n};\n\nexport const structuredDataValidateRule: Rule = {\n meta: {\n id: 'structured-data-validate',\n name: 'Structured Data Validation',\n category: 'SEO',\n tier: 'pro',\n description:\n 'Validates JSON-LD structured data for required fields based on schema type',\n },\n run(context: RuleContext): RuleResult[] {\n const { document } = context;\n const results: RuleResult[] = [];\n\n const jsonLdScripts = document.querySelectorAll(\n 'script[type=\"application/ld+json\"]'\n );\n\n jsonLdScripts.forEach((script) => {\n let data: Record<string, unknown>;\n try {\n data = JSON.parse(script.textContent || '');\n } catch {\n return; // Invalid JSON already caught by structured-data rule\n }\n\n const type = data['@type'] as string | undefined;\n if (!type) {\n results.push({\n ruleId: 'structured-data-validate',\n ruleName: 'Structured Data Validation',\n message: 'JSON-LD block missing @type property',\n severity: 'WARNING',\n category: 'SEO',\n tier: 'pro',\n fix: 'Add an @type property (e.g., \"Organization\", \"WebPage\", \"Article\") to your JSON-LD.',\n });\n return;\n }\n\n // Check for @context\n if (!data['@context']) {\n results.push({\n ruleId: 'structured-data-validate',\n ruleName: 'Structured Data Validation',\n message: `JSON-LD \"${type}\" missing @context — should be \"https://schema.org\"`,\n severity: 'WARNING',\n category: 'SEO',\n tier: 'pro',\n fix: 'Add \"@context\": \"https://schema.org\" to your JSON-LD block.',\n data: { type },\n });\n }\n\n // Validate required fields for known types\n const required = REQUIRED_FIELDS[type];\n if (required) {\n const missing = required.filter((field) => !data[field]);\n if (missing.length > 0) {\n results.push({\n ruleId: 'structured-data-validate',\n ruleName: 'Structured Data Validation',\n message: `JSON-LD \"${type}\" missing required fields: ${missing.join(', ')}`,\n severity: 'WARNING',\n category: 'SEO',\n tier: 'pro',\n fix: `Add the missing fields to your ${type} schema: ${missing.join(', ')}.`,\n data: { type, missing },\n });\n }\n }\n });\n\n return results;\n },\n};\n","import type { Rule, RuleContext, RuleResult } from '@lintpage/core';\n\nexport const hreflangRule: Rule = {\n meta: {\n id: 'hreflang',\n name: 'Hreflang Tags',\n category: 'SEO',\n tier: 'pro',\n description:\n 'Validates hreflang tags for multi-language pages',\n },\n run(context: RuleContext): RuleResult[] {\n const { document, url } = context;\n const results: RuleResult[] = [];\n\n const hreflangTags = document.querySelectorAll(\n 'link[rel=\"alternate\"][hreflang]'\n );\n\n if (hreflangTags.length === 0) return results;\n\n // Check for x-default\n const hasXDefault = Array.from(hreflangTags).some(\n (tag) => tag.getAttribute('hreflang') === 'x-default'\n );\n if (!hasXDefault) {\n results.push({\n ruleId: 'hreflang',\n ruleName: 'Hreflang Tags',\n message:\n 'Hreflang tags found but missing x-default — add a fallback for unmatched languages',\n severity: 'WARNING',\n category: 'SEO',\n tier: 'pro',\n fix: 'Add <link rel=\"alternate\" hreflang=\"x-default\" href=\"...\" /> to specify the default/fallback page.',\n });\n }\n\n // Check for self-referencing hreflang\n const hasSelfRef = Array.from(hreflangTags).some((tag) => {\n const href = tag.getAttribute('href');\n return href === url || href === url.replace(/\\/$/, '');\n });\n if (!hasSelfRef) {\n results.push({\n ruleId: 'hreflang',\n ruleName: 'Hreflang Tags',\n message:\n 'Hreflang tags do not include a self-referencing tag for the current page',\n severity: 'WARNING',\n category: 'SEO',\n tier: 'pro',\n fix: 'Add a hreflang tag that points to the current page URL with the appropriate language code.',\n });\n }\n\n // Validate language codes\n const langCodePattern = /^[a-z]{2}(-[A-Z]{2})?$/;\n hreflangTags.forEach((tag) => {\n const lang = tag.getAttribute('hreflang');\n if (lang && lang !== 'x-default' && !langCodePattern.test(lang)) {\n results.push({\n ruleId: 'hreflang',\n ruleName: 'Hreflang Tags',\n message: `Invalid hreflang language code \"${lang}\" — use ISO 639-1 format (e.g., \"en\", \"en-US\")`,\n severity: 'WARNING',\n category: 'SEO',\n tier: 'pro',\n fix: `Change \"${lang}\" to a valid ISO 639-1 language code (e.g., \"en\", \"fr\", \"de-AT\").`,\n data: { invalidLang: lang },\n });\n }\n\n // Check for absolute URLs\n const href = tag.getAttribute('href');\n if (href && !href.startsWith('http')) {\n results.push({\n ruleId: 'hreflang',\n ruleName: 'Hreflang Tags',\n message: `Hreflang href should be an absolute URL (found: \"${href}\")`,\n severity: 'WARNING',\n category: 'SEO',\n tier: 'pro',\n fix: 'Use absolute URLs (starting with https://) for all hreflang href attributes.',\n });\n }\n });\n\n return results;\n },\n};\n","import type { Rule, RuleContext, RuleResult } from '@lintpage/core';\n\nexport const canonicalSelfReferencingRule: Rule = {\n meta: {\n id: 'canonical-self-referencing',\n name: 'Canonical Self-Referencing',\n category: 'SEO',\n tier: 'pro',\n description:\n 'Checks that the canonical URL points to the current page (self-referencing canonical)',\n },\n run(context: RuleContext): RuleResult[] {\n const { document, url } = context;\n const results: RuleResult[] = [];\n\n const canonical = document.querySelector('link[rel=\"canonical\"]');\n if (!canonical) return results;\n\n const href = canonical.getAttribute('href')?.trim();\n if (!href) return results;\n\n // Normalize URLs for comparison (remove trailing slash, lowercase)\n const normalize = (u: string) =>\n u.replace(/\\/$/, '').toLowerCase();\n\n try {\n const canonicalUrl = new URL(href, url).href;\n const normalizedCanonical = normalize(canonicalUrl);\n const normalizedUrl = normalize(url);\n\n if (normalizedCanonical !== normalizedUrl) {\n // Canonical points to a different page\n const sameHost =\n new URL(canonicalUrl).hostname === new URL(url).hostname;\n\n if (sameHost) {\n results.push({\n ruleId: 'canonical-self-referencing',\n ruleName: 'Canonical Self-Referencing',\n message: `Canonical URL points to a different page on the same site — this tells search engines to index \"${canonicalUrl}\" instead of this page`,\n severity: 'INFO',\n category: 'SEO',\n tier: 'pro',\n fix: 'If this page should be indexed, change the canonical to point to itself. If this is intentional (e.g., pagination), you can ignore this.',\n data: { canonical: canonicalUrl, pageUrl: url },\n });\n } else {\n results.push({\n ruleId: 'canonical-self-referencing',\n ruleName: 'Canonical Self-Referencing',\n message: `Canonical URL points to a different domain (\"${new URL(canonicalUrl).hostname}\") — this is unusual and may be a misconfiguration`,\n severity: 'WARNING',\n category: 'SEO',\n tier: 'pro',\n fix: 'Cross-domain canonical tags are rarely correct. Verify this is intentional, otherwise change the canonical to point to this page.',\n data: { canonical: canonicalUrl, pageUrl: url },\n });\n }\n }\n } catch {\n results.push({\n ruleId: 'canonical-self-referencing',\n ruleName: 'Canonical Self-Referencing',\n message: `Cannot parse canonical URL \"${href}\" — ensure it's a valid absolute URL`,\n severity: 'WARNING',\n category: 'SEO',\n tier: 'pro',\n fix: 'Use a valid absolute URL for your canonical tag (e.g., https://yoursite.com/page).',\n });\n }\n\n return results;\n },\n};\n","import type { Rule, RuleContext, RuleResult } from '@lintpage/core';\n\nexport const metaRenderBlockingRule: Rule = {\n meta: {\n id: 'meta-render-blocking',\n name: 'Render-Blocking Resources',\n category: 'Performance',\n tier: 'pro',\n description:\n 'Checks for render-blocking stylesheets and synchronous scripts in the <head>',\n },\n run(context: RuleContext): RuleResult[] {\n const { document } = context;\n const results: RuleResult[] = [];\n\n const head = document.querySelector('head');\n if (!head) return results;\n\n // Check for synchronous scripts in <head> (no defer/async)\n const headScripts = head.querySelectorAll('script[src]');\n let blockingScripts = 0;\n headScripts.forEach((script) => {\n const hasAsync = script.hasAttribute('async');\n const hasDefer = script.hasAttribute('defer');\n const type = script.getAttribute('type');\n\n // module scripts are deferred by default\n if (!hasAsync && !hasDefer && type !== 'module') {\n blockingScripts++;\n }\n });\n\n if (blockingScripts > 0) {\n results.push({\n ruleId: 'meta-render-blocking',\n ruleName: 'Render-Blocking Resources',\n message: `${blockingScripts} synchronous script(s) in <head> may block page rendering`,\n severity: 'WARNING',\n category: 'Performance',\n tier: 'pro',\n fix: 'Add async or defer attributes to non-critical scripts in the <head>, or move them to the end of <body>.',\n data: { blockingScripts },\n });\n }\n\n // Check for render-blocking stylesheets without media attribute\n const stylesheets = head.querySelectorAll(\n 'link[rel=\"stylesheet\"]'\n );\n let blockingStylesheets = 0;\n stylesheets.forEach((link) => {\n const media = link.getAttribute('media');\n // Stylesheets with media=\"print\" or other specific media queries are not render-blocking\n if (!media || media === 'all') blockingStylesheets++;\n });\n\n if (blockingStylesheets > 3) {\n results.push({\n ruleId: 'meta-render-blocking',\n ruleName: 'Render-Blocking Resources',\n message: `${blockingStylesheets} render-blocking stylesheets in <head> — consider inlining critical CSS`,\n severity: 'INFO',\n category: 'Performance',\n tier: 'pro',\n fix: 'Inline critical CSS and load non-critical stylesheets asynchronously using media=\"print\" with an onload handler.',\n data: { blockingStylesheets },\n });\n }\n\n return results;\n },\n};\n","import type { Rule, RuleContext, RuleResult } from '@lintpage/core';\n\nexport const lazyLoadLcpRule: Rule = {\n meta: {\n id: 'lazy-load-lcp',\n name: 'Lazy Load LCP',\n category: 'Performance',\n tier: 'pro',\n description:\n 'Checks that above-the-fold images (likely LCP candidates) are not lazy-loaded',\n },\n run(context: RuleContext): RuleResult[] {\n const { document } = context;\n const results: RuleResult[] = [];\n\n // The first <img> in the document is likely the LCP element.\n // If it has loading=\"lazy\", it will be deferred and hurt LCP.\n const images = document.querySelectorAll('img');\n const firstImages = Array.from(images).slice(0, 3);\n\n for (const img of firstImages) {\n const loading = img.getAttribute('loading');\n const fetchpriority = img.getAttribute('fetchpriority');\n\n if (loading === 'lazy') {\n const src = img.getAttribute('src') || '';\n const alt = img.getAttribute('alt') || '';\n const identifier = alt\n ? `\"${alt.substring(0, 40)}\"`\n : src\n ? `src=\"${src.substring(0, 50)}\"`\n : 'first image';\n\n results.push({\n ruleId: 'lazy-load-lcp',\n ruleName: 'Lazy Load LCP',\n message: `Above-the-fold image (${identifier}) has loading=\"lazy\" — this delays the Largest Contentful Paint`,\n severity: 'WARNING',\n category: 'Performance',\n tier: 'pro',\n fix: 'Remove loading=\"lazy\" from above-the-fold images. Add fetchpriority=\"high\" to the LCP image instead.',\n });\n break; // Only flag the first one\n }\n\n // Suggest fetchpriority for likely LCP image\n if (!fetchpriority && !loading) {\n results.push({\n ruleId: 'lazy-load-lcp',\n ruleName: 'Lazy Load LCP',\n message:\n 'Consider adding fetchpriority=\"high\" to your hero/banner image to improve Largest Contentful Paint',\n severity: 'INFO',\n category: 'Performance',\n tier: 'pro',\n fix: 'Add fetchpriority=\"high\" to the most important above-the-fold image to prioritize its loading.',\n });\n break;\n }\n }\n\n return results;\n },\n};\n","import type { Rule, RuleContext, RuleResult } from '@lintpage/core';\n\nexport const httpsLinksRule: Rule = {\n meta: {\n id: 'https-links',\n name: 'HTTPS Links',\n category: 'Pre-Launch',\n tier: 'pro',\n description:\n 'Checks that internal links use HTTPS instead of HTTP',\n },\n run(context: RuleContext): RuleResult[] {\n const { document, url } = context;\n const results: RuleResult[] = [];\n\n let hostname: string;\n try {\n hostname = new URL(url).hostname;\n } catch {\n return results;\n }\n\n const links = document.querySelectorAll('a[href^=\"http:\"]');\n let internalHttpLinks = 0;\n let externalHttpLinks = 0;\n\n links.forEach((link) => {\n const href = link.getAttribute('href');\n if (!href) return;\n\n try {\n const linkHostname = new URL(href).hostname;\n if (linkHostname === hostname) {\n internalHttpLinks++;\n } else {\n externalHttpLinks++;\n }\n } catch {\n // Invalid URL, skip\n }\n });\n\n if (internalHttpLinks > 0) {\n results.push({\n ruleId: 'https-links',\n ruleName: 'HTTPS Links',\n message: `${internalHttpLinks} internal link(s) use HTTP instead of HTTPS`,\n severity: 'WARNING',\n category: 'Pre-Launch',\n tier: 'pro',\n fix: 'Change all internal links from http:// to https:// to avoid redirect chains and mixed content warnings.',\n data: { internalHttpLinks },\n });\n }\n\n if (externalHttpLinks > 0) {\n results.push({\n ruleId: 'https-links',\n ruleName: 'HTTPS Links',\n message: `${externalHttpLinks} external link(s) use HTTP — consider updating to HTTPS where available`,\n severity: 'INFO',\n category: 'Pre-Launch',\n tier: 'pro',\n fix: 'Update external links to use https:// where the destination supports it.',\n data: { externalHttpLinks },\n });\n }\n\n return results;\n },\n};\n","import type { Rule, RuleContext, RuleResult } from '@lintpage/core';\n\nexport const metaRefreshRedirectRule: Rule = {\n meta: {\n id: 'meta-refresh-redirect',\n name: 'Meta Refresh Redirect',\n category: 'SEO',\n tier: 'pro',\n description:\n 'Checks for <meta http-equiv=\"refresh\"> redirects which are bad for SEO',\n },\n run(context: RuleContext): RuleResult[] {\n const { document } = context;\n const results: RuleResult[] = [];\n\n const metaRefresh = document.querySelector(\n 'meta[http-equiv=\"refresh\"]'\n );\n\n if (!metaRefresh) return results;\n\n const content = metaRefresh.getAttribute('content') || '';\n const hasUrl = content.toLowerCase().includes('url=');\n const delay = Number.parseInt(content.split(';')[0] || '', 10);\n\n if (hasUrl) {\n results.push({\n ruleId: 'meta-refresh-redirect',\n ruleName: 'Meta Refresh Redirect',\n message: `Page uses a meta refresh redirect${!Number.isNaN(delay) ? ` (${delay}s delay)` : ''} — use server-side 301 redirects instead`,\n severity: 'WARNING',\n category: 'SEO',\n tier: 'pro',\n fix: 'Replace <meta http-equiv=\"refresh\"> with a server-side 301 redirect. Meta refreshes are bad for SEO and user experience.',\n data: { content, delay: Number.isNaN(delay) ? undefined : delay },\n });\n } else if (!Number.isNaN(delay) && delay > 0) {\n results.push({\n ruleId: 'meta-refresh-redirect',\n ruleName: 'Meta Refresh Redirect',\n message: `Page auto-refreshes every ${delay} seconds — this may cause usability issues`,\n severity: 'INFO',\n category: 'SEO',\n tier: 'pro',\n fix: 'Consider removing the auto-refresh meta tag unless it serves a clear user need.',\n data: { content, delay },\n });\n }\n\n return results;\n },\n};\n","import type { Rule, RuleContext, RuleResult } from '@lintpage/core';\n\nexport const nofollowAuditRule: Rule = {\n meta: {\n id: 'nofollow-audit',\n name: 'Nofollow Audit',\n category: 'SEO',\n tier: 'pro',\n description:\n 'Audits the use of rel=\"nofollow\" on internal vs. external links',\n },\n run(context: RuleContext): RuleResult[] {\n const { document, url } = context;\n const results: RuleResult[] = [];\n\n let hostname: string;\n try {\n hostname = new URL(url).hostname;\n } catch {\n return results;\n }\n\n const nofollowLinks = document.querySelectorAll('a[rel~=\"nofollow\"]');\n let internalNofollow = 0;\n\n nofollowLinks.forEach((link) => {\n const href = link.getAttribute('href');\n if (!href) return;\n\n try {\n const linkHostname = new URL(href, url).hostname;\n if (linkHostname === hostname) internalNofollow++;\n } catch {\n // Relative URLs are internal\n if (href.startsWith('/') || href.startsWith('.')) {\n internalNofollow++;\n }\n }\n });\n\n if (internalNofollow > 0) {\n results.push({\n ruleId: 'nofollow-audit',\n ruleName: 'Nofollow Audit',\n message: `${internalNofollow} internal link(s) have rel=\"nofollow\" — this wastes PageRank and hurts internal linking`,\n severity: 'WARNING',\n category: 'SEO',\n tier: 'pro',\n fix: 'Remove rel=\"nofollow\" from internal links. Nofollow should only be used for external links you do not want to endorse (e.g., user-generated content, sponsored links).',\n data: { internalNofollow, totalNofollow: nofollowLinks.length },\n });\n }\n\n return results;\n },\n};\n","import type { Rule, StandaloneRule } from '@lintpage/core';\n\n// Ported rules — Pre-Launch\nimport { sslRule } from './ssl';\nimport { robotsTxtCheckRule } from './robots-txt-check';\nimport { sitemapPresenceRule } from './sitemap-presence';\nimport { trackingRule } from './tracking';\nimport { xRobotsTagRule } from './x-robots-tag';\n\n// Ported rules — Content / SEO\nimport { thinContentRule } from './thin-content';\nimport { duplicateMetaRule } from './duplicate-meta';\nimport { structuredDataRule } from './structured-data';\nimport { charsetRule } from './charset';\n\n// Ported rules — Accessibility\nimport { imageAltTextRule } from './image-alt-text';\nimport { accessibilityRule } from './accessibility';\nimport { semanticStructureRule } from './semantic-structure';\n\n// Ported rules — Performance\nimport { performanceRule } from './performance';\nimport { imageDimensionsRule } from './image-dimensions';\nimport { ttfbRule } from './ttfb';\n\n// Ported rules — Security\nimport { mixedContentRule } from './mixed-content';\nimport { securityHeadersRule } from './security-headers';\n\n// New rules — Social\nimport { ogImageSizeRule } from './og-image-size';\nimport { ogImageTypeRule } from './og-image-type';\nimport { twitterImageRule } from './twitter-image';\nimport { socialPreviewRenderRule } from './social-preview-render';\n\n// New rules — Content\nimport { titleKeywordStuffingRule } from './title-keyword-stuffing';\nimport { contentToHtmlRatioRule } from './content-to-html-ratio';\nimport { titleUniquenessRule } from './title-uniqueness';\nimport { descriptionUniquenessRule } from './description-uniqueness';\n\n// New rules — Technical\nimport { structuredDataValidateRule } from './structured-data-validate';\nimport { hreflangRule } from './hreflang';\nimport { canonicalSelfReferencingRule } from './canonical-self-referencing';\n\n// New rules — Performance\nimport { metaRenderBlockingRule } from './meta-render-blocking';\nimport { lazyLoadLcpRule } from './lazy-load-lcp';\n\n// New rules — Security / SEO\nimport { httpsLinksRule } from './https-links';\nimport { metaRefreshRedirectRule } from './meta-refresh-redirect';\nimport { nofollowAuditRule } from './nofollow-audit';\n\n/**\n * All synchronous pro rules (run with document + response context).\n */\nexport const proRules: Rule[] = [\n // Ported — Pre-Launch\n sslRule,\n trackingRule,\n xRobotsTagRule,\n\n // Ported — Content / SEO\n thinContentRule,\n duplicateMetaRule,\n structuredDataRule,\n charsetRule,\n\n // Ported — Accessibility\n imageAltTextRule,\n accessibilityRule,\n semanticStructureRule,\n\n // Ported — Performance\n performanceRule,\n imageDimensionsRule,\n\n // Ported — Security\n mixedContentRule,\n securityHeadersRule,\n\n // New — Social\n ogImageSizeRule,\n ogImageTypeRule,\n twitterImageRule,\n socialPreviewRenderRule,\n\n // New — Content\n titleKeywordStuffingRule,\n contentToHtmlRatioRule,\n titleUniquenessRule,\n descriptionUniquenessRule,\n\n // New — Technical\n structuredDataValidateRule,\n hreflangRule,\n canonicalSelfReferencingRule,\n\n // New — Performance\n metaRenderBlockingRule,\n lazyLoadLcpRule,\n\n // New — Security / SEO\n httpsLinksRule,\n metaRefreshRedirectRule,\n nofollowAuditRule,\n];\n\n/**\n * Standalone pro rules (run independently with just a URL, make their own HTTP requests).\n */\nexport const proStandaloneRules: StandaloneRule[] = [\n robotsTxtCheckRule,\n sitemapPresenceRule,\n ttfbRule,\n];\n\n// Re-export all individual rules\nexport {\n sslRule,\n robotsTxtCheckRule,\n sitemapPresenceRule,\n trackingRule,\n xRobotsTagRule,\n thinContentRule,\n duplicateMetaRule,\n structuredDataRule,\n charsetRule,\n imageAltTextRule,\n accessibilityRule,\n semanticStructureRule,\n performanceRule,\n imageDimensionsRule,\n ttfbRule,\n mixedContentRule,\n securityHeadersRule,\n ogImageSizeRule,\n ogImageTypeRule,\n twitterImageRule,\n socialPreviewRenderRule,\n titleKeywordStuffingRule,\n contentToHtmlRatioRule,\n titleUniquenessRule,\n descriptionUniquenessRule,\n structuredDataValidateRule,\n hreflangRule,\n canonicalSelfReferencingRule,\n metaRenderBlockingRule,\n lazyLoadLcpRule,\n httpsLinksRule,\n metaRefreshRedirectRule,\n nofollowAuditRule,\n};\n","import * as jose from 'jose';\n\nexport interface LicensePayload {\n sub: string; // user or team id\n plan: 'pro' | 'team' | 'enterprise';\n iat: number;\n exp: number;\n}\n\nexport interface LicenseResult {\n valid: boolean;\n payload?: LicensePayload;\n error?: string;\n}\n\n// Ed25519 public key for offline JWT verification.\n// The corresponding private key lives server-side and signs tokens on subscription.\nconst PUBLIC_KEY_JWK: jose.JWK = {\n kty: 'OKP',\n crv: 'Ed25519',\n x: 'Q628CrspKqI_ig04oril9DaBhFaCJ2fJtoeFJhzrWek',\n};\n\nlet cachedPublicKey: jose.CryptoKey | null = null;\n\nasync function getPublicKey(): Promise<jose.CryptoKey> {\n if (!cachedPublicKey) {\n cachedPublicKey = await jose.importJWK(PUBLIC_KEY_JWK, 'EdDSA') as jose.CryptoKey;\n }\n return cachedPublicKey;\n}\n\n/**\n * Validate a JWT license key offline using Ed25519.\n * Returns the decoded payload if valid, or an error message.\n */\nexport async function validateLicense(token: string): Promise<LicenseResult> {\n try {\n const publicKey = await getPublicKey();\n const { payload } = await jose.jwtVerify(token, publicKey, {\n algorithms: ['EdDSA'],\n issuer: 'lintpage',\n audience: 'lintpage-pro',\n });\n\n const licensePayload: LicensePayload = {\n sub: payload.sub as string,\n plan: payload.plan as LicensePayload['plan'],\n iat: payload.iat as number,\n exp: payload.exp as number,\n };\n\n return { valid: true, payload: licensePayload };\n } catch (err) {\n const message = err instanceof Error ? err.message : 'Invalid license key';\n return { valid: false, error: message };\n }\n}\n\n/**\n * Check if a license is valid without throwing.\n * Convenience wrapper for quick boolean checks.\n */\nexport async function isLicenseValid(token: string): Promise<boolean> {\n const result = await validateLicense(token);\n return result.valid;\n}\n","import type { RulePlugin } from '@lintpage/core';\nimport { proRules, proStandaloneRules } from './rules';\n\n/**\n * The @lintpage/pro plugin — 32 paid rules + 3 standalone rules.\n *\n * Usage:\n * import { proPlugin } from '@lintpage/pro';\n * const result = await auditPage(url, { plugins: [proPlugin] });\n */\nexport const proPlugin: RulePlugin = {\n name: '@lintpage/pro',\n rules: proRules,\n standaloneRules: proStandaloneRules,\n};\n\n/**\n * Load the pro plugin. Convenience wrapper for dynamic imports.\n */\nexport function loadProPlugin(): RulePlugin {\n return proPlugin;\n}\n\n// License validation\nexport { validateLicense, isLicenseValid } from './license';\nexport type { LicensePayload, LicenseResult } from './license';\n\n// Rules\nexport { proRules, proStandaloneRules } from './rules';\nexport * from './rules';\n","import chalk from 'chalk';\nimport type { PageResult, RuleResult, Severity } from '@lintpage/core';\n\nexport type Format = 'text' | 'json' | 'github';\n\n// ── Text formatter ─────────────────────────────────────────────\n\nconst SEVERITY_ICON: Record<Severity, string> = {\n CRITICAL: chalk.red.bold('✗'),\n WARNING: chalk.yellow('⚠'),\n INFO: chalk.blue('ℹ'),\n};\n\nconst SEVERITY_LABEL: Record<Severity, string> = {\n CRITICAL: chalk.red.bold('CRITICAL'),\n WARNING: chalk.yellow('WARNING'),\n INFO: chalk.blue('INFO'),\n};\n\nfunction groupByCategory(results: RuleResult[]): Record<string, RuleResult[]> {\n const groups: Record<string, RuleResult[]> = {};\n for (const r of results) {\n (groups[r.category] ??= []).push(r);\n }\n return groups;\n}\n\nexport function formatText(result: PageResult, quiet: boolean): string {\n const lines: string[] = [];\n\n const statusColor = result.overallStatus === 'PASS' ? chalk.green : chalk.red;\n lines.push('');\n lines.push(\n `${chalk.bold('LintPage')} audit for ${chalk.underline(result.url)}`\n );\n lines.push(\n `Score: ${statusColor.bold(String(result.score))}/100 Status: ${statusColor.bold(result.overallStatus)}`\n );\n lines.push('');\n\n if (result.results.length === 0) {\n lines.push(chalk.green(' No issues found!'));\n lines.push('');\n return lines.join('\\n');\n }\n\n if (quiet) {\n const critical = result.results.filter((r) => r.severity === 'CRITICAL').length;\n const warnings = result.results.filter((r) => r.severity === 'WARNING').length;\n const info = result.results.filter((r) => r.severity === 'INFO').length;\n lines.push(\n ` ${chalk.red.bold(`${critical} critical`)} ${chalk.yellow(`${warnings} warnings`)} ${chalk.blue(`${info} info`)}`\n );\n lines.push('');\n return lines.join('\\n');\n }\n\n // Category scores\n for (const [category, scores] of Object.entries(result.categoryScores)) {\n const pct = scores.max > 0 ? Math.round((scores.score / scores.max) * 100) : 100;\n const color = pct >= 80 ? chalk.green : pct >= 50 ? chalk.yellow : chalk.red;\n lines.push(\n ` ${chalk.bold(category.padEnd(16))} ${color(`${scores.score}/${scores.max}`)} ${chalk.dim(`(${pct}%)`)}`\n );\n }\n lines.push('');\n\n // Issues grouped by category\n const grouped = groupByCategory(result.results);\n for (const [category, issues] of Object.entries(grouped)) {\n lines.push(chalk.bold.underline(` ${category}`));\n for (const issue of issues) {\n lines.push(\n ` ${SEVERITY_ICON[issue.severity]} ${SEVERITY_LABEL[issue.severity].padEnd(20)} ${issue.message}`\n );\n if (issue.fix) {\n lines.push(` ${chalk.dim(issue.fix)}`);\n }\n }\n lines.push('');\n }\n\n return lines.join('\\n');\n}\n\n// ── JSON formatter ─────────────────────────────────────────────\n\nexport function formatJson(result: PageResult): string {\n return JSON.stringify(result, null, 2);\n}\n\n// ── GitHub Actions formatter ───────────────────────────────────\n\nconst GH_LEVEL: Record<Severity, string> = {\n CRITICAL: 'error',\n WARNING: 'warning',\n INFO: 'notice',\n};\n\nexport function formatGithub(result: PageResult): string {\n const lines: string[] = [];\n\n for (const issue of result.results) {\n const level = GH_LEVEL[issue.severity];\n const title = `[${issue.ruleId}] ${issue.ruleName}`;\n // GitHub annotation format: ::level title=TITLE::MESSAGE\n lines.push(`::${level} title=${title}::${issue.message}`);\n }\n\n // Summary annotation\n const statusEmoji = result.overallStatus === 'PASS' ? '✅' : '❌';\n lines.push(\n `::notice title=LintPage Score::${statusEmoji} ${result.url} — Score: ${result.score}/100 (${result.overallStatus})`\n );\n\n return lines.join('\\n');\n}\n\n// ── Dispatcher ─────────────────────────────────────────────────\n\nexport function format(\n result: PageResult,\n fmt: Format,\n quiet: boolean\n): string {\n switch (fmt) {\n case 'json':\n return formatJson(result);\n case 'github':\n return formatGithub(result);\n case 'text':\n default:\n return formatText(result, quiet);\n }\n}\n","import type { PageResult } from '@lintpage/core';\n\nexport interface ReportOptions {\n apiUrl: string;\n token: string;\n}\n\nexport async function reportResults(\n result: PageResult,\n options: ReportOptions\n): Promise<void> {\n const url = options.apiUrl.replace(/\\/$/, '') + '/api/v1/reports';\n\n const response = await fetch(url, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: `Bearer ${options.token}`,\n },\n body: JSON.stringify(result),\n });\n\n if (!response.ok) {\n const body = await response.text().catch(() => '');\n throw new Error(\n `Failed to report results: ${response.status} ${response.statusText}${body ? ` — ${body}` : ''}`\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iBAAgB;AAChB,IAAAA,gBAAkB;;;AeDlB,mBAAsB;AECtB,gBAAyC;AACzC,kBAAqB;AhBAd,IAAM,YAAkB;EAC7B,MAAM;IACJ,I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