npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

c3b-lint

v0.0.32

Published

Lints a co:lab project against the rules a tool can check: ESLint, Stylelint, the HTML, WCAG 2.2 and SEO/agent-readability rules, the 500-line limit and the shared .editorconfig; --init writes the config files.

Readme

c3b-lint

Lints a co:lab project against the rules in the llm-instructions markdown that a tool can check, with one command and one config to install. It runs, in this order:

  1. Project structure: singular directory names, lowercase kebab-case asset names (and no camera exports), and, when src/ holds pages, CSS only in src/style/ + style/page/ + style/animation/, JS only in src/script/ (an experiment under src/experiment/<name>/ keeps its own beside its index.html), fonts only in src/asset/font/ as woff2, file names starting with a letter. A directory whose plural-looking name is a proper name (a client's brand) is listed in package.json under "c3b-lint": { "singularDirectories": [...] }. Also here:
    • Assets: a camera export is caught by its prefix (img-, dsc-, pxl-) or by a year and counter (studio-2026-0287.webp). Warnings, because the images are usually gitignored and a machine without them must lint the same: the same file twice in src/asset/, an image over 500 KB, the page's og:image over 300 KB and a video over 5 MB. An asset that no page, stylesheet, script or data file under src/ names by its path (asset/home/hero.webp) is an error: delete it, or put it under ignore. Where there is a d8e-asset-manifest.json the manifest is the list that is checked, so the result is the same with or without the images on disk; a file that is only on this machine and not in the manifest yet is a warning.
    • Vendored files (src/**/vendor/, vendor/) carry their version in the name (gsap-3.13.0.min.js), or in the folder's for a library kept as one (three-0.160.0/build/three.module.js).
    • The three stylesheets: a site with CSS in src/style/ has reset.css, tokens.css and main.css. Without tokens.css the token check (3) has nothing to read.
    • The repo baseline from general.md: c3b-lint runs in pretest or test, and a site runs c3b-lint --init in postinstall (npm run lint counts when that script is the lint); every pre<name> script has its <name> (npm's own hooks like prepare, and words like preview, aside); Node is pinned in engines with a .nvmrc naming the same major; package-lock.json exists; and .gitignore covers .DS_Store, .idea/, .llm-rules/, .env* and node_modules/.
  2. HTML on every page under src/ (partials are skipped): doctype, lang, charset, viewport without user-scalable=no, the required head set (title, description, absolute canonical, og:* with an absolute og:image, twitter:card, one SVG favicon; a noindex page is excused the canonical and social tags), no external stylesheets (webfonts are self-hosted; a warning, not an error), stylesheet order (reset, tokens, main, …, page file last), the skip-link rule (<a id="skip-link" href="#main"> first in <body> when there is a header or nav, absent otherwise, landing on <main id="main"> — or on the id <main> already has), one <h1>, alt on every image, no inline handlers, no <style> or style="" (except a JS-driven custom property), relative paths only (a Barba site's links outside its container — header, menu — stay root-relative), kebab-case ids and classes, no duplicate ids, no class that a single element on a single page carries (that is an id's job; is-* state classes, a partial's markup, a <template>'s content and classes a script adds are not counted), integrity on CDN scripts. Scripts sit at the bottom of <body> as its direct children, importmaps first, then plain scripts, then deferred, then modules. In <head>, only an async tag (analytics) or an inline line that must run before first paint; a Barba container keeps its page's own scripts; a typed data block (JSON-LD) is not a script. An inline <script> is a warning wherever it is, unless a comment excuses it (see Excusing a finding).
  3. Token hygiene across all the CSS, which no per-file linter can do: a literal that duplicates a token's value (#2b4b6f where --color-primary is that), a literal colour, font-family or spacing value used in two or more rules (that is a token by definition), and a token nothing uses (CSS var(), or JS/HTML by name). With it, because it also reads the CSS itself: no copy text in content: (a glyph, an escape, attr(), a counter and the alternative text after a / are fine).
  4. Accessibility, the WCAG 2.2 A/AA criteria a parser can check, each finding naming its criterion: form fields labelled (a placeholder is not a label) and autocomplete on email/tel/url fields, links and buttons with an accessible name and link text that says where it goes, no href="#" controls, no tabindex above 0, no aria-hidden on anything focusable, role/aria-* names that exist and id references that resolve, heading levels that don't skip, <th> in data tables, <iframe> titles, inline <svg> either aria-hidden or role="img" with a name, no file-name or "image of" alt text, captions on <video>/<audio> and a way to stop autoplay (controls, a button with aria-controls naming it, or for a muted video a prefers-reduced-motion: reduce rule on it), no <meta http-equiv="refresh">, a valid lang, and in the CSS no outline: none unless the rule shows focus another way or is :focus:not(:focus-visible), and a prefers-reduced-motion: reduce block in every file with a transition or animation (unless it sits in a no-preference block). A muted video needs no captions; a <template>'s content is not checked (it is not in the document). What needs a rendered page (contrast, target size, focus order, what JS adds) stays with c10g's axe-core run.
  5. SEO and agent readability, what a search engine or an AI agent needs to index the site and say what each page is: src/robots.txt with a Sitemap: line and src/sitemap.xml, every indexable page in the sitemap and every sitemap entry a page; on every indexable page the canonical, og:url and sitemap entry naming the same URL (.html or not on all three — d8e --clean-urls cleans them all); JSON-LD on every indexable page that parses, carries "@context": "https://schema.org" and a @type (or a @graph of typed items); a page titled FAQ typed FAQPage (a warning). And the build: d8e --clean-urls when and only when vercel.json has cleanUrls, and d8e --markdown so agents get Markdown twins and llms.txt (a warning without it). A noindex page, and a page under a path robots.txt disallows, is excused.
  6. That the project's .editorconfig is the shared one — it carries the JetBrains ij_* code-style keys, so WebStorm and IntelliJ format the same way without committing .idea/.
  7. The 500-line limit on src/**/*.{css,html} (ESLint reports the JS); inline <svg> art is not counted, nor is a colab-partial region whose partial is in src/partial/ (one line each: the partial is counted on its own).
  8. ESLint on every .js file — classic browser scripts under src/ (IIFE required, no top-level declarations, no console.log), ES modules everywhere else — with eslint:recommended plus the rules from frontend.md: braces on every if, const/let never var, ===, a blank line before return, 500 lines max, and a replace()/replaceAll() whose replacement comes from data must pass a function (a string one expands $&). In src/, a page URL is written out whole, never ended with '.html' after a value ('./' + slug + '.html'): d8e --clean-urls can only rewrite the literal. A Playwright spec (test/e2e/**, *.spec.js) is a Node module whose callbacks run in the page, so it also gets the browser's globals and the project's globals. In src/, a script attaches its API to window.App, never to a global of its own (window.LBReady = …; a callback a third party calls by name and the analytics tag's settings are not ours to move), and an ES module there is reported as one rather than as a bare parsing error.
  9. Stylelint on src/**/*.css with stylelint-config-recommended plus the rules from frontend.md: no !important, max 3 compound selectors, kebab-case ids/classes with is-* states and -- variants, :root only in tokens.css (and reset.css), token names --{category}-{role}, rem font sizes, em letter-spacing, never dvh, no colour literal with an alpha channel (rgba(), rgb(… / 20%), #0003: alpha variants use color-mix), no styling off data-* (warning), and breakpoints of 1024px, 768px and 480px only (warning).

Formatting itself (indent, quotes, spacing) is not linted: the .editorconfig and the IDE own it.

A Node library that keeps its modules in src/ (c10g) is not a site: its eslint.config.js is export default [...base, librarySrc]; (both from c3b-lint/config/eslint.config.js), which lints src/ with the Node rules, and the site-layout checks only apply when src/ holds pages.

Setup

npm install --save-dev c3b-lint
npx c3b-lint --init

--init writes four files at the project root, all to commit:

  • .editorconfig — the shared one (a copy; editors need a real file).
  • eslint.config.js and stylelint.config.js — one line each, re-exporting this package's configs, so WebStorm shows the same errors inline as the CLI reports. Bumping c3b-lint changes the rules everywhere. Written only when missing: a project that has extended its config keeps it.
  • .githooks/pre-commit, and git config core.hooksPath .githooks — the lint runs before every commit, so a commit that fails it never lands, whoever makes it. The hook lives in the repo, so after a clone one --init (or npx c3b-lint --init in postinstall) wires it up. If node_modules is missing it says so and lets the commit through; the test gate catches it later.

Then in package.json:

"postinstall": "c3b-lint --init",
"lint": "c3b-lint",
"pretest": "colab-partial --check && c3b-lint"

postinstall keeps the four files current and wires the hook on every clone with no extra step (--init only writes, it never fails an install); pretest makes a lint error fail npm test and anything that runs it.

Project settings

A project's own settings go in its package.json, under "c3b-lint":

"c3b-lint": {
    "ignore": ["src/experiment/**"],
    "globals": ["THREE", "gsap", "ScrollTrigger"],
    "singularDirectories": ["mannequin-films"],
    "ignoreLength": ["src/index.html"]
}
  • ignore — globs, from the project root, that no check looks at: ESLint, Stylelint and every check c3b-lint runs itself (HTML, structure, tokens, file lengths). For code that is not the site's own, like standalone experiments.
  • globals — the names a page's CDN <script> tags define (THREE, gsap, Lenis, …). ESLint lints each file on its own and never reads the HTML, so without them every use is "not defined". Read-only, src/ scripts only.
  • singularDirectories — plural-looking directory names that are proper names (a client's brand).
  • ignoreLength — globs exempt from the 500-line limit and nothing else: the HTML, token, structure, ESLint and Stylelint checks still run on them. For a file that can't be split. A page made long by the partials it carries needs none: their regions count as one line each.

The ESLint and Stylelint configs read these too, so WebStorm reports what the CLI does.

Excusing a finding

A rule is fixed, not switched off. The few that have a legitimate permanent exception can be excused where they occur, with a comment that says why:

  • HTML — <!-- c3b-lint-disable inline-script: must run before first paint --> directly before the inline <script>. inline-script is the only rule that can be excused this way. A comment with no reason, an unknown rule, or nothing after it to excuse is itself a warning, and every run prints how many findings were excused (exemptions in the JSON report).
  • CSS — Stylelint's own /* stylelint-disable-next-line <rule> -- <reason> */. One with no reason, or that no longer silences anything, is a warning.
  • JS — ESLint's own // eslint-disable-next-line <rule> -- <reason>. ESLint warns about one that no longer silences anything; it has no check for a missing reason, so that is left to review.

The token, structure, asset and length checks report on a value or a file across the project rather than on a line: ignore and ignoreLength above are what they have.

Usage

c3b-lint            # lint; exits 1 on any error
c3b-lint --fix      # apply the fixes ESLint and Stylelint consider safe (var -> const, braces, …); reformat in the IDE after
c3b-lint --init     # (re)write .editorconfig, eslint.config.js, stylelint.config.js, the pre-commit hook
c3b-lint --help

The version is printed first, so you can tell which install is running.

Findings print in sections, in the order they run — --- c3b-lint --- (checks 1–7), --- eslint ---, --- stylelint --- — each grouped under the file's absolute path the way ESLint prints, with a ✖ N problems total. A section with no findings is not printed. The timings follow, then the error count.

With C3B_LINT_REPORT=<path> in the environment, every finding of the run is also written to that file as JSON, passed or failed: { version, errors, warnings, findings }, each finding { check, file, line, column, severity, rule, message, fixable } — check is structure, html, accessibility, seo, tokens, editorconfig, lengths, eslint or stylelint, file is relative to the project root, rule and fixable come from ESLint and Stylelint (null and false for c3b-lint's own checks). It's for a program reading the run — colab-desktop's Output summary. An environment variable rather than a flag: a caller that sets it for every project can't know which c3b-lint each one pins, and an older version ignores it where it would refuse a flag.

Not covered

Rules that need judgement stay with review: whether two selectors are structurally disjoint, flex vs grid, whether a one-off literal should be a token anyway, where a component style belongs. no-descending-specificity is off for the same reason. The checks that need a browser (console errors, broken links and images, the accessibility of the rendered page — contrast, target size, focus order, what JS adds — and overflow) stay in c10g; its SEO and duplicate-id suites now overlap with the HTML check here. Java projects use colab-checkstyle and the same .editorconfig.