Skip to main content

Stylelint Bridge

The bridge is powered by the stylelint rule. It runs Stylelint during ESLint execution and reports results as ESLint diagnostics.

What the bridge gives youโ€‹

  • A single lint entrypoint (eslint) for JS/TS + style quality
  • One diagnostics stream in editors and CI
  • Unified autofix flow (eslint --fix) where safe

How execution worksโ€‹

At a high level:

  1. ESLint visits a supported file.
  2. stylelint2/stylelint invokes Stylelint with your configured options.
  3. Stylelint results are mapped to ESLint reports.
  4. Autofixable issues are offered through ESLint fixers.

What gets reportedโ€‹

The bridge can surface:

  • Stylelint rule violations
  • Stylelint parsing failures
  • Invalid/unsupported Stylelint configuration details
  • Deprecation and migration warnings (depending on Stylelint behavior)

Fixing behaviorโ€‹

Use standard ESLint workflows:

npx eslint . --fix

Practical advice:

  • Prefer --fix first, then triage leftovers.
  • Treat non-fixable findings as policy debt, not random noise.
  • Keep bridge options explicit so behavior is deterministic across CI/local environments.

Option tuning checklistโ€‹

If behavior looks inconsistent, verify:

  • configFile points to the intended Stylelint config
  • configBasedir is stable in monorepos
  • customSyntax is set for non-standard syntaxes
  • allowEmptyInput and quiet match your expectations

See full option docs in stylelint rule reference.

Performance tipsโ€‹

  • Scope lint targets intentionally (do not lint the whole repo blindly in every job).
  • Cache ESLint in CI where possible.
  • Start with stylelintOnly if you need low-friction adoption.
  • Add config-authoring rules after baseline bridge stability.

When to keep Stylelint CLI separatelyโ€‹

You might still keep a dedicated Stylelint CLI job when:

  • You require Stylelint-specific formatter output in a separate pipeline stage.
  • You need parity with existing non-ESLint tooling contracts.

If you do this, avoid duplicated failing signals in PR checks (assign one owner per policy area).