@fairfox/polly 0.29.2 → 0.29.4
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/dist/src/mesh.js +15 -2
- package/dist/src/mesh.js.map +3 -3
- package/dist/src/peer.js +15 -2
- package/dist/src/peer.js.map +3 -3
- package/dist/tools/quality/src/cli.js +231 -3
- package/dist/tools/quality/src/cli.js.map +6 -4
- package/dist/tools/quality/src/index.d.ts +2 -0
- package/dist/tools/quality/src/index.js +221 -1
- package/dist/tools/quality/src/index.js.map +6 -4
- package/dist/tools/quality/src/no-require.d.ts +44 -0
- package/dist/tools/quality/src/secrets.d.ts +100 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../tools/quality/src/check-shared-components.ts", "../tools/quality/src/css/shared.ts", "../tools/quality/src/logger.ts", "../tools/quality/src/css/check-layout.ts", "../tools/quality/src/css/check-quality.ts", "../tools/quality/src/css/check-unused.ts", "../tools/quality/src/css/check-vars.ts", "../tools/quality/src/no-as-casting.ts"],
|
|
3
|
+
"sources": ["../tools/quality/src/check-shared-components.ts", "../tools/quality/src/css/shared.ts", "../tools/quality/src/logger.ts", "../tools/quality/src/css/check-layout.ts", "../tools/quality/src/css/check-quality.ts", "../tools/quality/src/css/check-unused.ts", "../tools/quality/src/css/check-vars.ts", "../tools/quality/src/no-as-casting.ts", "../tools/quality/src/no-require.ts", "../tools/quality/src/secrets.ts"],
|
|
4
4
|
"sourcesContent": [
|
|
5
5
|
"/**\n * Ban raw native interactive HTML elements in app source.\n *\n * Applications that consume `@fairfox/polly/ui` are expected to use\n * the shared primitives (`<Button>`, `<ActionInput>`, `<Layout>`,\n * `<Modal>`, `<ActionForm>`, `<Select>`) rather than writing raw\n * `<button>`, `<input>`, `<select>`, `<textarea>`, `<form>`, or\n * `<dialog>` elements. The primitives enforce data-action delegation,\n * typed CSS-module classNames, accessibility attributes, and the\n * layouting ban.\n *\n * This module exposes a programmatic check — `checkSharedComponents`\n * — that walks a directory, scans every .tsx / .jsx file, and\n * returns every violation it finds. Consumers typically wire it into\n * a `bun check` script and set `exemptPackages` / `allowPaths` for\n * legacy code that can't migrate yet.\n *\n * @example\n * ```ts\n * import { checkSharedComponents } from \"@fairfox/polly/quality\";\n *\n * const result = await checkSharedComponents({\n * root: process.cwd(),\n * scanRoot: \"packages\",\n * exemptPackages: new Set([\"struggle\", \"todo\"]),\n * });\n * if (result.violations.length > 0) {\n * result.print(console.error);\n * process.exit(1);\n * }\n * ```\n */\n\nimport type { Dirent } from \"node:fs\";\nimport { readdir } from \"node:fs/promises\";\nimport { join, relative } from \"node:path\";\n\n/** One raw-element rule. Each rule flags a native element and\n * suggests the polly primitive that replaces it. */\nexport interface SharedComponentRule {\n /** Regular expression that matches the opening tag, e.g. /<button[\\s>]/. */\n pattern: RegExp;\n /** Human-readable element marker, e.g. \"<button>\". */\n element: string;\n /** Suggested replacement, e.g. \"<Button>\". */\n replacement: string;\n /** Optional predicate; when it returns true the match is skipped.\n * Used for legitimate raw usages (e.g. `<input type=\"hidden\">`)\n * that have no primitive analogue. */\n skip?: (line: string) => boolean;\n}\n\n/** Default rule set. Covers every native element that has a\n * direct `@fairfox/polly/ui` replacement. Consumers may extend\n * through the `additionalRules` option. */\nexport const DEFAULT_SHARED_COMPONENT_RULES: SharedComponentRule[] = [\n { pattern: /<button[\\s>]/, element: \"<button>\", replacement: \"<Button>\" },\n {\n pattern: /<input[\\s>/]/,\n element: \"<input>\",\n replacement: \"<ActionInput> or <TextInput>\",\n // `<input type=\"hidden\">` has no primitive analogue and is a\n // legitimate way to carry form data.\n skip: (line) => /type=[\"']hidden[\"']/.test(line),\n },\n {\n pattern: /<textarea[\\s>]/,\n element: \"<textarea>\",\n replacement: '<ActionInput variant=\"multi\">',\n },\n { pattern: /<select[\\s>]/, element: \"<select>\", replacement: \"<Select>\" },\n { pattern: /<form[\\s>]/, element: \"<form>\", replacement: \"<ActionForm>\" },\n { pattern: /<dialog[\\s>]/, element: \"<dialog>\", replacement: \"<Modal>\" },\n];\n\n/** One violation: a raw element found in an app source file. */\nexport interface SharedComponentViolation {\n /** Path relative to `root`. */\n file: string;\n /** 1-based line number. */\n line: number;\n /** Element marker, e.g. \"<button>\". */\n element: string;\n /** Suggested replacement. */\n replacement: string;\n /** Trimmed offending line for context. */\n content: string;\n}\n\nexport interface CheckSharedComponentsOptions {\n /** Repository root. Violation file paths are reported relative to\n * this directory. */\n root: string;\n /** Directory under `root` to scan. Defaults to \"packages\". */\n scanRoot?: string;\n /** Directory names to skip entirely during traversal. Defaults to\n * node_modules / .git / dist / build / tests. */\n skipDirs?: Set<string>;\n /** Workspace package names (the directory names immediately under\n * `scanRoot`) to exempt. Useful for legacy packages that can't\n * migrate to the primitives yet. */\n exemptPackages?: Set<string>;\n /** Additional rules appended to {@link DEFAULT_SHARED_COMPONENT_RULES}. */\n additionalRules?: SharedComponentRule[];\n /** Override the default rule set entirely. If set,\n * `additionalRules` is ignored. */\n rules?: SharedComponentRule[];\n}\n\nconst DEFAULT_SKIP_DIRS = new Set([\"node_modules\", \".git\", \"dist\", \"build\", \"tests\"]);\n\nexport interface SharedComponentsCheckResult {\n violations: SharedComponentViolation[];\n print(log: (msg: string) => void): void;\n}\n\n/** Walk the configured directory, returning every violation found. */\nexport async function checkSharedComponents(\n options: CheckSharedComponentsOptions\n): Promise<SharedComponentsCheckResult> {\n const rules = options.rules ?? [\n ...DEFAULT_SHARED_COMPONENT_RULES,\n ...(options.additionalRules ?? []),\n ];\n const skipDirs = options.skipDirs ?? DEFAULT_SKIP_DIRS;\n const scanRoot = options.scanRoot ?? \"packages\";\n const exemptPackages = options.exemptPackages ?? new Set<string>();\n const packagesPath = join(options.root, scanRoot);\n const violations: SharedComponentViolation[] = [];\n\n await scanDirectory(packagesPath, {\n root: options.root,\n packagesPath,\n skipDirs,\n exemptPackages,\n rules,\n violations,\n });\n\n return {\n violations,\n print(log) {\n if (violations.length === 0) {\n log(\"[shared-components] ok\");\n return;\n }\n log(`[shared-components] ${violations.length} violation(s) found:\\n`);\n for (const v of violations) {\n log(` ${v.file}:${v.line} — ${v.element} → use ${v.replacement}`);\n log(` ${v.content}\\n`);\n }\n log(\"[shared-components] Use @fairfox/polly/ui primitives instead of native HTML elements.\");\n },\n };\n}\n\ninterface ScanState {\n root: string;\n packagesPath: string;\n skipDirs: Set<string>;\n exemptPackages: Set<string>;\n rules: SharedComponentRule[];\n violations: SharedComponentViolation[];\n}\n\nasync function scanDirectory(dir: string, state: ScanState): Promise<void> {\n let entries: Dirent[];\n try {\n entries = await readdir(dir, { withFileTypes: true });\n } catch {\n return;\n }\n for (const entry of entries) {\n const fullPath = join(dir, entry.name);\n if (entry.isDirectory()) {\n if (state.skipDirs.has(entry.name)) {\n continue;\n }\n if (dir === state.packagesPath && state.exemptPackages.has(entry.name)) {\n continue;\n }\n await scanDirectory(fullPath, state);\n } else if (entry.isFile() && (entry.name.endsWith(\".tsx\") || entry.name.endsWith(\".jsx\"))) {\n await scanFile(fullPath, state);\n }\n }\n}\n\nasync function scanFile(filePath: string, state: ScanState): Promise<void> {\n const text = await Bun.file(filePath).text();\n const lines = text.split(\"\\n\");\n\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i];\n if (!line) continue;\n const trimmed = line.trim();\n if (isCommentLine(trimmed)) continue;\n for (const rule of state.rules) {\n if (!matchesRule(line, rule)) continue;\n state.violations.push({\n file: relative(state.root, filePath),\n line: i + 1,\n element: rule.element,\n replacement: rule.replacement,\n content: trimmed,\n });\n }\n }\n}\n\nfunction isCommentLine(trimmed: string): boolean {\n return trimmed.startsWith(\"//\") || trimmed.startsWith(\"*\") || trimmed.startsWith(\"/*\");\n}\n\nfunction matchesRule(line: string, rule: SharedComponentRule): boolean {\n if (!rule.pattern.test(line)) return false;\n const commentIndex = line.indexOf(\"//\");\n const elementIndex = line.search(rule.pattern);\n if (commentIndex !== -1 && commentIndex < elementIndex) return false;\n if (rule.skip?.(line)) return false;\n return true;\n}\n",
|
|
6
6
|
"/**\n * Shared plumbing for CSS conformance checks.\n *\n * File discovery, violation printing, and common scanner options live\n * here so each check (`quality`, `layout`, `vars`, `unused`) can stay\n * focused on its own rule set.\n */\n\nimport type { Dirent } from \"node:fs\";\nimport { readdir } from \"node:fs/promises\";\nimport { join, relative } from \"node:path\";\nimport { logger } from \"../logger.ts\";\n\nexport type CssViolation = {\n file: string;\n line: number;\n rule: string;\n content: string;\n suggestion: string;\n};\n\nexport type CssCheckResult = {\n violations: CssViolation[];\n print: () => void;\n};\n\nexport type CssScanOptions = {\n rootDir: string;\n /** Directory names (not paths) to skip during recursion. */\n skipDirs?: string[];\n /** File names (not paths) to skip entirely. */\n skipFiles?: string[];\n};\n\nexport const DEFAULT_SKIP_DIRS = [\"node_modules\", \".git\", \"dist\", \"dist-test\", \"build\", \"coverage\"];\n\nexport async function walkDirectory(\n dir: string,\n visit: (filePath: string, relPath: string) => Promise<void>,\n opts: CssScanOptions\n): Promise<void> {\n const skipDirs = new Set(opts.skipDirs ?? DEFAULT_SKIP_DIRS);\n const skipFiles = new Set(opts.skipFiles ?? []);\n const rootDir = opts.rootDir;\n\n // biome-ignore lint/complexity/noExcessiveCognitiveComplexity: recursive walk with skip sets is inherently branchy.\n async function walk(current: string): Promise<void> {\n let entries: Dirent[];\n try {\n entries = await readdir(current, { withFileTypes: true });\n } catch {\n return;\n }\n for (const entry of entries) {\n const full = join(current, entry.name);\n if (entry.isDirectory()) {\n if (skipDirs.has(entry.name)) continue;\n await walk(full);\n } else if (entry.isFile()) {\n if (skipFiles.has(entry.name)) continue;\n const rel = relative(rootDir, full);\n await visit(full, rel);\n }\n }\n }\n\n await walk(dir);\n}\n\nexport function formatViolations(\n kind: string,\n violations: CssViolation[],\n rootDir: string\n): string[] {\n const lines: string[] = [];\n if (violations.length === 0) {\n lines.push(`✅ ${kind}: no violations`);\n return lines;\n }\n lines.push(`❌ ${kind}: ${violations.length} violation(s)`);\n const byFile = new Map<string, CssViolation[]>();\n for (const v of violations) {\n const bucket = byFile.get(v.file) ?? [];\n bucket.push(v);\n byFile.set(v.file, bucket);\n }\n for (const [file, fileViolations] of byFile) {\n lines.push(` ${relative(rootDir, file)}`);\n for (const v of fileViolations) {\n lines.push(` L${v.line}: ${v.content}`);\n lines.push(` → ${v.suggestion} [${v.rule}]`);\n }\n }\n return lines;\n}\n\nexport function makeResult(\n kind: string,\n rootDir: string,\n violations: CssViolation[]\n): CssCheckResult {\n return {\n violations,\n print() {\n for (const line of formatViolations(kind, violations, rootDir)) {\n if (line.startsWith(\"❌\")) {\n logger.error(line);\n } else {\n logger.log(line);\n }\n }\n },\n };\n}\n\n/** True when the line is a CSS comment (standalone or continuation). */\nexport function isInsideComment(line: string): boolean {\n const trimmed = line.trim();\n return trimmed.startsWith(\"/*\") || trimmed.startsWith(\"*\") || trimmed.startsWith(\"//\");\n}\n\n/** Heuristic: true when the given line number falls inside an @keyframes block. */\nexport function isInsideKeyframes(lineNum: number, allLines: readonly string[]): boolean {\n for (let i = lineNum - 1; i >= 0; i -= 1) {\n const l = allLines[i]?.trim() ?? \"\";\n if (l.startsWith(\"@keyframes\")) return true;\n if (l === \"}\" && i < lineNum - 1) return false;\n }\n return false;\n}\n",
|
|
@@ -9,9 +9,11 @@
|
|
|
9
9
|
"/**\n * CSS quality check.\n *\n * Every styled value that has a semantic token must reference the token.\n * Raw hex colours, rgba literals, rem values, numeric font-weights,\n * magic z-indexes, hardcoded border-radius / border-width / box-shadow,\n * inline transitions, and `!important` are all rejected. The rule set\n * is intentionally opinionated; consumers who need an escape hatch may\n * place a polly-ignore-all marker in a CSS comment on the first line\n * of a file to skip checks for that file.\n */\n\nimport type { CssCheckResult, CssViolation } from \"./shared.ts\";\nimport { isInsideComment, isInsideKeyframes, makeResult, walkDirectory } from \"./shared.ts\";\n\nexport type CssQualityOptions = {\n rootDir: string;\n /** Scan filter — files whose basename ends with one of these are checked. Default: `.module.css`. */\n extensions?: string[];\n /** File basenames skipped entirely. Default: `[\"theme.css\", \"tokens.css\"]`. */\n skipFiles?: string[];\n /** Directory names skipped during recursion. */\n skipDirs?: string[];\n /** Which rules to disable by id. */\n disableRules?: string[];\n};\n\ntype Rule = {\n id: string;\n check: (line: string, lineNum: number, allLines: readonly string[]) => string | null;\n};\n\nconst DEFAULT_RULES: Rule[] = [\n {\n id: \"no-hardcoded-color\",\n check: (line) => {\n if (isInsideComment(line)) return null;\n if (line.includes(\"var(\")) return null;\n if (/\\bcolor:\\s*(white|black|#[0-9a-fA-F]{3,8})\\b/.test(line)) {\n return \"Use a semantic colour token (--polly-text, --polly-text-muted, …)\";\n }\n if (/background(-color)?:\\s*#[0-9a-fA-F]{3,8}/.test(line) && !line.includes(\"var(\")) {\n return \"Use a semantic surface token (--polly-surface, --polly-surface-raised, …)\";\n }\n return null;\n },\n },\n {\n id: \"no-hardcoded-rgba\",\n check: (line) => {\n if (isInsideComment(line)) return null;\n if (!line.includes(\"rgba(\")) return null;\n if (line.includes(\"var(\")) return null;\n if (line.includes(\"color-mix(\")) return null;\n if (/background.*rgba/.test(line)) {\n return \"Use a semantic surface or overlay token\";\n }\n if (/box-shadow.*rgba/.test(line)) {\n return \"Use a semantic shadow token\";\n }\n return \"Use a semantic token instead of raw rgba()\";\n },\n },\n {\n id: \"no-hardcoded-z-index\",\n check: (line) => {\n const m = line.match(/z-index:\\s*(\\d+)/);\n if (!m?.[1]) return null;\n if (line.includes(\"var(\")) return null;\n if (Number.parseInt(m[1], 10) < 10) return null;\n return \"Use a --polly-z-* token\";\n },\n },\n {\n id: \"no-hardcoded-opacity\",\n check: (line) => {\n if (!/opacity:\\s*0\\.\\d/.test(line)) return null;\n if (line.includes(\"var(\")) return null;\n const m = line.match(/opacity:\\s*(0\\.\\d+)/);\n if (!m?.[1]) return null;\n const v = Number.parseFloat(m[1]);\n if (v >= 0.5 && v <= 0.7) {\n return \"Use var(--polly-opacity-disabled) for disabled states\";\n }\n return null;\n },\n },\n {\n id: \"no-hardcoded-transition\",\n check: (line, lineNum, allLines) => {\n if (isInsideKeyframes(lineNum, allLines)) return null;\n if (line.includes(\"var(--polly-motion\")) return null;\n if (!/(?:transition|animation)/.test(line)) return null;\n if (\n /\\d+(\\.\\d+)?(ms|s)\\s+(ease|linear|ease-in|ease-out|ease-in-out)/.test(line) &&\n !line.includes(\"infinite\")\n ) {\n return \"Use var(--polly-motion-fast|base|slow)\";\n }\n if (/\\s\\d+(\\.\\d+)?s[;\\s,]/.test(line) && !line.includes(\"infinite\")) {\n return \"Use var(--polly-motion-fast|base|slow)\";\n }\n return null;\n },\n },\n {\n id: \"no-important\",\n check: (line) => {\n if (isInsideComment(line)) return null;\n if (!line.includes(\"!important\")) return null;\n return \"Refactor specificity instead of using !important\";\n },\n },\n {\n id: \"no-rem-units\",\n check: (line, lineNum, allLines) => {\n if (isInsideComment(line)) return null;\n if (isInsideKeyframes(lineNum, allLines)) return null;\n if (/:\\s*[^;]*\\d+(\\.\\d+)?rem[;\\s]/.test(line)) {\n if (line.includes(\"calc(\") || line.includes(\"translateY(\")) {\n return null;\n }\n return \"Use --polly-space-* or --polly-text-* tokens instead of rem\";\n }\n return null;\n },\n },\n {\n id: \"no-hardcoded-border-width\",\n check: (line) => {\n if (isInsideComment(line)) return null;\n if (line.includes(\"var(--polly-border-width\")) return null;\n const m = line.match(/border(?:-(?:top|right|bottom|left))?:\\s*(\\d+)px\\s+solid/);\n if (!m?.[1]) return null;\n return \"Use a --polly-border-width-* token\";\n },\n },\n {\n id: \"no-hardcoded-border-radius\",\n check: (line) => {\n if (isInsideComment(line)) return null;\n if (line.includes(\"var(\")) return null;\n const m = line.match(/border-radius:\\s*(\\d+)px/);\n if (!m?.[1]) return null;\n if (m[1] === \"0\") return null;\n return \"Use a --polly-radius-{sm,md,lg} token\";\n },\n },\n {\n id: \"no-hardcoded-box-shadow\",\n check: (line) => {\n if (isInsideComment(line)) return null;\n if (!line.includes(\"box-shadow:\")) return null;\n if (line.includes(\"var(--polly-shadow\")) return null;\n if (line.includes(\"var(--polly-focus-ring\")) return null;\n if (line.includes(\"var(\")) return null;\n if (/box-shadow:\\s*none/.test(line)) return null;\n return \"Use var(--polly-shadow-*) or var(--polly-focus-ring)\";\n },\n },\n {\n id: \"no-hardcoded-font-weight\",\n check: (line) => {\n if (!/font-weight:\\s*\\d{3}/.test(line)) return null;\n if (line.includes(\"var(\")) return null;\n return \"Use var(--polly-weight-normal|medium|bold)\";\n },\n },\n];\n\nexport async function checkCssQuality(options: CssQualityOptions): Promise<CssCheckResult> {\n const rootDir = options.rootDir;\n const extensions = options.extensions ?? [\".module.css\"];\n const skipFiles = options.skipFiles ?? [\"theme.css\", \"tokens.css\"];\n const disabled = new Set(options.disableRules ?? []);\n const rules = DEFAULT_RULES.filter((r) => !disabled.has(r.id));\n const violations: CssViolation[] = [];\n\n await walkDirectory(\n rootDir,\n // biome-ignore lint/complexity/noExcessiveCognitiveComplexity: per-file nested rule loop; readable as written.\n async (full) => {\n if (!extensions.some((ext) => full.endsWith(ext))) return;\n const content = await Bun.file(full).text();\n const lines = content.split(\"\\n\");\n const hasFileIgnore = lines[0]?.includes(\"polly-ignore-all\");\n if (hasFileIgnore) return;\n\n for (let i = 0; i < lines.length; i += 1) {\n const line = lines[i];\n if (!line) continue;\n const trimmed = line.trim();\n if (trimmed === \"\" || trimmed === \"{\" || trimmed === \"}\") continue;\n for (const rule of rules) {\n const suggestion = rule.check(line, i, lines);\n if (suggestion) {\n violations.push({\n file: full,\n line: i + 1,\n rule: rule.id,\n content: trimmed,\n suggestion,\n });\n }\n }\n }\n },\n {\n rootDir,\n skipDirs: options.skipDirs,\n skipFiles,\n }\n );\n\n return makeResult(\"css-quality\", rootDir, violations);\n}\n",
|
|
10
10
|
"/**\n * Unused CSS detection (advisory).\n *\n * Finds classes and locally-defined custom properties in `.module.css`\n * files that appear to have no reference. Classes are checked against\n * every `.ts` / `.tsx` file's textual content; variables are checked\n * against other CSS files plus JS/TS referencing the same `--name`.\n * Matching is string-based and cannot see through dynamic lookups —\n * so this check is advisory only. Violations are returned as warnings;\n * the caller decides whether to fail the build.\n */\n\nimport type { CssCheckResult, CssViolation } from \"./shared.ts\";\nimport { makeResult, walkDirectory } from \"./shared.ts\";\n\nexport type CssUnusedOptions = {\n rootDir: string;\n /** Directory names skipped during recursion. */\n skipDirs?: string[];\n /** Class names treated as always-used (e.g. framework-generated). */\n alwaysUsedClasses?: string[];\n};\n\ntype Definition = {\n file: string;\n name: string;\n line: number;\n type: \"class\" | \"variable\";\n};\n\nexport async function checkCssUnused(options: CssUnusedOptions): Promise<CssCheckResult> {\n const rootDir = options.rootDir;\n const alwaysUsed = new Set(options.alwaysUsedClasses ?? []);\n const definitions: Definition[] = [];\n const tsContents: Array<{ file: string; content: string }> = [];\n const cssContents: Array<{ file: string; content: string }> = [];\n\n await walkDirectory(\n rootDir,\n // biome-ignore lint/complexity/noExcessiveCognitiveComplexity: filetype dispatch with nested matchAll scans; flat branches.\n async (full) => {\n if (full.endsWith(\".module.css\")) {\n const content = await Bun.file(full).text();\n const lines = content.split(\"\\n\");\n for (let i = 0; i < lines.length; i += 1) {\n const line = lines[i];\n if (!line) continue;\n for (const m of line.matchAll(/(?:^|[\\s,>+~])\\.([\\w-]+)/g)) {\n if (m[1]) {\n definitions.push({\n file: full,\n name: m[1],\n line: i + 1,\n type: \"class\",\n });\n }\n }\n for (const m of line.matchAll(/^\\s+--([\\w-]+)\\s*:/g)) {\n if (m[1]) {\n definitions.push({\n file: full,\n name: `--${m[1]}`,\n line: i + 1,\n type: \"variable\",\n });\n }\n }\n }\n cssContents.push({ file: full, content });\n } else if (full.endsWith(\".css\") && !full.endsWith(\".css.d.ts\")) {\n const content = await Bun.file(full).text();\n cssContents.push({ file: full, content });\n } else if ((full.endsWith(\".ts\") || full.endsWith(\".tsx\")) && !full.endsWith(\".css.d.ts\")) {\n const content = await Bun.file(full).text();\n tsContents.push({ file: full, content });\n }\n },\n { rootDir, skipDirs: options.skipDirs }\n );\n\n // Deduplicate definitions (same class may appear in multiple selectors)\n const seen = new Set<string>();\n const uniqueDefs = definitions.filter((d) => {\n const key = `${d.file}:${d.type}:${d.name}`;\n if (seen.has(key)) return false;\n seen.add(key);\n return true;\n });\n\n function classReferenced(name: string): boolean {\n if (alwaysUsed.has(name)) return true;\n for (const { content } of tsContents) {\n if (\n content.includes(`.${name}`) ||\n content.includes(`['${name}']`) ||\n content.includes(`[\"${name}\"]`)\n ) {\n return true;\n }\n }\n return false;\n }\n\n // biome-ignore lint/complexity/noExcessiveCognitiveComplexity: three-way reference check (other CSS, same CSS self-count, TS references).\n function variableReferenced(name: string, defFile: string): boolean {\n for (const { file, content } of cssContents) {\n if (file === defFile) continue;\n if (content.includes(`var(${name})`)) return true;\n }\n const self = cssContents.find((f) => f.file === defFile);\n if (self) {\n const occurrences = self.content.split(name).length - 1;\n if (occurrences > 1) return true;\n }\n for (const { content } of tsContents) {\n if (content.includes(name)) return true;\n }\n return false;\n }\n\n const violations: CssViolation[] = [];\n for (const def of uniqueDefs) {\n if (def.type === \"class\" && !classReferenced(def.name)) {\n violations.push({\n file: def.file,\n line: def.line,\n rule: \"unused-class\",\n content: `.${def.name}`,\n suggestion: \"Delete the selector or reference the class from a component\",\n });\n } else if (def.type === \"variable\" && !variableReferenced(def.name, def.file)) {\n violations.push({\n file: def.file,\n line: def.line,\n rule: \"unused-variable\",\n content: def.name,\n suggestion: \"Delete the definition or reference the variable\",\n });\n }\n }\n\n return makeResult(\"css-unused (advisory)\", rootDir, violations);\n}\n",
|
|
11
11
|
"/**\n * CSS variable reference validator.\n *\n * Two-pass scanner. First pass collects every `--name:` definition in\n * every `.css` file under the root. Second pass walks `.css`, `.ts`, and\n * `.tsx` files and reports any `var(--name)` that does not resolve. Catches\n * typos, stale references, and references to removed tokens.\n *\n * Variables that are set via JS (inline style) can be declared via\n * `dynamicVars` so they are treated as defined without appearing in CSS.\n */\n\nimport type { CssCheckResult, CssViolation } from \"./shared.ts\";\nimport { makeResult, walkDirectory } from \"./shared.ts\";\n\nexport type CssVarsOptions = {\n rootDir: string;\n /** Extensions scanned for var(--x) references. Default: css, ts, tsx. */\n scanExtensions?: string[];\n /** Variables defined dynamically (set via JS). Treated as defined. */\n dynamicVars?: string[];\n /** Directory names skipped during recursion. */\n skipDirs?: string[];\n};\n\nexport async function checkCssVars(options: CssVarsOptions): Promise<CssCheckResult> {\n const rootDir = options.rootDir;\n const scanExts = options.scanExtensions ?? [\".ts\", \".tsx\", \".css\"];\n const dynamic = new Set(options.dynamicVars ?? []);\n const definitions = new Set<string>(dynamic);\n const violations: CssViolation[] = [];\n\n // Pass 1 — collect all CSS custom property definitions\n await walkDirectory(\n rootDir,\n async (full) => {\n if (!full.endsWith(\".css\")) return;\n const content = await Bun.file(full).text();\n for (const m of content.matchAll(/--([\\w-]+)\\s*:/g)) {\n if (m[1]) definitions.add(`--${m[1]}`);\n }\n },\n { rootDir, skipDirs: options.skipDirs }\n );\n\n // Pass 2 — scan var(--name) references\n await walkDirectory(\n rootDir,\n // biome-ignore lint/complexity/noExcessiveCognitiveComplexity: nested for + matchAll per file is linear and readable as written.\n async (full) => {\n if (full.endsWith(\".css.d.ts\")) return;\n if (!scanExts.some((ext) => full.endsWith(ext))) return;\n const content = await Bun.file(full).text();\n const lines = content.split(\"\\n\");\n for (let i = 0; i < lines.length; i += 1) {\n const line = lines[i];\n if (!line) continue;\n for (const m of line.matchAll(/var\\(--([\\w-]+)\\)/g)) {\n const name = `--${m[1]}`;\n if (!definitions.has(name)) {\n violations.push({\n file: full,\n line: i + 1,\n rule: \"undefined-var\",\n content: line.trim(),\n suggestion: `Define ${name} in a CSS file or add to dynamicVars`,\n });\n }\n }\n }\n },\n { rootDir, skipDirs: options.skipDirs }\n );\n\n return makeResult(\"css-vars\", rootDir, violations);\n}\n",
|
|
12
|
-
"/**\n * No-as-casting conformance check.\n *\n * Bans all TypeScript type assertions (`as Type`) except the allowed\n * patterns: `as const` (literal narrowing), `as unknown as` (explicit\n * escape hatch), import/export renames, and `as` inside strings or\n * comments. Violations include pattern-specific fix advice.\n *\n * This module exports the check logic as a library so consuming\n * applications can import it from `@fairfox/polly/quality` and run it\n * programmatically. Polly's own `scripts/check-no-as-casting.ts` is a\n * thin CLI wrapper around these exports.\n */\n\nimport { readFileSync } from \"node:fs\";\nimport { Glob } from \"bun\";\nimport { logger } from \"./logger\";\n\nexport interface Violation {\n file: string;\n line: number;\n content: string;\n advice?: string;\n}\n\nexport interface CheckResult {\n violations: Violation[];\n print: () => void;\n}\n\nexport interface CheckOptions {\n rootDir: string;\n exclude?: string[];\n excludePackages?: string[];\n excludeFiles?: string[];\n filePatterns?: string;\n}\n\n/**\n * Check whether a line contains a forbidden `as` type assertion.\n * Returns true if the line is clean (no violation), false if it violates.\n */\n// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: Source-text scanning with many skip rules is inherently branchy.\nexport function isLineClean(line: string): boolean {\n if (!line.includes(\" as \")) return true;\n\n const trimmed = line.trim();\n\n // Full-line comments\n if (trimmed.startsWith(\"//\") || trimmed.startsWith(\"*\") || trimmed.startsWith(\"/*\")) {\n return true;\n }\n\n // as const (literal narrowing)\n if (line.match(/\\bas const\\b/)) {\n const withoutAsConst = line.replace(/\\bas const\\b/g, \"\");\n if (!withoutAsConst.includes(\" as \")) return true;\n }\n\n // as unknown as (explicit escape hatch)\n if (line.includes(\" as unknown as \") || line.trimEnd().endsWith(\"as unknown as\")) {\n const withoutEscapeHatch = line.replace(/\\bas unknown as\\b/g, \"\");\n if (!withoutEscapeHatch.includes(\" as \")) return true;\n }\n\n // Import/export renames\n if (\n line.match(/\\b(import|export)\\s+.*\\s+as\\s+\\w+/) ||\n line.match(/\\b(import|export)\\s+\\*\\s+as\\s+\\w+/) ||\n line.match(/\\b(import|export)\\s+type\\s+.*\\s+as\\s+\\w+/) ||\n line.match(/^\\s*\\w+\\s+as\\s+\\w+,?\\s*$/) ||\n line.match(/^\\s*type\\s+\\w+\\s+as\\s+\\w+,?\\s*$/)\n ) {\n return true;\n }\n\n // Property declarations: as= or as: or as,\n if (line.match(/\\bas\\s*[=:,]/)) return true;\n\n // String literal detection: count quotes before each ` as ` occurrence.\n // If any quote type has an odd count, the ` as ` is inside a string.\n if (everyAsInsideString(line)) return true;\n\n // JSX text: ` as ` between > and < with no code syntax around it\n if (isJsxText(trimmed)) return true;\n\n // Plain text heuristic: indented line with no code syntax characters\n // before ` as ` — catches multiline JSX text and template literal bodies.\n if (isPlainText(trimmed)) return true;\n\n // Inline comment: ` as ` appears only after //\n const commentIdx = line.indexOf(\"//\");\n if (commentIdx >= 0 && line.indexOf(\" as \", commentIdx) >= 0) {\n const beforeComment = line.substring(0, commentIdx);\n if (!beforeComment.includes(\" as \")) return true;\n }\n\n // SQL alias: `) as column_name`\n if (line.match(/\"\\)\\s+as\\s+\\w+\"/)) return true;\n\n if (line.includes(\" satisfies \")) return true;\n\n return false;\n}\n\n/**\n * Returns true when every ` as ` occurrence in the line falls inside a\n * string literal (single-quoted, double-quoted, or backtick).\n */\nfunction everyAsInsideString(line: string): boolean {\n let searchFrom = 0;\n while (true) {\n const idx = line.indexOf(\" as \", searchFrom);\n if (idx < 0) return true; // no more ` as ` to check\n const before = line.substring(0, idx);\n const singleQuotes = (before.match(/'/g) ?? []).length;\n const doubleQuotes = (before.match(/\"/g) ?? []).length;\n const backticks = (before.match(/`/g) ?? []).length;\n if (singleQuotes % 2 === 0 && doubleQuotes % 2 === 0 && backticks % 2 === 0) {\n return false; // this ` as ` is outside any string\n }\n searchFrom = idx + 4;\n }\n}\n\n/**\n * Detects JSX text content — ` as ` appearing between > and < with no\n * code-like syntax around it (no braces, semicolons, equals signs).\n */\nfunction isJsxText(trimmed: string): boolean {\n // Classic JSX text: starts after > or is plain text ending before <\n if (trimmed.match(/^[^{};=()]*\\bas\\b[^{};=()]*$/)) {\n // No code syntax at all — could be JSX text or template literal body.\n // Reject if it looks like a type assertion (word ` as ` TypeName pattern\n // where TypeName starts with uppercase, or is a known TS type).\n if (\n !trimmed.match(/\\bas\\s+[A-Z]\\w*/) &&\n !trimmed.match(/\\bas\\s+(string|number|boolean|any|unknown|never)\\b/)\n ) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Heuristic for plain text in template literals or JSX: the line has no\n * code-like characters before ` as ` — no `=`, `{`, `}`, `:`, `;`, `(`.\n */\nfunction isPlainText(trimmed: string): boolean {\n const idx = trimmed.indexOf(\" as \");\n if (idx < 0) return false;\n const before = trimmed.substring(0, idx);\n // If nothing before ` as ` looks like code, it's probably prose.\n return (\n !before.match(/[={}:;(]/) &&\n !before.match(/\\b(const|let|var|type|interface|function|return|await)\\b/)\n );\n}\n\n/**\n * Suggest a concrete fix for a specific violation pattern.\n */\n// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: Pattern-matching advice is a linear chain of if-returns.\nexport function suggestFix(line: string): string | undefined {\n if (line.includes(\"JSON.parse\")) {\n return \"Use a validation function or type guard to parse and validate the result.\";\n }\n if (\n line.includes(\"as HTMLInputElement\") ||\n line.includes(\"as HTMLTextAreaElement\") ||\n line.includes(\"as HTMLButtonElement\")\n ) {\n return \"Use instanceof: if (el instanceof HTMLInputElement) { el.value ... }\";\n }\n if (line.includes(\"as HTMLElement\") || line.includes(\"as Element\")) {\n return \"Use instanceof: if (el instanceof HTMLElement) { ... }\";\n }\n if (line.includes(\".doc()\") && line.includes(\"as \")) {\n return \"Type the DocHandle generic: repo.find<MyType>(id) returns DocHandle<MyType>.\";\n }\n if (\n line.includes(\"Record<string, unknown>\") &&\n (line.includes(\"window\") || line.includes(\"globalThis\"))\n ) {\n return \"Extract a type guard: function getGlobalProp(name: string): unknown { ... }\";\n }\n if (line.includes(\"Record<string, unknown>\")) {\n return \"Use a type guard function that narrows the unknown value to the target shape.\";\n }\n if (line.includes(\"as PeerId\") || line.includes(\"as DocumentId\")) {\n return \"Use the library's branded-type constructor if available, or centralise the cast in a factory.\";\n }\n if (line.includes(\"as string\") || line.includes(\"as number\") || line.includes(\"as boolean\")) {\n return \"Narrow with typeof: if (typeof x === 'string') { ... }\";\n }\n if (line.includes(\"as any\")) {\n return \"Replace 'any' with 'unknown' and add a type guard or validation at the boundary.\";\n }\n return undefined;\n}\n\nfunction isFileExcluded(\n relative: string,\n excludeDirs: Set<string>,\n excludePackages: Set<string>,\n excludeFiles: Set<string>\n): boolean {\n const segments = relative.split(\"/\");\n if (segments.some((s) => excludeDirs.has(s))) return true;\n if (excludePackages.size > 0 && segments.some((s) => excludePackages.has(s))) return true;\n const basename = segments[segments.length - 1] ?? \"\";\n return excludeFiles.has(basename) || excludeFiles.has(relative);\n}\n\nfunction findViolations(relative: string, content: string): Violation[] {\n const results: Violation[] = [];\n const lines = content.split(\"\\n\");\n let insideTemplate = false;\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i] ?? \"\";\n const backticks = (line.match(/`/g) ?? []).length;\n const startedInTemplate = insideTemplate;\n if (backticks % 2 === 1) insideTemplate = !insideTemplate;\n\n // Line is entirely inside a multi-line template literal and has no\n // interpolation — treat as string content (e.g. SQL column aliases).\n if (startedInTemplate && backticks === 0 && !line.includes(\"${\")) continue;\n\n if (!isLineClean(line)) {\n results.push({\n file: relative,\n line: i + 1,\n content: line.trim(),\n advice: suggestFix(line.trim()),\n });\n }\n }\n return results;\n}\n\nfunction printViolations(violations: Violation[]): void {\n if (violations.length === 0) {\n logger.log(\"[no-as-casting] ✅ No violations found.\");\n return;\n }\n logger.log(`[no-as-casting] ❌ ${violations.length} violation(s) found:\\n`);\n for (const v of violations) {\n logger.log(` ${v.file}:${v.line}`);\n logger.log(` ${v.content}`);\n if (v.advice) logger.log(` 💡 ${v.advice}`);\n logger.log(\"\");\n }\n logger.log(\"[no-as-casting] Use type guards, validation, or fix the types at the source.\");\n logger.log('[no-as-casting] Only \"as const\" and \"as unknown as\" are allowed.');\n}\n\n/**\n * Run the no-as-casting check against a directory. Returns a result\n * object with the violations and a print function for CLI output.\n */\nexport async function checkNoAsCasting(options: CheckOptions): Promise<CheckResult> {\n const rootDir = options.rootDir;\n const excludeDirs = new Set(options.exclude ?? [\"node_modules\", \"dist\", \".git\", \".bun\"]);\n const excludePackages = new Set(options.excludePackages ?? []);\n const excludeFiles = new Set(options.excludeFiles ?? []);\n const pattern = options.filePatterns ?? \"**/*.{ts,tsx}\";\n const glob = new Glob(pattern);\n const violations: Violation[] = [];\n\n for await (const file of glob.scan({ cwd: rootDir, absolute: true })) {\n const relative = file.replace(`${rootDir}/`, \"\");\n if (isFileExcluded(relative, excludeDirs, excludePackages, excludeFiles)) continue;\n const content = readFileSync(file, \"utf-8\");\n violations.push(...findViolations(relative, content));\n }\n\n return { violations, print: () => printViolations(violations) };\n}\n"
|
|
12
|
+
"/**\n * No-as-casting conformance check.\n *\n * Bans all TypeScript type assertions (`as Type`) except the allowed\n * patterns: `as const` (literal narrowing), `as unknown as` (explicit\n * escape hatch), import/export renames, and `as` inside strings or\n * comments. Violations include pattern-specific fix advice.\n *\n * This module exports the check logic as a library so consuming\n * applications can import it from `@fairfox/polly/quality` and run it\n * programmatically. Polly's own `scripts/check-no-as-casting.ts` is a\n * thin CLI wrapper around these exports.\n */\n\nimport { readFileSync } from \"node:fs\";\nimport { Glob } from \"bun\";\nimport { logger } from \"./logger\";\n\nexport interface Violation {\n file: string;\n line: number;\n content: string;\n advice?: string;\n}\n\nexport interface CheckResult {\n violations: Violation[];\n print: () => void;\n}\n\nexport interface CheckOptions {\n rootDir: string;\n exclude?: string[];\n excludePackages?: string[];\n excludeFiles?: string[];\n filePatterns?: string;\n}\n\n/**\n * Check whether a line contains a forbidden `as` type assertion.\n * Returns true if the line is clean (no violation), false if it violates.\n */\n// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: Source-text scanning with many skip rules is inherently branchy.\nexport function isLineClean(line: string): boolean {\n if (!line.includes(\" as \")) return true;\n\n const trimmed = line.trim();\n\n // Full-line comments\n if (trimmed.startsWith(\"//\") || trimmed.startsWith(\"*\") || trimmed.startsWith(\"/*\")) {\n return true;\n }\n\n // as const (literal narrowing)\n if (line.match(/\\bas const\\b/)) {\n const withoutAsConst = line.replace(/\\bas const\\b/g, \"\");\n if (!withoutAsConst.includes(\" as \")) return true;\n }\n\n // as unknown as (explicit escape hatch)\n if (line.includes(\" as unknown as \") || line.trimEnd().endsWith(\"as unknown as\")) {\n const withoutEscapeHatch = line.replace(/\\bas unknown as\\b/g, \"\");\n if (!withoutEscapeHatch.includes(\" as \")) return true;\n }\n\n // Import/export renames\n if (\n line.match(/\\b(import|export)\\s+.*\\s+as\\s+\\w+/) ||\n line.match(/\\b(import|export)\\s+\\*\\s+as\\s+\\w+/) ||\n line.match(/\\b(import|export)\\s+type\\s+.*\\s+as\\s+\\w+/) ||\n line.match(/^\\s*\\w+\\s+as\\s+\\w+,?\\s*$/) ||\n line.match(/^\\s*type\\s+\\w+\\s+as\\s+\\w+,?\\s*$/)\n ) {\n return true;\n }\n\n // Property declarations: as= or as: or as,\n if (line.match(/\\bas\\s*[=:,]/)) return true;\n\n // String literal detection: count quotes before each ` as ` occurrence.\n // If any quote type has an odd count, the ` as ` is inside a string.\n if (everyAsInsideString(line)) return true;\n\n // JSX text: ` as ` between > and < with no code syntax around it\n if (isJsxText(trimmed)) return true;\n\n // Plain text heuristic: indented line with no code syntax characters\n // before ` as ` — catches multiline JSX text and template literal bodies.\n if (isPlainText(trimmed)) return true;\n\n // Inline comment: ` as ` appears only after //\n const commentIdx = line.indexOf(\"//\");\n if (commentIdx >= 0 && line.indexOf(\" as \", commentIdx) >= 0) {\n const beforeComment = line.substring(0, commentIdx);\n if (!beforeComment.includes(\" as \")) return true;\n }\n\n // SQL alias: `) as column_name`\n if (line.match(/\"\\)\\s+as\\s+\\w+\"/)) return true;\n\n if (line.includes(\" satisfies \")) return true;\n\n return false;\n}\n\n/**\n * Returns true when every ` as ` occurrence in the line falls inside a\n * string literal (single-quoted, double-quoted, or backtick).\n */\nfunction everyAsInsideString(line: string): boolean {\n let searchFrom = 0;\n while (true) {\n const idx = line.indexOf(\" as \", searchFrom);\n if (idx < 0) return true; // no more ` as ` to check\n const before = line.substring(0, idx);\n const singleQuotes = (before.match(/'/g) ?? []).length;\n const doubleQuotes = (before.match(/\"/g) ?? []).length;\n const backticks = (before.match(/`/g) ?? []).length;\n if (singleQuotes % 2 === 0 && doubleQuotes % 2 === 0 && backticks % 2 === 0) {\n return false; // this ` as ` is outside any string\n }\n searchFrom = idx + 4;\n }\n}\n\n/**\n * Detects JSX text content — ` as ` appearing between > and < with no\n * code-like syntax around it (no braces, semicolons, equals signs).\n */\nfunction isJsxText(trimmed: string): boolean {\n // Classic JSX text: starts after > or is plain text ending before <\n if (trimmed.match(/^[^{};=()]*\\bas\\b[^{};=()]*$/)) {\n // No code syntax at all — could be JSX text or template literal body.\n // Reject if it looks like a type assertion (word ` as ` TypeName pattern\n // where TypeName starts with uppercase, or is a known TS type).\n if (\n !trimmed.match(/\\bas\\s+[A-Z]\\w*/) &&\n !trimmed.match(/\\bas\\s+(string|number|boolean|any|unknown|never)\\b/)\n ) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * Heuristic for plain text in template literals or JSX: the line has no\n * code-like characters before ` as ` — no `=`, `{`, `}`, `:`, `;`, `(`.\n */\nfunction isPlainText(trimmed: string): boolean {\n const idx = trimmed.indexOf(\" as \");\n if (idx < 0) return false;\n const before = trimmed.substring(0, idx);\n // If nothing before ` as ` looks like code, it's probably prose.\n return (\n !before.match(/[={}:;(]/) &&\n !before.match(/\\b(const|let|var|type|interface|function|return|await)\\b/)\n );\n}\n\n/**\n * Suggest a concrete fix for a specific violation pattern.\n */\n// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: Pattern-matching advice is a linear chain of if-returns.\nexport function suggestFix(line: string): string | undefined {\n if (line.includes(\"JSON.parse\")) {\n return \"Use a validation function or type guard to parse and validate the result.\";\n }\n if (\n line.includes(\"as HTMLInputElement\") ||\n line.includes(\"as HTMLTextAreaElement\") ||\n line.includes(\"as HTMLButtonElement\")\n ) {\n return \"Use instanceof: if (el instanceof HTMLInputElement) { el.value ... }\";\n }\n if (line.includes(\"as HTMLElement\") || line.includes(\"as Element\")) {\n return \"Use instanceof: if (el instanceof HTMLElement) { ... }\";\n }\n if (line.includes(\".doc()\") && line.includes(\"as \")) {\n return \"Type the DocHandle generic: repo.find<MyType>(id) returns DocHandle<MyType>.\";\n }\n if (\n line.includes(\"Record<string, unknown>\") &&\n (line.includes(\"window\") || line.includes(\"globalThis\"))\n ) {\n return \"Extract a type guard: function getGlobalProp(name: string): unknown { ... }\";\n }\n if (line.includes(\"Record<string, unknown>\")) {\n return \"Use a type guard function that narrows the unknown value to the target shape.\";\n }\n if (line.includes(\"as PeerId\") || line.includes(\"as DocumentId\")) {\n return \"Use the library's branded-type constructor if available, or centralise the cast in a factory.\";\n }\n if (line.includes(\"as string\") || line.includes(\"as number\") || line.includes(\"as boolean\")) {\n return \"Narrow with typeof: if (typeof x === 'string') { ... }\";\n }\n if (line.includes(\"as any\")) {\n return \"Replace 'any' with 'unknown' and add a type guard or validation at the boundary.\";\n }\n return undefined;\n}\n\nfunction isFileExcluded(\n relative: string,\n excludeDirs: Set<string>,\n excludePackages: Set<string>,\n excludeFiles: Set<string>\n): boolean {\n const segments = relative.split(\"/\");\n if (segments.some((s) => excludeDirs.has(s))) return true;\n if (excludePackages.size > 0 && segments.some((s) => excludePackages.has(s))) return true;\n const basename = segments[segments.length - 1] ?? \"\";\n return excludeFiles.has(basename) || excludeFiles.has(relative);\n}\n\nfunction findViolations(relative: string, content: string): Violation[] {\n const results: Violation[] = [];\n const lines = content.split(\"\\n\");\n let insideTemplate = false;\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i] ?? \"\";\n const backticks = (line.match(/`/g) ?? []).length;\n const startedInTemplate = insideTemplate;\n if (backticks % 2 === 1) insideTemplate = !insideTemplate;\n\n // Line is entirely inside a multi-line template literal and has no\n // interpolation — treat as string content (e.g. SQL column aliases).\n if (startedInTemplate && backticks === 0 && !line.includes(\"${\")) continue;\n\n if (!isLineClean(line)) {\n results.push({\n file: relative,\n line: i + 1,\n content: line.trim(),\n advice: suggestFix(line.trim()),\n });\n }\n }\n return results;\n}\n\nfunction printViolations(violations: Violation[]): void {\n if (violations.length === 0) {\n logger.log(\"[no-as-casting] ✅ No violations found.\");\n return;\n }\n logger.log(`[no-as-casting] ❌ ${violations.length} violation(s) found:\\n`);\n for (const v of violations) {\n logger.log(` ${v.file}:${v.line}`);\n logger.log(` ${v.content}`);\n if (v.advice) logger.log(` 💡 ${v.advice}`);\n logger.log(\"\");\n }\n logger.log(\"[no-as-casting] Use type guards, validation, or fix the types at the source.\");\n logger.log('[no-as-casting] Only \"as const\" and \"as unknown as\" are allowed.');\n}\n\n/**\n * Run the no-as-casting check against a directory. Returns a result\n * object with the violations and a print function for CLI output.\n */\nexport async function checkNoAsCasting(options: CheckOptions): Promise<CheckResult> {\n const rootDir = options.rootDir;\n const excludeDirs = new Set(options.exclude ?? [\"node_modules\", \"dist\", \".git\", \".bun\"]);\n const excludePackages = new Set(options.excludePackages ?? []);\n const excludeFiles = new Set(options.excludeFiles ?? []);\n const pattern = options.filePatterns ?? \"**/*.{ts,tsx}\";\n const glob = new Glob(pattern);\n const violations: Violation[] = [];\n\n for await (const file of glob.scan({ cwd: rootDir, absolute: true })) {\n const relative = file.replace(`${rootDir}/`, \"\");\n if (isFileExcluded(relative, excludeDirs, excludePackages, excludeFiles)) continue;\n const content = readFileSync(file, \"utf-8\");\n violations.push(...findViolations(relative, content));\n }\n\n return { violations, print: () => printViolations(violations) };\n}\n",
|
|
13
|
+
"/**\n * No-require conformance check.\n *\n * Bans `require(...)` calls in TypeScript source. Inline CommonJS\n * escapes defeat bundler static analysis, hide cross-module\n * dependencies, and quietly opt a module out of ESM semantics that\n * the rest of the codebase depends on. The motivating incident was a\n * consumer app that shipped\n *\n * const { renameSync } = require(\"node:fs\") as typeof import(\"node:fs\");\n *\n * wedged mid-function — the `as` cast alone violated no-as-casting,\n * but the underlying sin was the require call. Static ES imports\n * round-trip through every bundler and every IDE; `require` does\n * neither.\n *\n * Allowed: `import` / `export` syntax of any flavour, `import(...)`\n * dynamic imports (they're ESM), `require.resolve(...)` (sometimes\n * load-bearing for runtime path resolution), and occurrences inside\n * strings or comments.\n */\n\nimport { readFileSync } from \"node:fs\";\nimport { Glob } from \"bun\";\nimport { logger } from \"./logger\";\n\nexport interface NoRequireViolation {\n file: string;\n line: number;\n content: string;\n}\n\nexport interface NoRequireCheckResult {\n violations: NoRequireViolation[];\n print: () => void;\n}\n\nexport interface NoRequireCheckOptions {\n rootDir: string;\n exclude?: string[];\n /** Glob of files to scan. Defaults to `**` /`*.{ts,tsx}`. */\n filePatterns?: string;\n}\n\n/**\n * Returns true when the line contains no forbidden `require(` call.\n * Mirrors the shape of `isLineClean` in no-as-casting for\n * consistency; the two rules compose cleanly when both run against\n * the same file.\n */\nexport function isLineRequireClean(line: string): boolean {\n if (!line.includes(\"require\")) {\n return true;\n }\n const trimmed = line.trim();\n if (trimmed.startsWith(\"//\") || trimmed.startsWith(\"*\") || trimmed.startsWith(\"/*\")) {\n return true;\n }\n const match = line.match(/\\brequire\\s*\\(/);\n if (!match || match.index === undefined) {\n return true;\n }\n // Allow `require.resolve(...)` — a legitimate runtime-path helper\n // that preserves static analysis for the referenced module.\n if (line.slice(0, match.index + 8).endsWith(\"require.resolve(\")) {\n return true;\n }\n // String literal detection: odd number of unescaped quotes before\n // the match means we're mid-string.\n const before = line.slice(0, match.index);\n const singles = (before.match(/(?<!\\\\)'/g) ?? []).length;\n const doubles = (before.match(/(?<!\\\\)\"/g) ?? []).length;\n const backticks = (before.match(/(?<!\\\\)`/g) ?? []).length;\n if (singles % 2 === 1 || doubles % 2 === 1 || backticks % 2 === 1) {\n return true;\n }\n // Inline comment: `require(` appears only after `//`.\n const commentIdx = line.indexOf(\"//\");\n if (commentIdx >= 0 && match.index > commentIdx) {\n return true;\n }\n return false;\n}\n\nfunction findRequireViolations(relative: string, content: string): NoRequireViolation[] {\n const results: NoRequireViolation[] = [];\n const lines = content.split(\"\\n\");\n let insideTemplate = false;\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i] ?? \"\";\n const backticks = (line.match(/`/g) ?? []).length;\n const startedInTemplate = insideTemplate;\n if (backticks % 2 === 1) {\n insideTemplate = !insideTemplate;\n }\n // Skip lines that are entirely inside a multi-line template\n // literal (e.g. an embedded code example in a doc comment).\n if (startedInTemplate && backticks === 0 && !line.includes(\"${\")) {\n continue;\n }\n if (!isLineRequireClean(line)) {\n results.push({ file: relative, line: i + 1, content: line.trim() });\n }\n }\n return results;\n}\n\nfunction printRequireViolations(violations: NoRequireViolation[]): void {\n if (violations.length === 0) {\n logger.log(\"[no-require] ✅ No violations found.\");\n return;\n }\n logger.log(`[no-require] ❌ ${violations.length} violation(s) found:\\n`);\n for (const v of violations) {\n logger.log(` ${v.file}:${v.line}`);\n logger.log(` ${v.content}`);\n logger.log(\"\");\n }\n logger.log(\"[no-require] Replace with static ES imports or `await import(...)` for lazy ESM.\");\n}\n\nexport async function checkNoRequire(\n options: NoRequireCheckOptions\n): Promise<NoRequireCheckResult> {\n const rootDir = options.rootDir;\n const excludeDirs = new Set(options.exclude ?? [\"node_modules\", \"dist\", \".git\", \".bun\"]);\n const pattern = options.filePatterns ?? \"**/*.{ts,tsx}\";\n const glob = new Glob(pattern);\n const violations: NoRequireViolation[] = [];\n\n for await (const file of glob.scan({ cwd: rootDir, absolute: true })) {\n const relative = file.replace(`${rootDir}/`, \"\");\n const segments = relative.split(\"/\");\n if (segments.some((s) => excludeDirs.has(s))) {\n continue;\n }\n const content = readFileSync(file, \"utf-8\");\n violations.push(...findRequireViolations(relative, content));\n }\n\n return {\n violations,\n print: () => printRequireViolations(violations),\n };\n}\n",
|
|
14
|
+
"/**\n * Secret-scanning conformance checks.\n *\n * Two paired checks that protect a repository from accidentally\n * committing credentials:\n *\n * - `checkSecrets` spawns `gitleaks detect` against the working\n * tree and returns the exit code + stdout. Consumers are\n * expected to have `gitleaks` on PATH (via `brew install\n * gitleaks` or equivalent); the check reports a clear failure\n * when the binary is missing.\n *\n * - `checkGitignoreCoversAllowlist` parses a `.gitleaks.toml`\n * config, pulls out the path patterns that sit in an allowlist\n * *section* marked as \"gitignored files\" (via comment\n * markers), and verifies each one is actually covered by\n * `.gitignore`. This catches the footgun where a repo\n * allowlists `.env` in gitleaks config but forgets to add it\n * to `.gitignore`, so the allowlist entry silently lets a real\n * secret slip through.\n *\n * Adapted from the devctl `check` command in the Lingua project.\n *\n * @example\n * ```typescript\n * import {\n * checkSecrets,\n * checkGitignoreCoversAllowlist,\n * } from \"@fairfox/polly/quality\";\n *\n * const scan = await checkSecrets({ root: process.cwd() });\n * if (scan.exitCode !== 0) process.exit(scan.exitCode);\n *\n * const cover = await checkGitignoreCoversAllowlist({\n * root: process.cwd(),\n * });\n * if (cover.missing.length > 0) {\n * cover.print();\n * process.exit(1);\n * }\n * ```\n */\n\nimport { readFile } from \"node:fs/promises\";\nimport { join } from \"node:path\";\nimport { logger } from \"./logger\";\n\nconst defaultWrite = (msg: string): void => logger.error(msg);\n\nexport interface CheckSecretsOptions {\n /** Repository root to scan. */\n root: string;\n /** Path to a gitleaks TOML config, relative to `root`. Defaults\n * to `.gitleaks.toml`. */\n configPath?: string;\n /** Scan the working tree (`--no-git`) or the git history.\n * Defaults to true (working tree only — faster, and what most\n * pre-commit / CI flows want). */\n noGit?: boolean;\n}\n\nexport interface SecretsCheckResult {\n /** Whether `gitleaks` was found on PATH at all. */\n binaryFound: boolean;\n /** `gitleaks detect` exit code, or null when the binary was\n * missing. 0 = clean, 1 = secrets found, other = gitleaks\n * error. */\n exitCode: number | null;\n /** Streamed gitleaks stdout + stderr. Empty when the scan was\n * skipped. */\n output: string;\n print: (write?: (msg: string) => void) => void;\n}\n\n/**\n * Run gitleaks against the working tree. Returns `binaryFound:\n * false` if the binary isn't on PATH — callers typically treat\n * that as a hard failure with an install hint.\n */\nexport async function checkSecrets(options: CheckSecretsOptions): Promise<SecretsCheckResult> {\n const which = Bun.spawn([\"which\", \"gitleaks\"], {\n stdout: \"ignore\",\n stderr: \"ignore\",\n });\n await which.exited;\n if (which.exitCode !== 0) {\n return {\n binaryFound: false,\n exitCode: null,\n output: \"\",\n print: (write = defaultWrite) => {\n write(\n \"gitleaks is not on PATH. Install with `brew install gitleaks` (macOS) or from https://github.com/gitleaks/gitleaks/releases.\"\n );\n },\n };\n }\n\n const args = [\"gitleaks\", \"detect\", \"--source\", options.root ?? \".\"];\n if (options.noGit !== false) {\n args.push(\"--no-git\");\n }\n if (options.configPath) {\n args.push(\"-c\", options.configPath);\n }\n\n const proc = Bun.spawn(args, {\n cwd: options.root,\n stdout: \"pipe\",\n stderr: \"pipe\",\n });\n const [stdout, stderr] = await Promise.all([\n new Response(proc.stdout).text(),\n new Response(proc.stderr).text(),\n ]);\n await proc.exited;\n const output = `${stdout}${stderr}`;\n return {\n binaryFound: true,\n exitCode: proc.exitCode,\n output,\n print: (write = defaultWrite) => {\n if (output) {\n write(output);\n }\n },\n };\n}\n\nexport interface CheckGitignoreOptions {\n /** Repository root. */\n root: string;\n /** Path to the gitleaks TOML config, relative to `root`. Defaults\n * to `.gitleaks.toml`. */\n tomlPath?: string;\n /** Path to the gitignore file, relative to `root`. Defaults to\n * `.gitignore`. */\n gitignorePath?: string;\n /** Strings that, when seen in a comment line of the TOML, mark\n * the start of a \"must be gitignored\" section. Defaults cover\n * \"Gitignored files\" and \"Local dev TLS certs\". */\n sectionStartMarkers?: string[];\n /** Strings that close a must-be-gitignored section. Defaults to\n * \"Test fixtures\" so the common lingua-style layout works\n * unchanged. */\n sectionEndMarkers?: string[];\n}\n\nexport interface GitignoreCheckResult {\n /** TOML-listed allowlisted paths that `.gitignore` does NOT\n * cover. Each string is the derived plain filename (e.g.\n * `.env`, `certs/key.pem`). */\n missing: string[];\n /** All paths the TOML required to be gitignored, whether or not\n * .gitignore covers them. Useful for audits. */\n required: string[];\n print: (write?: (msg: string) => void) => void;\n}\n\n/**\n * Parse a gitleaks TOML config and verify every allowlisted path\n * that the config marks as \"this file should be gitignored\" is in\n * fact present in `.gitignore`. Returns the list of allowlisted\n * paths that are NOT gitignored.\n *\n * The check trusts section markers in the TOML comments to decide\n * which allowlist entries apply. By default:\n *\n * - \"Gitignored files\" and \"Local dev TLS certs\" open a\n * must-be-gitignored section.\n * - \"Test fixtures\" closes it.\n *\n * Entries outside those sections (e.g. test-fixture paths) are\n * ignored by this check.\n */\nfunction parseRequiredPaths(toml: string, starts: string[], ends: string[]): string[] {\n const required: string[] = [];\n let inSection = false;\n for (const line of toml.split(\"\\n\")) {\n if (starts.some((m) => line.includes(m))) {\n inSection = true;\n continue;\n }\n if (ends.some((m) => line.includes(m))) {\n inSection = false;\n continue;\n }\n if (!inSection) {\n continue;\n }\n const match = line.match(/'''(.+?)'''/);\n if (!match?.[1]) {\n continue;\n }\n // Convert gitleaks regex to plain filename (strip backslash\n // escapes and trailing anchors) for a gitignore-style lookup.\n required.push(match[1].replace(/\\\\\\./g, \".\").replace(/\\$$/, \"\"));\n }\n return required;\n}\n\nfunction gitignoreLineCovers(giLine: string, filename: string): boolean {\n if (!giLine || giLine.startsWith(\"#\")) {\n return false;\n }\n if (giLine === filename) {\n return true;\n }\n const dirMatch = giLine.match(/^\\*?\\*?\\/?(.+)\\/$/);\n if (dirMatch?.[1] && filename.startsWith(dirMatch[1])) {\n return true;\n }\n if (giLine.endsWith(\"/\") && filename.startsWith(giLine)) {\n return true;\n }\n return false;\n}\n\nconst emptyGitignoreResult: GitignoreCheckResult = {\n missing: [],\n required: [],\n print: () => {\n // No TOML means nothing to enforce; callers typically treat\n // this as \"skipped\" and print their own hint. Leaving the\n // printer a no-op keeps the API uniform without emitting\n // spurious output.\n },\n};\n\nexport async function checkGitignoreCoversAllowlist(\n options: CheckGitignoreOptions\n): Promise<GitignoreCheckResult> {\n const tomlPath = join(options.root, options.tomlPath ?? \".gitleaks.toml\");\n const gitignorePath = join(options.root, options.gitignorePath ?? \".gitignore\");\n const starts = options.sectionStartMarkers ?? [\"Gitignored files\", \"Local dev TLS certs\"];\n const ends = options.sectionEndMarkers ?? [\"Test fixtures\"];\n\n let toml: string;\n try {\n toml = await readFile(tomlPath, \"utf8\");\n } catch {\n return emptyGitignoreResult;\n }\n let gitignore: string;\n try {\n gitignore = await readFile(gitignorePath, \"utf8\");\n } catch {\n gitignore = \"\";\n }\n\n const required = parseRequiredPaths(toml, starts, ends);\n const gitignoreLines = gitignore.split(\"\\n\").map((l) => l.trim());\n const missing = required.filter(\n (filename) => !gitignoreLines.some((gi) => gitignoreLineCovers(gi, filename))\n );\n\n return {\n missing,\n required,\n print: (write = defaultWrite) => {\n if (missing.length === 0) {\n return;\n }\n write(\"Paths allowed by .gitleaks.toml are NOT covered by .gitignore:\");\n for (const f of missing) {\n write(` ${f}`);\n }\n write(\n \"These files may contain secrets. Add them to .gitignore so the allowlist entry doesn't become a hiding place.\"\n );\n },\n };\n}\n"
|
|
13
15
|
],
|
|
14
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAkCA;AACA;AAoBO,IAAM,iCAAwD;AAAA,EACnE,EAAE,SAAS,gBAAgB,SAAS,YAAY,aAAa,WAAW;AAAA,EACxE;AAAA,IACE,SAAS;AAAA,IACT,SAAS;AAAA,IACT,aAAa;AAAA,IAGb,MAAM,CAAC,SAAS,sBAAsB,KAAK,IAAI;AAAA,EACjD;AAAA,EACA;AAAA,IACE,SAAS;AAAA,IACT,SAAS;AAAA,IACT,aAAa;AAAA,EACf;AAAA,EACA,EAAE,SAAS,gBAAgB,SAAS,YAAY,aAAa,WAAW;AAAA,EACxE,EAAE,SAAS,cAAc,SAAS,UAAU,aAAa,eAAe;AAAA,EACxE,EAAE,SAAS,gBAAgB,SAAS,YAAY,aAAa,UAAU;AACzE;AAoCA,IAAM,oBAAoB,IAAI,IAAI,CAAC,gBAAgB,QAAQ,QAAQ,SAAS,OAAO,CAAC;AAQpF,eAAsB,qBAAqB,CACzC,SACsC;AAAA,EACtC,MAAM,QAAQ,QAAQ,SAAS;AAAA,IAC7B,GAAG;AAAA,I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IAAI;AAAA,IACF,YAAY,MAAM,SAAS,eAAe,MAAM;AAAA,IAChD,MAAM;AAAA,IACN,YAAY;AAAA;AAAA,EAGd,MAAM,WAAW,mBAAmB,MAAM,QAAQ,IAAI;AAAA,EACtD,MAAM,iBAAiB,UAAU,MAAM;AAAA,CAAI,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC;AAAA,EAChE,MAAM,UAAU,SAAS,OACvB,CAAC,aAAa,CAAC,eAAe,KAAK,CAAC,OAAO,oBAAoB,IAAI,QAAQ,CAAC,CAC9E;AAAA,EAEA,OAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA,OAAO,CAAC,QAAQ,iBAAiB;AAAA,MAC/B,IAAI,QAAQ,WAAW,GAAG;AAAA,QACxB;AAAA,MACF;AAAA,MACA,MAAM,gEAAgE;AAAA,MACtE,WAAW,KAAK,SAAS;AAAA,QACvB,MAAM,KAAK,GAAG;AAAA,MAChB;AAAA,MACA,MACE,+GACF;AAAA;AAAA,EAEJ;AAAA;",
|
|
17
|
+
"debugId": "DF1AD1BD498F9B7264756E2164756E21",
|
|
16
18
|
"names": []
|
|
17
19
|
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* No-require conformance check.
|
|
3
|
+
*
|
|
4
|
+
* Bans `require(...)` calls in TypeScript source. Inline CommonJS
|
|
5
|
+
* escapes defeat bundler static analysis, hide cross-module
|
|
6
|
+
* dependencies, and quietly opt a module out of ESM semantics that
|
|
7
|
+
* the rest of the codebase depends on. The motivating incident was a
|
|
8
|
+
* consumer app that shipped
|
|
9
|
+
*
|
|
10
|
+
* const { renameSync } = require("node:fs") as typeof import("node:fs");
|
|
11
|
+
*
|
|
12
|
+
* wedged mid-function — the `as` cast alone violated no-as-casting,
|
|
13
|
+
* but the underlying sin was the require call. Static ES imports
|
|
14
|
+
* round-trip through every bundler and every IDE; `require` does
|
|
15
|
+
* neither.
|
|
16
|
+
*
|
|
17
|
+
* Allowed: `import` / `export` syntax of any flavour, `import(...)`
|
|
18
|
+
* dynamic imports (they're ESM), `require.resolve(...)` (sometimes
|
|
19
|
+
* load-bearing for runtime path resolution), and occurrences inside
|
|
20
|
+
* strings or comments.
|
|
21
|
+
*/
|
|
22
|
+
export interface NoRequireViolation {
|
|
23
|
+
file: string;
|
|
24
|
+
line: number;
|
|
25
|
+
content: string;
|
|
26
|
+
}
|
|
27
|
+
export interface NoRequireCheckResult {
|
|
28
|
+
violations: NoRequireViolation[];
|
|
29
|
+
print: () => void;
|
|
30
|
+
}
|
|
31
|
+
export interface NoRequireCheckOptions {
|
|
32
|
+
rootDir: string;
|
|
33
|
+
exclude?: string[];
|
|
34
|
+
/** Glob of files to scan. Defaults to `**` /`*.{ts,tsx}`. */
|
|
35
|
+
filePatterns?: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Returns true when the line contains no forbidden `require(` call.
|
|
39
|
+
* Mirrors the shape of `isLineClean` in no-as-casting for
|
|
40
|
+
* consistency; the two rules compose cleanly when both run against
|
|
41
|
+
* the same file.
|
|
42
|
+
*/
|
|
43
|
+
export declare function isLineRequireClean(line: string): boolean;
|
|
44
|
+
export declare function checkNoRequire(options: NoRequireCheckOptions): Promise<NoRequireCheckResult>;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Secret-scanning conformance checks.
|
|
3
|
+
*
|
|
4
|
+
* Two paired checks that protect a repository from accidentally
|
|
5
|
+
* committing credentials:
|
|
6
|
+
*
|
|
7
|
+
* - `checkSecrets` spawns `gitleaks detect` against the working
|
|
8
|
+
* tree and returns the exit code + stdout. Consumers are
|
|
9
|
+
* expected to have `gitleaks` on PATH (via `brew install
|
|
10
|
+
* gitleaks` or equivalent); the check reports a clear failure
|
|
11
|
+
* when the binary is missing.
|
|
12
|
+
*
|
|
13
|
+
* - `checkGitignoreCoversAllowlist` parses a `.gitleaks.toml`
|
|
14
|
+
* config, pulls out the path patterns that sit in an allowlist
|
|
15
|
+
* *section* marked as "gitignored files" (via comment
|
|
16
|
+
* markers), and verifies each one is actually covered by
|
|
17
|
+
* `.gitignore`. This catches the footgun where a repo
|
|
18
|
+
* allowlists `.env` in gitleaks config but forgets to add it
|
|
19
|
+
* to `.gitignore`, so the allowlist entry silently lets a real
|
|
20
|
+
* secret slip through.
|
|
21
|
+
*
|
|
22
|
+
* Adapted from the devctl `check` command in the Lingua project.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```typescript
|
|
26
|
+
* import {
|
|
27
|
+
* checkSecrets,
|
|
28
|
+
* checkGitignoreCoversAllowlist,
|
|
29
|
+
* } from "@fairfox/polly/quality";
|
|
30
|
+
*
|
|
31
|
+
* const scan = await checkSecrets({ root: process.cwd() });
|
|
32
|
+
* if (scan.exitCode !== 0) process.exit(scan.exitCode);
|
|
33
|
+
*
|
|
34
|
+
* const cover = await checkGitignoreCoversAllowlist({
|
|
35
|
+
* root: process.cwd(),
|
|
36
|
+
* });
|
|
37
|
+
* if (cover.missing.length > 0) {
|
|
38
|
+
* cover.print();
|
|
39
|
+
* process.exit(1);
|
|
40
|
+
* }
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export interface CheckSecretsOptions {
|
|
44
|
+
/** Repository root to scan. */
|
|
45
|
+
root: string;
|
|
46
|
+
/** Path to a gitleaks TOML config, relative to `root`. Defaults
|
|
47
|
+
* to `.gitleaks.toml`. */
|
|
48
|
+
configPath?: string;
|
|
49
|
+
/** Scan the working tree (`--no-git`) or the git history.
|
|
50
|
+
* Defaults to true (working tree only — faster, and what most
|
|
51
|
+
* pre-commit / CI flows want). */
|
|
52
|
+
noGit?: boolean;
|
|
53
|
+
}
|
|
54
|
+
export interface SecretsCheckResult {
|
|
55
|
+
/** Whether `gitleaks` was found on PATH at all. */
|
|
56
|
+
binaryFound: boolean;
|
|
57
|
+
/** `gitleaks detect` exit code, or null when the binary was
|
|
58
|
+
* missing. 0 = clean, 1 = secrets found, other = gitleaks
|
|
59
|
+
* error. */
|
|
60
|
+
exitCode: number | null;
|
|
61
|
+
/** Streamed gitleaks stdout + stderr. Empty when the scan was
|
|
62
|
+
* skipped. */
|
|
63
|
+
output: string;
|
|
64
|
+
print: (write?: (msg: string) => void) => void;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Run gitleaks against the working tree. Returns `binaryFound:
|
|
68
|
+
* false` if the binary isn't on PATH — callers typically treat
|
|
69
|
+
* that as a hard failure with an install hint.
|
|
70
|
+
*/
|
|
71
|
+
export declare function checkSecrets(options: CheckSecretsOptions): Promise<SecretsCheckResult>;
|
|
72
|
+
export interface CheckGitignoreOptions {
|
|
73
|
+
/** Repository root. */
|
|
74
|
+
root: string;
|
|
75
|
+
/** Path to the gitleaks TOML config, relative to `root`. Defaults
|
|
76
|
+
* to `.gitleaks.toml`. */
|
|
77
|
+
tomlPath?: string;
|
|
78
|
+
/** Path to the gitignore file, relative to `root`. Defaults to
|
|
79
|
+
* `.gitignore`. */
|
|
80
|
+
gitignorePath?: string;
|
|
81
|
+
/** Strings that, when seen in a comment line of the TOML, mark
|
|
82
|
+
* the start of a "must be gitignored" section. Defaults cover
|
|
83
|
+
* "Gitignored files" and "Local dev TLS certs". */
|
|
84
|
+
sectionStartMarkers?: string[];
|
|
85
|
+
/** Strings that close a must-be-gitignored section. Defaults to
|
|
86
|
+
* "Test fixtures" so the common lingua-style layout works
|
|
87
|
+
* unchanged. */
|
|
88
|
+
sectionEndMarkers?: string[];
|
|
89
|
+
}
|
|
90
|
+
export interface GitignoreCheckResult {
|
|
91
|
+
/** TOML-listed allowlisted paths that `.gitignore` does NOT
|
|
92
|
+
* cover. Each string is the derived plain filename (e.g.
|
|
93
|
+
* `.env`, `certs/key.pem`). */
|
|
94
|
+
missing: string[];
|
|
95
|
+
/** All paths the TOML required to be gitignored, whether or not
|
|
96
|
+
* .gitignore covers them. Useful for audits. */
|
|
97
|
+
required: string[];
|
|
98
|
+
print: (write?: (msg: string) => void) => void;
|
|
99
|
+
}
|
|
100
|
+
export declare function checkGitignoreCoversAllowlist(options: CheckGitignoreOptions): Promise<GitignoreCheckResult>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fairfox/polly",
|
|
3
|
-
"version": "0.29.
|
|
3
|
+
"version": "0.29.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Multi-execution-context framework with reactive state and cross-context messaging for Chrome extensions, PWAs, and worker-based applications",
|