CodeVetter
← All unpacks
CodeVetter · Repo Unpack evidence

stylelint/stylelint

Scanned commit bc06c7cdb1 dated 2026-10-01 — last upstream commit. Generated by codevetter 1.15.0 on 2026-10-02.

github.com/stylelint/stylelint ↗ · 1125 files · 3.7 MB

Stylelint A mighty CSS linter that helps you avoid errors and enforce conventions.

Deep analysis by cli:codex via the codex CLI on 2026-10-02 (372s) — every claim below links to its cited source files. Source inspection; upstream code and tests were not executed.

Overview

Stylelint is a configurable CSS linter for stylesheet authors and tooling developers, distributed as a Node.js package with a CLI, asynchronous JavaScript API, and PostCSS plugin. Its core converts stylesheets into PostCSS trees, runs explicitly configured rules, and returns diagnostics, optional edits, or rewritten files. Lazy rule loading, per-file configuration overrides, custom syntaxes, plugin rules, reference stylesheets, and experimental count-based suppressions make it adaptable to larger projects. This brief describes source inspected at commit bc06c7cdb1413de3d8dc939b33af138ab7e59df1; it does not establish runtime correctness.

System map

The runtime is a Node.js library and CLI centered on a shared PostCSS linting pipeline. Configuration discovery, rule execution, formatting, and persistence have separate modules, while each linter instance owns several caches. npm scripts define development checks, and GitHub workflows handle CI, preview packages, and releases.

Feature catalog

Users can lint files, glob patterns, or supplied code and configure which rules run. Diagnostics support severity controls, custom messages, multiple formats, inline disabling, autofixes, and edit information. Custom syntaxes, reference files, configuration inheritance, and suppressions extend the basic CSS workflow.

Data flow

Input paths are normalized and filtered before stylesheet reads. Per-file configuration controls parsing, reference loading, rule execution, and diagnostic transformation. PostCSS results own execution metadata, while standalone turns those results into reports and optional disk writes.

Behavior traces

The inspected traces cover CLI initialization, file linting, stdin linting, fixing, suppression persistence, configuration printing, and PostCSS integration. These paths converge at lintSource but have different output and persistence behavior. Conditions such as ignored inputs, cache hits, syntax errors, and conflicting flags materially change the sequence.

Testing signals

Tests and CI were inspected, not executed; no passing result or measured coverage is asserted. The repository combines Jest rule schemas, integration tests, snapshot system tests, and selected node:test suites. The inspected tests demonstrate substantial behavioral specifications, but this bounded review does not establish exhaustive coverage or identify every untested branch.

Risk map

The main sensitive boundaries are executable extensions, arbitrary configured filesystem paths, cache invalidation, and privileged workflow automation. Several source details warrant focused regression checks, particularly custom cwd handling and shared mutable state. Observations below describe behavior or explicitly labeled hypotheses; they are not confirmed vulnerabilities.

Extension points

Stylelint exposes extension interfaces for rules, syntaxes, configuration, reporting, and reference loading. Core rules and formatters use explicit registries, while configured plugin definitions are normalized into lookup tables. Most extension behavior converges on PostCSS roots and the shared reporting utility.

Contributor handoff

Start with the public API and the narrow rule or integration path being changed. Preserve configuration precedence, diagnostic locations, disable behavior, and the distinction between string output and file persistence. Tests and CI were inspected, not executed; future verification must report actual outcomes and respect the current read-only restriction.

Languages

LanguageFilesShare of source
JavaScript76099%
Markdown183docs/config
CSS60docs/config
JSON50docs/config
YAML16docs/config
HTML6docs/config
Sass61%
TypeScript20%

Start reading here

Probable source entrypoint: lib/ — inferred from the directory tree and manifest, not the upstream docs.

Source roots

lib/ (999 files)

Source layout — lib/

PathFiles
lib/formatters/17
lib/utils/204
lib/assignDisabledRanges.mjs1
lib/augmentConfig.mjs1
lib/constants.mjs1
lib/createPartialStylelintResult.mjs1
lib/getPostcssResult.mjs1
lib/lintPostcssResult.mjs1
lib/needlessDisables.mjs1
lib/normalizeAllRuleSettings.mjs1
lib/postcssPlugin.mjs1
lib/prepareReturnValue.mjs1
lib/printConfig.mjs1
lib/reportUnknownRuleNames.mjs1

Repository structure

Top-level pathFiles
lib/999
system-tests/41
docs/27
.github/12
scripts/12
identity/6
.changeset/5
types/2

Docs found: CONTRIBUTING.mdREADME.mddocs/about/governance.mddocs/about/semantic-versioning.mddocs/about/vision.mddocs/contributor-guide/benchmarks.mddocs/contributor-guide/rules.mddocs/contributor-guide/system-tests.mddocs/developer-guide/formatters.mddocs/developer-guide/plugins.md

Package

package.json — stylelint v17.16.0, 74 declared dependencies.

@changesets/cli@changesets/get-github-info@csstools/css-calc@csstools/css-parser-algorithms@csstools/css-syntax-patches-for-csstree@csstools/css-tokenizer@csstools/media-query-list-parser@csstools/selector-resolve-nested@csstools/selector-specificity@jest/globals@stylelint/prettier-config@stylelint/remark-preset

CI & config entrypoints

Structural health signals

Average score 7.2/10 across 2 analyzed source files; 1 hotspot surfaced.

These are deterministic review leads — size, churn, and structural signals — not proof of a bug in this project.

Recent history