@codacy/tools-stylelint-0
v0.2.1
Published
Stylelint adapter — Library-mode CSS/SCSS/Less linter
Readme
@codacy/tools-stylelint-0
Table of Contents
Overview
CSS/SCSS/Less linter using Stylelint. Uses the Library execution strategy — calls the Stylelint API directly rather than spawning a subprocess.
| Property | Value |
|----------|-------|
| Tool ID | Stylelint |
| Codacy UUID | 1f03328a-086e-459e-bfa3-73e56f01020f |
| Strategy | Library |
| Languages | CSS, LESS, SASS |
| Dependency | stylelint npm package (v16.x) |
| File patterns | **/*.css, **/*.scss, **/*.less |
Updating patterns
# Re-fetch pattern metadata from the Codacy API
pnpm prefetch
# Commit the result
git add src/patterns.jsonPattern IDs follow the format Stylelint_block-no-empty, Stylelint_color-no-invalid-hex, etc.
Updating the Stylelint version
- Update the
stylelintversion inpackage.json - Run
pnpm install - Run
pnpm prefetchto check for new/removed rules - Run
pnpm testto verify compatibility - If the major version changes, create a new adapter package (
stylelint-1/)
Development
pnpm build # Build with tsup
pnpm test # Run testsNotes for maintainers
- Stylelint v16+ is pure ESM. The adapter uses dynamic
import()at runtime to stay CJS-compatible with the tsup build. stylelint-config-standardis used as the default config when no local config or Codacy patterns are provided. Without it, Stylelint has zero rules enabled.- Stylelint appends the rule name in parentheses to warning text (e.g.
"Unexpected empty block (block-no-empty)"). The adapter strips this suffix for cleaner messages. checkAvailabilitydynamically imports Stylelint and runs a trivial lint to verify it loads.installis a no-op — the npm dependency handles installation.
