CodeVetter · Repo Unpack · System map
stylelint/stylelint
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.
- The npm package exports lib/index.mjs and TypeScript declarations, installs bin/stylelint.mjs as the stylelint command, and requires Node.js >=20.19.0.
- bin/stylelint.mjs forwards process.argv.slice(2) to cli; lib/index.mjs augments the PostCSS plugin creator with lint, resolveConfig, registries, plugin creation, utilities, and reference data.
- standalone orchestrates inputs and outputs; lintSource resolves configuration and parsing; lintPostcssResult loads and invokes configured rules on PostCSS roots.
- createStylelint constructs cosmiconfig explorers, four in-memory Maps, and a FileCache; production discovery uses the global search strategy, while NODE_ENV=test sets a stop directory.
- Core rules and built-in formatters are loaded through asynchronous getters; rule import promises are retained in a module-level Map.
- Runtime integrations include PostCSS, cosmiconfig, globby, file-entry-cache, CSS parsers, and write-file-atomic; npm's version-3 lockfile records the package dependency graph.
- npm scripts provide benchmarks, formatting, ESLint, Markdown linting, TypeScript checking, Jest, and node:test; TypeScript checks JavaScript strictly with no emit and excludes test files.
- CI delegates matrix tests to a pinned reusable workflow; preview publishing uses pkg.pr.new; release-PR and release workflows delegate to pinned workflows with write permissions.