Migrate SCSS linting to stylelint 17 and run autofix pass#3624
Open
matthewhelmke wants to merge 1 commit into
Open
Migrate SCSS linting to stylelint 17 and run autofix pass#3624matthewhelmke wants to merge 1 commit into
matthewhelmke wants to merge 1 commit into
Conversation
Bump stylelint 14 -> 17 and stylelint-config-standard-scss 3 -> 17 to match chainguard-dev/courses-theme, the docs team's existing CSS-lint setup. Modernize .stylelintrc.json for stylelint 16+, where the removed stylistic rules (indentation, whitespace) moved to formatters, and mirror courses-theme's rule choices: disable no-descending-specificity, custom-property-pattern, the redundant-longhand and shorthand rules, and the *-pattern rules. Disable three rules whose autofixes break the Hugo/Dart Sass build: - scss/load-partial-extension stripped ".scss" from the DocSearch @import, which a sibling .css file made ambiguous. - color-function-alias-notation rewrote rgba() to rgb(), which Dart Sass rejects as a built-in-function arity error. - media-feature-range-notation, disabled to keep classic max-width media queries (matching courses-theme) and avoid a large diff. Run one autofix pass across assets/scss, clearing 3,551 of 3,573 findings. The compiled CSS is behavior-identical, verified by diffing the minified build output: every change reduces to hex shortening, zero-unit trimming, the spec-equivalent word-wrap to overflow-wrap alias, or same-block duplicate-declaration removal where the later declaration already won the cascade. The remaining 22 findings are manual fixes tracked as follow-ups. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
✅ Deploy Preview for ornate-narwhal-088216 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
SharpRake
approved these changes
Jul 22, 2026
SharpRake
left a comment
Collaborator
There was a problem hiding this comment.
Thanks @matthewhelmke!
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.
What this does
Modernizes the SCSS/stylelint setup for
assets/scssand runs a single autofix pass, the last remaining lint area for this repo (DOCS-2). eslint, markdownlint, and pre-commit CI are already done.Tooling:
stylelint14 → ^17 andstylelint-config-standard-scss3 → ^17, matchingchainguard-dev/courses-theme(the docs team's existing CSS-lint setup) — the standardization decision for this ticket..stylelintrc.jsonfor stylelint 16+, where the stylistic rules (indentation, whitespace) were removed and moved to formatters. Mirrors courses-theme's rule choices: disablesno-descending-specificity,custom-property-pattern, the redundant-longhand/shorthand rules, and the*-patternrules.Three rules disabled because their autofixes break the Hugo/Dart Sass build:
scss/load-partial-extensionstripped.scssfrom the DocSearch@import, which a sibling.cssfile made ambiguous.color-function-alias-notationrewrotergba()→rgb(), which Dart Sass rejects as a built-in-function arity error.media-feature-range-notation, disabled to keep classicmax-widthmedia queries (matching courses-theme) and avoid a large diff.Autofix pass: clears 3,551 of 3,573 findings. The remaining 22 are manual fixes (shorthand-overrides, import-position, duplicates), tracked as follow-ups.
Verification
npm run buildcompiles cleanly (1,599 pages, no errors).#ffffff→#fff), zero-unit trimming (0px→0), the spec-equivalentword-wrap→overflow-wrapalias, and same-block duplicate-declaration removal where the later declaration already won the cascade.Not in this PR (follow-ups)
Created in collaboration with Claude Code running Opus 4.8 on 2026-07-22.