Skip to content

Configure Stylelint SCSS support automatically on recommended installs - #55

Merged
UltraBob merged 1 commit into
mainfrom
scss-support-noninteractive
Aug 9, 2026
Merged

Configure Stylelint SCSS support automatically on recommended installs#55
UltraBob merged 1 commit into
mainfrom
scss-support-noninteractive

Conversation

@UltraBob

@UltraBob UltraBob commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Closes #43.

Problem

The installer's SCSS stage was interactive-only. Choosing Accept recommended settings (or DCQ_NONINTERACTIVE=true) skipped it entirely, silently leaving stylelint scanning **/*.css only on SCSS projects. Anyone coaching an install had to recommend declining recommended settings and answering every prompt manually just to get SCSS coverage.

What this does

  • DCQ_SCSS_SUPPORT (install/skip; unset prompts when interactive), defaulted to install alongside the other recommended settings. Recommended and non-interactive installs on SCSS projects now configure SCSS support automatically; skip opts out explicitly.
  • Installs stylelint-config-standard-scss through the existing node-deps machinery, version-pinned to the project's stylelint major (16 → ^16, ≥17 → ^major, 15 → ^11). The pin matters: the latest release peer-requires stylelint 17 while Drupal core pins stylelint 16, so the previously documented manual npm install command failed with ERESOLVE — this fixes that path too.
  • Updates .stylelintrc.json to extend stylelint-config-standard-scss when the shipped config is in place (exact-token swap, idempotent, keeps stylelint-prettier/recommended).
  • Merges the SCSS scan globs into .ddev/config.drupal-code-quality.yaml without discarding custom web_environment entries or comments, dropping the #ddev-generated marker once the file carries a project-specific setting.
  • Summary reports the outcome either way: a "SCSS support configured" section with a restart reminder, or the exact remaining manual steps when the package could not be installed (node tooling skipped/failed) or a custom stylelint config can't be updated automatically.
  • Hardened already-configured detection: requires the package declared in package.json in addition to config + globs, matches only live stylelint config filenames (not .bak/.old backups), and only uncommented glob entries. Replace-mode re-installs now self-heal the reverted extends swap instead of reporting SCSS as configured while broken.

Validation

  • New bats coverage: recommended-defaults auto-enable with node deps skipped (including merge-preservation of custom config entries), DCQ_SCSS_SUPPORT=skip leaving everything untouched, and a node-tagged end-to-end test (real npm install, extends swap, globs).
  • Full suite: 7/7 SCSS-filtered and 7/7 node-tagged tests pass.
  • Real sandbox verification: fresh Drupal 11 project — recommended install, ddev restart, ddev stylelint flags .scss violations with SCSS-specific rules (scss/dollar-variable-pattern); re-install in replace mode self-heals; clean CSS unaffected.

Recommended-settings and non-interactive installs previously skipped the
interactive SCSS stage entirely, leaving stylelint CSS-only on SCSS
projects unless the user declined recommended settings and answered
every prompt manually (#43).

- Add DCQ_SCSS_SUPPORT (install/skip; unset prompts interactively) and
  default it to install alongside the other recommended settings.
- When enabled, install stylelint-config-standard-scss through the
  node-deps machinery, pinned to the project's stylelint major: the
  latest release requires stylelint 17 and conflicts with the
  stylelint 16 Drupal core pins, so the previously documented manual
  command failed the same way under npm.
- Update .stylelintrc.json to extend stylelint-config-standard-scss
  when the shipped config is in place, and merge the SCSS scan globs
  into .ddev/config.drupal-code-quality.yaml without discarding custom
  web_environment entries (dropping the #ddev-generated marker once the
  file carries a project-specific setting).
- Report the outcome in the install summary: fully configured, or the
  remaining manual steps when the package could not be installed or a
  custom stylelint config cannot be updated automatically.
- Make already-configured detection package-aware and immune to
  installer backups and commented-out glob examples, so replace-mode
  re-installs self-heal the reverted stylelint config instead of
  reporting SCSS as configured while it is broken.
@UltraBob
UltraBob merged commit 00339ff into main Aug 9, 2026
5 checks passed
@UltraBob
UltraBob deleted the scss-support-noninteractive branch August 9, 2026 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Recommended-settings install skips SCSS support — provide a non-interactive path

1 participant