Add deep detection via jsdom and URL scanning via Puppeteer

Three detection tiers:
- file/dir (default): fast regex scan, zero dependencies
- file + --deep: jsdom computed styles, resolves linked local stylesheets
  by inlining <link rel="stylesheet"> content before parsing
- URL (https://...): auto-launches Puppeteer for full browser rendering,
  handles CDN stylesheets, JS-rendered content, everything

New exports: detectAntiPatternsDeep(), detectAntiPatternsUrl()
jsdom added as devDependency; puppeteer remains optional (npx cache).

TDD: linked-stylesheet fixture demonstrates the gap — regex finds 0
border issues, --deep correctly catches side-tab and top-accent from
the external CSS file.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Paul Bakaus
2026-03-17 11:07:47 -07:00
co-authored by Claude Opus 4.6
parent 1fb896a3ff
commit 32a54138bb
6 changed files with 689 additions and 22 deletions
+1
View File
@@ -31,6 +31,7 @@
},
"type": "module",
"devDependencies": {
"jsdom": "^29.0.0",
"wrangler": "^4.71.0"
}
}