r/webdev • u/Longjumping_Bus5224 • 3h ago
Showoff Saturday Showoff Saturday: I wrote a linter that checks Chrome extensions for Web Store rejection risks before you submit
Submitting an extension to the Chrome Web Store and then waiting days to hear back is the worst part for me. The rejection usually turns out to be something that was in the package all along, like a permission nothing uses, a script loaded from a remote URL, or obfuscated code.
I wanted something like eslint for that, a quick local check before I hit submit, so I built it. It's called tabsmith-lint. It's a TypeScript CLI under the MIT license, and you can run it on an unpacked Manifest V3 folder or on the .zip/.crx you're about to upload:
npx tabsmith-lint ./my-extension
npx tabsmith-lint ./my-extension.zipA few design decisions, in case you're building something similar:
- Findings use the violation names Chrome reviewers use (Purple Potassium, Blue Argon, Yellow Magnesium, Red Titanium), so the output matches what you'd see in a rejection email.
- The unused-permission and eval checks are warnings, not hard fails. A static check can't see everything, and I'd rather miss something than tell you to remove a permission you need. On a hand-labeled set of 28 real extensions, the unused-permission check had no false positives. That's a small set, so take it with a grain of salt.
- The obfuscation check looks for patterns minifiers don't produce, so normal minified bundles shouldn't trip it.
- The zip reader only uses Node built-ins. It extracts to a temp dir, doesn't follow symlinks, and bails out on encrypted or oversized archives. If manifest.json is nested in a folder, which happens when you zip the folder instead of its contents, it tells you why that fails.
It's Chrome-only for now. Source: https://github.com/rsub122/tabsmith-lint
I'd like to hear about false positives, especially on minified or bundled code, and what you'd do differently.