- Config file changed from
.stylelintrc(JSON) tostylelint.config.js(ESM).extends: "stylelint-config-htmlacademy"keeps working throughpackage.json#exports. Consumers reaching into the file path directly (e.g.extends: "stylelint-config-htmlacademy/.stylelintrc") must switch to the package name.
- Stylelint v17 compatibility in
peerDependencies. stylelint-orderplugin with 7 semantic groups (custom properties, positioning, box-model, typography, decoration, animation, interactivity) covering ~430 modern CSS properties: container queries, anchor positioning, view transitions, full logical properties,field-sizing,corner-shape, scroll API, masks, modern typography. The list lives in a separateproperties-order.jsmodule.order/order: [custom-properties, declarations, rules]— declarations after nested rules are flagged.selector-no-deprecated— deprecated selectors like:-webkit-anyare flagged.selector-anb-no-unmatchable— impossible selectors like:nth-child(0)are flagged (closes #66).selector-no-invalid— syntactically invalid selectors like[0foo]or:nth-child(2n+)are flagged. CSS only; disabled in SCSS/LESS overrides.no-unknown-custom-media— typos in@custom-mediareferences are flagged (closes #144).no-unknown-custom-properties— references to undeclared custom properties are flagged (closes #46).color-function-alias-notation: "without-alpha"— onlyrgb()/hsl()allowed;rgba/hslaaliases are flagged (closes #34).declaration-block-single-line-max-declarations: 0— single-line blocks are flagged (closes #106).selector-max-compound-selectors: 2— selectors like.a.b.care flagged (closes #111).selector-max-class: 2— chains like.a.b.care flagged (closes #109).selector-max-combinators: 2— chains like.a .b .c .dare flagged (closes #110).selector-max-type: 2— chains with more than two type selectors are flagged (closes #114).media-feature-range-notation: "context"— modern(width >= 768px)syntax required. Auto-fixable (closes #117).keyframes-name-pattern— kebab-case for@keyframesnames (closes #121).custom-media-pattern: "^[a-z][a-z0-9-]*$"— kebab-case for@custom-medianames (closes #119).custom-property-pattern: "^[a-z][a-z0-9-]*$"— kebab-case for--custom-properties(closes #120).selector-id-pattern: "^[a-z][a-z0-9-]*$"— kebab-case for ID selectors (closes #123).selector-nested-pattern: "&"— nested selectors must reference parent via&. Works for native CSS Nesting and SCSS/LESS (closes #124).at-rule-disallowed-list: ["import"]—@importforbidden in CSS (allowed in SCSS/LESS overrides) (closes #134, #148).color-function-notation: "modern"—rgb(255 0 0)syntax required (closes #131).lightness-notation: "percentage"— percentage required for lightness inoklch/oklab/lch/lab(closes #65).alpha-value-notation: "percentage"— percentage required for opacity and alpha channels. Auto-fixable (closes #116).time-min-milliseconds: 100— durations below 100ms are flagged (closes #115).comment-whitespace-inside: "always"— whitespace inside comments required (closes #127).declaration-block-no-redundant-longhand-properties— redundant longhand properties flagged (closes #125).shorthand-property-no-redundant-values— redundant shorthand values flagged (closes #126).font-family-no-duplicate-namesnow ignores themonospacekeyword for the"Courier New", monospace, monospacefont-stack pattern.test/invalid/suite vianode:test+stylelint.lint().test/utils/testRule.jshelper does a subset match against expected warnings. ~35 fixtures cover all new rules and the most important existing ones.npm test:valid(positive fixtures) andnpm test:invalid(negative fixtures) scripts;npm testruns both.
- Bumped Stylelint to
^17.11.1. Picks up bug fixes forselector-pseudo-class-no-unknown(nested::-webkit-scrollbarparts),declaration-block-no-redundant-longhand-properties(more accurate range), andfunction-url-quotes(URLs with modifiers). declaration-no-importantnow reports a warning instead of an error.selector-not-notationswitched fromsimpletocomplex— Selectors Level 4 list:not(.a, .b)is preferred over chained:not(.a):not(.b). Auto-fixable.selector-class-patterntightened to strict BEM:block__element--modifieronly, single underscore or trailing modifier are flagged. Closes #48, #122, #54.aspect-ratioordered after the full sizing block (max-block-size) instead of aftermax-height.contentmoved to the start of thedecorationgroup — natural position for::before/::aftercontent.
camelCaseSvgKeywords: trueoption fromvalue-keyword-case— caused false positives forcolor-mix(in srgb, ...)and similar modern CSS functions. SVG-like keywords now also enforced lowercase (closes #130).
- Most consumers (
extends: "stylelint-config-htmlacademy"): no action required. - Run
stylelint --fixonce:media-feature-range-notation,selector-not-notation,alpha-value-notation, and the expandedproperties-orderare auto-fixable and will reformat existing CSS. Note thatalpha-value-notation: "percentage"rewritesopacity: 0.5toopacity: 50%(valid CSS Color 4 syntax). - The new error-level rules (
declaration-block-single-line-max-declarations: 0,selector-max-compound-selectors: 2,selector-max-class: 2,selector-max-combinators: 2,selector-max-type: 2,order/order,selector-no-deprecated,selector-anb-no-unmatchable,selector-no-invalid,no-unknown-custom-media,color-function-alias-notation,lightness-notation,time-min-milliseconds,custom-media-pattern,custom-property-pattern,selector-id-pattern,selector-nested-pattern) may surface previously tolerated patterns. selector-class-patternBEM tightening: single underscore (.foo_bar) and chained modifiers (.block--mod--extra) are now flagged. Switch toblock__element--modifier.
- Updated Stylelint to 16.25.0, @stylistic plugin to 4.0.0
- Updated Stylelint to 16.10.0, @stylistic plugin to 3.1.1
- Updated Stylelint to 16.6.1
- Updated Stylelint to 16.6.0
- Updated Stylelint to 16.5.0, @stylistic plugin to 2.1.2
- Added
declaration-block-no-redundant-longhand-propertiesrule - Added
no-unknown-custom-propertiesrule
- Added
named-grid-areas-alignmentrule for grid area alignment
- Added
shorthand-property-no-redundant-valuesrule
- Added
comment-whitespace-insiderule
- Added
selector-class-patternfor lowercase class names
- Updated to Stylelint 16, migrated to
@stylistic/stylelint-plugin
- Updated to Stylelint 16, requires Node.js 18.12+
- Config format changed from
.jsto.stylelintrc(JSON) - Rules sorted alphabetically
- SCSS/LESS overrides with custom syntax support
stylelint-codeguideplugin for stylistic rulesfunction-linear-gradient-no-nonstandard-directionruleimport-notation: stringrulemax-nesting-depth: 2with pseudo-class ignore
- Added
color-hex-alpha: never,selector-not-notation: simple,annotation-no-unknown
- Initial stable release with Stylelint 14