Configure Stylelint SCSS support automatically on recommended installs - #55
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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**/*.cssonly 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 toinstallalongside the other recommended settings. Recommended and non-interactive installs on SCSS projects now configure SCSS support automatically;skipopts out explicitly.stylelint-config-standard-scssthrough 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 manualnpm installcommand failed with ERESOLVE — this fixes that path too..stylelintrc.jsonto extendstylelint-config-standard-scsswhen the shipped config is in place (exact-token swap, idempotent, keepsstylelint-prettier/recommended)..ddev/config.drupal-code-quality.yamlwithout discarding customweb_environmententries or comments, dropping the#ddev-generatedmarker once the file carries a project-specific setting.package.jsonin addition to config + globs, matches only live stylelint config filenames (not.bak/.oldbackups), 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
DCQ_SCSS_SUPPORT=skipleaving everything untouched, and a node-tagged end-to-end test (real npm install, extends swap, globs).ddev restart,ddev stylelintflags.scssviolations with SCSS-specific rules (scss/dollar-variable-pattern); re-install in replace mode self-heals; clean CSS unaffected.