Stylelint
$ stylelint Community Low RiskStandard stylesheet linter for CSS, SCSS, Less, and PostCSS syntax catching invalid properties, specificity traps, and style inconsistencies. Provides machine-readable --formatter json, --no-color, and --fix auto-remediation.
npm install -D stylelint Lints and fixes local CSS/SCSS files directly in the repository workspace.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Supports --formatter json, --no-color, --quiet, --allow-empty-input, and deterministic exit codes.
--formatter jsonwrites clean JSON diagnostics--allow-empty-inputprevents spurious failures when globs match zero files
Read-only by default; modifies files only when --fix is explicitly passed (no --fix-dry-run flag).
- Non-destructive default lint mode; lacks
--fix-dry-run
Cross-platform npm package requiring Node.js and project config (.stylelintrc.* or stylelint.config.*).
- Runs everywhere Node.js is installed
Standard CSS/SCSS linter with PostCSS plugin ecosystem; pairs cleanly with Prettier.
- Supports CSS, SCSS, and custom PostCSS syntaxes
Long-standing community project (stylelint/stylelint) under MIT license.
- Active
stylelint/stylelintrepository
Clear CLI reference and rule catalog at stylelint.io.
- Official CLI docs at stylelint.io/user-guide/usage/cli/
Security, Auth & Guardrails
Purely local stylesheet linter; no credentials stored or required.
MIT open-source npm package; completely free.
# Stylelint (stylelint) Agent Rules - Always pass `--formatter json --no-color` when reading stylesheet diagnostics. - Run read-only lint before `--fix` and quote glob arguments so Stylelint expands them reliably.
Agent-Ready Command Recipes
Safe Read-Only Queries
npx stylelint "src/**/*.{css,scss}" --formatter json --no-color Emits per-file JSON warning arrays and exits non-zero on errors without editing files.
Controlled Writes & Previews
npx stylelint "src/**/*.{css,scss}" --fix --no-color Applies fixable stylesheet rules in place using the project's .stylelintrc config.
Strengths for Agents
- +
--formatter json --no-colorproduces clean structured error objects per file. - +
--allow-empty-inputavoids brittle failures on PRs without CSS changes.
Caveats & Pitfalls
- ! Lacks a
--fix-dry-runoption like ESLint (usegit diffafter--fix). - ! Requires a Stylelint config file in the project unless
--configis passed.