stylelint/stylelint
60.7
Adequate · 2 October 2026
31.7k
lines of production code
JavaScript
primary language
2
measurements over time
What this system is
This system is a CSS linting tool that validates stylesheets against a comprehensive set of configurable rules covering syntax, best practices, and modern specifications. It detects issues such as unknown selectors, invalid colors, and deprecated features, while providing auto-fix capabilities for many violations. The system supports multiple input formats including CSS, Less, SCSS, and HTML, and offers various output formatters for integration into development workflows.
How it got here
2014–2016 — ESM migration and rule modernization
65 changes.
The project migrated its codebase and tooling from CommonJS to ES modules, updating the development environment and CI infrastructure. This period focused on modernizing existing lint rules by adding autofix capabilities, expanding configuration options, and fixing false positives, while introducing several new rules for selector and naming conventions.
2017–2023 — ESM migration and inclusive language
88 changes.
This period focused on migrating the core library, test infrastructure, and reference data to ES modules while introducing strict autofix defaults and TypeScript type definitions. It also involved a comprehensive renaming of rules to replace blacklist/whitelist terminology with inclusive allowed-list/disallowed-list naming conventions. Concurrently, numerous new linting rules were added to enforce modern CSS syntax, specificity limits, and color notation standards.
2024–2026 — CSS specification compliance and modernization
21 changes.
This period focused on expanding Stylelint's rule set to enforce strict adherence to current CSS specifications, introducing numerous rules to detect deprecated properties, selectors, and at-rules, as well as invalid syntax and logical errors. It also added tools to enforce consistent naming conventions for layers and containers, and to standardize the use of flow-relative versus physical layout properties. Additionally, internal performance benchmarking infrastructure was established to monitor the tool's efficiency.
Features
Add \`ignore: \["comments"\]\` option to \`block-no-empty\` rule
The \block-no-empty\ rule now supports a secondary \ignore\ option with a \"comments"\ value. When configured as \\[true, { "ignore": \["comments"\] }\]\, blocks containing only CSS comments are no longer flagged as empty, allowing developers to use comment-only blocks without triggering lint errors.
lib/rules/block-no-empty · high confidence
Add annotation-no-unknown rule to disallow unknown CSS annotations
A new rule, \annotation-no-unknown\, has been added to detect and report unknown CSS annotations (tokens starting with \!\ that are not standard like \!important\). By default, the rule flags any non-standard annotation as an error, considering only those defined in CSS Specifications (up to Editor's Drafts) as valid. Users can configure the \ignoreAnnotations\ secondary option to whitelist specific annotation names or patterns (using strings or regular expressions), allowing custom or experimental annotations to be ignored without triggering lint errors.
lib/rules/annotation-no-unknown · high confidence
Add color-hex-alpha rule to enforce alpha channel usage in hex colors
A new linting rule, \color-hex-alpha\, has been added to require or disallow the alpha channel in hexadecimal color values. Users can configure the rule with the options \always\ (flagging colors like \\#fff\ or \\#ffffff\ that lack an alpha component) or \never\ (flagging colors like \\#fffa\ or \\#ffffffaa\ that include one). The rule supports a message argument to customize error text and correctly ignores URL functions while validating hex colors within declaration values.
lib/rules/color-hex-alpha · high confidence
Add comment-no-empty rule to disallow empty comments
The \comment-no-empty\ rule has been added to the linter configuration. It flags CSS comments that contain no text (e.g., \/\* \/\ or \/\\*/\) as problems, while ignoring non-standard syntax and comments that do contain content. The rule does not support message arguments and explicitly ignores SCSS-like comments.
lib/rules/comment-no-empty · high confidence
Add comment-pattern rule to enforce comment text formats
A new \comment-pattern\ rule has been added, allowing users to specify a regular expression pattern that all CSS comments must match. When configured with a string or regex, the rule validates the text of every comment in the stylesheet, reporting a problem if a comment does not start with or match the defined pattern.
lib/rules/comment-pattern · high confidence
Add container-name-pattern rule to validate container names
A new linting rule, \container-name-pattern\, has been added to enforce naming conventions for CSS container names. Users can configure a regular expression pattern (as a string or RegExp object) to validate names specified in \@container\ at-rules and the \container-name\ and \container\ shorthand properties. The rule reports errors when container names do not match the provided pattern, supporting both string and regex configurations.
lib/rules/container-name-pattern · high confidence
Add display-notation rule to enforce CSS display value syntax
A new \display-notation\ rule has been added to enforce consistent usage of either the modern multi-keyword syntax (e.g., \inline flex\) or the legacy precomposed syntax (e.g., \inline-flex\) for the CSS \display\ property. The rule supports two modes: \full\ (requiring explicit outer and inner display types) and \short\ (requiring precomposed or default values). It automatically fixes violations by converting between notations where possible and ignores non-standard syntaxes such as SASS variables or CSS functions.
lib/rules/display-notation · high confidence
Add exceptWithoutPropertyFallback option to function-allowed-list
The function-allowed-list rule now supports a new secondary option, exceptWithoutPropertyFallback, which allows you to specify functions that are permitted if a fallback declaration for the same property exists elsewhere in the same rule block. This enables safer adoption of newer CSS functions by allowing them when a legacy fallback is present, while still flagging their use when no fallback is provided.
lib/rules/function-allowed-list · high confidence
Add ignore option for at-rule preludes and declaration values
The \string-no-newline\ rule now supports an \ignore\ secondary option, allowing users to exclude specific contexts from the newline check. You can configure \{ "ignore": \["at-rule-preludes", "declaration-values"\] }\ to permit newlines in at-rule parameters (like \@import\) and declaration values, while still enforcing the rule on selectors.
lib/rules/string-no-newline · high confidence
Add ignore: \["inside-function"\] option to declaration-property-unit-allowed-list
The declaration-property-unit-allowed-list rule now supports a secondary option \ignore: \["inside-function"\]\. When enabled, the rule will skip checking units that appear inside CSS functions (such as \hsla()\ or \linear-gradient()\), preventing false positives for color values or other functional notations that contain unit-like syntax.
lib/rules/declaration-property-unit-allowed-list · high confidence
Add ignoreFontFamilyNames option to font-family-no-duplicate-names rule
The font-family-no-duplicate-names rule now supports an optional \ignoreFontFamilyNames\ secondary option, allowing users to specify an array of font family names or regular expressions to exclude from duplicate detection. This enables configurations where specific fonts (like 'monospace') or pattern-matched names (like those starting with 'My Font ') can be repeated without triggering a lint error.
lib/rules/font-family-no-duplicate-names · high confidence
Add ignoreFunctions option and support for gray/hwb color functions in color-named rule
The color-named rule now supports an \ignoreFunctions\ secondary option, allowing users to specify an array of function names or regular expressions to exclude from validation (e.g., ignoring colors inside \var()\ or custom CSS functions). Additionally, the rule's underlying color parsing has been updated to recognize and handle the \gray()\ and \hwb()\ CSS color functions, enabling more accurate detection of named color equivalents for these syntaxes.
lib/rules/color-named · high confidence
Add ignoreFunctions option to color-no-hex rule
The color-no-hex rule now supports an optional \ignoreFunctions\ secondary option, allowing users to specify an array of function names or regular expressions to exclude from the hex color check. This enables patterns like \var(--foo, \#fff)\ or custom CSS functions to contain hex values without triggering a lint error, providing finer control over when the rule applies.
lib/rules/color-no-hex, lib/rules/unit-allowed-list · high confidence
Add ignoreFunctions option to unit-disallowed-list
The \unit-disallowed-list\ rule now supports an \ignoreFunctions\ secondary option, allowing users to specify functions whose unit values should be ignored during linting. This provides finer control over which CSS functions are exempt from the disallowed unit check, complementing the existing \ignoreProperties\ and \ignoreMediaFeatureNames\ options.
lib/rules/unit-disallowed-list · high confidence
Add ignoreRules and ignorePseudoClasses options to max-nesting-depth
The max-nesting-depth rule now supports two new secondary options: \ignoreRules\ and \ignorePseudoClasses\. \ignoreRules\ allows you to specify regular expressions or strings to exclude specific selectors from nesting depth calculations, while \ignorePseudoClasses\ lets you ignore rules where the selector matches specific pseudo-classes. This provides finer control over which nested structures count towards the maximum depth limit.
lib/rules/max-nesting-depth · high confidence
Add ignoreTypes option and autofix to selector-type-case rule
The selector-type-case rule now supports an ignoreTypes secondary option, allowing users to specify an array of type selector names or regular expressions to exclude from case enforcement. Additionally, the rule is now fixable, enabling automatic correction of type selector casing to match the configured 'lower' or 'upper' primary option.
lib/rules/selector-type-case · high confidence
Add layer-name-pattern rule to validate CSS @layer names
A new rule, \layer-name-pattern\, has been added to enforce naming conventions on CSS \@layer\ declarations and \@import ... layer()\ functions. Users can configure a regular expression or a specific string to validate layer names against; any layer name that does not match the provided pattern will trigger a warning, helping maintain consistent naming schemes across stylesheets.
lib/rules/layer-name-pattern · high confidence
Add lightness-notation rule for oklch, oklab, lch, and lab colors
A new rule, \lightness-notation\, has been added to enforce consistent lightness notation in \oklch\, \oklab\, \lch\, and \lab\ color functions. It supports two modes: \percentage\ (e.g., \85%\) and \number\ (e.g., \0.85\), and includes an autofix to automatically convert lightness values to the configured format. The rule also handles relative color syntax (e.g., \oklch(from red ...)\).
lib/rules/lightness-notation · high confidence
Add media-type-no-deprecated rule
A new lint rule, \media-type-no-deprecated\, has been added to detect and report the use of deprecated CSS media types (such as \aural\, \braille\, \embossed\, \handheld\, \projection\, \speech\, \tty\, and \tv\) in \@media\ queries. The rule flags these types as invalid according to the CSS media queries specification, recommending modern alternatives like \all\, \screen\, and \print\. Users can configure the rule to ignore specific media types using the \ignoreMediaTypes\ secondary option, which accepts strings or regular expressions.
(repo-wide) · high confidence
Add new ESM entry point for the CLI
A new executable file \bin/stylelint.mjs\ has been added to the project. This file serves as the entry point for the command-line interface, importing the existing CLI logic from \lib/cli.mjs\ and passing the command-line arguments to it.
bin · high confidence
Add no-empty-source rule to disallow empty CSS sources
The new \no-empty-source\ rule flags CSS files or strings that contain only whitespace, newlines, or comments. It considers a source non-empty if it has any notable child nodes (rules, declarations, etc.) or if it contains trailing whitespace in non-standard syntaxes like JSX. This helps enforce that source files contain actual style definitions rather than being effectively blank.
lib/rules/no-empty-source · high confidence
Add property-no-deprecated rule to flag obsolete CSS properties
A new \property-no-deprecated\ rule has been added to detect and report CSS properties that have been removed or deprecated in modern specifications. The rule flags properties such as \clip\, \word-wrap\, and legacy vendor-prefixed box model properties (e.g., \-webkit-box-flex\), offering automatic fixes for many cases by mapping them to their modern equivalents (e.g., \word-wrap\ to \overflow-wrap\, \page-break-before\ to \break-before\). It includes special handling to avoid false positives for \-webkit-box-orient: vertical\ and supports an \ignoreProperties\ option to exclude specific properties or patterns from the check.
lib/rules/property-no-deprecated · high confidence
Add regex support to ignorePseudoElements option
The selector-pseudo-element-no-unknown rule now accepts regular expressions in its ignorePseudoElements secondary option, allowing users to ignore pseudo-elements using pattern matching (e.g., /^--my-/) in addition to exact string matches.
lib/rules/selector-pseudo-element-no-unknown · high confidence
Add rule to enforce generic font family keywords
The new \font-family-no-missing-generic-family-keyword\ rule disallows \font\ and \font-family\ declarations that lack a generic family keyword (such as \sans-serif\ or \serif\) as a fallback. It correctly ignores CSS variables, system font keywords, and specific at-rules like \@font-face\ and \@font-palette-values\. Users can configure the \ignoreFontFamilies\ secondary option to exclude specific font names from this check.
lib/rules/font-family-no-missing-generic-family-keyword · high confidence
Add rule-selector-property-disallowed-list rule
A new linting rule, \rule-selector-property-disallowed-list\, is introduced to specify a list of disallowed CSS properties for specific selectors. Users can configure the rule with an object mapping selectors (including regex patterns) to arrays of disallowed properties. The rule includes an optional \ignore\ secondary option that allows excluding \keyframe-selectors\ from validation, preventing false positives in \@keyframes\ blocks. The implementation is provided as an ES module (\index.mjs\) and includes full documentation in \README.md\.
(repo-wide) · high confidence
Add selector-id-pattern rule to enforce ID selector naming conventions
A new rule, selector-id-pattern, has been added to allow users to specify a regular expression pattern that ID selectors must match. The rule accepts a string or regex as its primary option, checking the value following the '\#' symbol in CSS selectors. When a selector does not match the configured pattern, it reports a violation with the specific selector and pattern involved, helping teams enforce consistent ID naming standards across their stylesheets.
lib/rules/selector-id-pattern · high confidence
Add selector-max-id rule with context functional pseudo-class support
The \selector-max-id\ rule is now available to limit the number of ID selectors in a CSS selector. It includes a secondary option, \ignoreContextFunctionalPseudoClasses\, which allows users to specify functional pseudo-classes (such as \:not\ or \:has\) where ID selectors should be ignored during the count, providing more granular control over specificity checks in modern CSS contexts.
lib/rules/selector-max-id · high confidence
Add selector-no-invalid rule to detect invalid CSS selectors
A new linting rule, \selector-no-invalid\, has been added to disallow CSS selectors that violate the CSS specification. When enabled, the rule flags syntax errors (such as stray parentheses or leading commas), invalid pseudo-class arguments (like \:dir(foo)\ instead of \:dir(ltr)\), and structural violations (such as using pseudo-elements inside \:not()\ or combinators inside \:host()\). This helps catch malformed selectors early in the development process.
lib/rules/selector-no-invalid · high confidence
Add selector-pseudo-element-colon-notation rule with autofix support
The \selector-pseudo-element-colon-notation\ rule is now available to enforce consistent single (\:\) or double (\::\) colon notation for CSS pseudo-elements. Users can configure the rule to require either notation, and it includes an autofix capability that automatically corrects violations in the code.
lib/rules/selector-pseudo-element-colon-notation · high confidence
Add splitList option to selector-nested-pattern rule
The selector-nested-pattern rule now supports a secondary \splitList\ option. When enabled, the rule validates each selector in a list individually rather than checking the entire list as a single string, allowing configurations that permit mixed selectors (e.g., \&:hover\ and \&:focus\) in a single rule block.
lib/rules/selector-nested-pattern · high confidence
Autofix support added to color-hex-length rule
The \color-hex-length\ rule now automatically fixes hex color notation issues when the \fix\ option is enabled. Users can configure the rule to enforce either short (e.g., \\#fff\) or long (e.g., \\#ffffff\) hex notation, and the linter will now transform colors to match the specified format automatically.
lib/rules/color-hex-length · high confidence
Automated changelog generation with custom formatting and sorting
The project now uses Changesets to automatically generate the CHANGELOG.md. A custom changelog script (changelog-stylelint.mjs) formats entries with specific prefixes (Removed, Changed, Added, Deprecated, Fixed, Security) and appends PR and author links. A rewrite script (rewrite-changelog.mjs) ensures the changelog maintains a historical format, sorting entries by prefix and including release dates.
.changeset · high confidence
Document media-feature-name-no-unknown rule and implement ESM module
The \media-feature-name-no-unknown\ rule is now available as an ES module (\index.mjs\) with full documentation in \README.md\. The rule disallows unknown media feature names, supports vendor prefixes, and allows users to ignore specific names via the \ignoreMediaFeatureNames\ secondary option, which accepts both strings and regular expressions.
lib/rules/media-feature-name-no-unknown · high confidence
Initial TypeScript type definitions for Stylelint
This change introduces the \types/stylelint/index.d.ts\ file, providing the first official TypeScript definitions for the Stylelint library. It defines core configuration structures (such as \Config\, \ConfigRules\, and \ConfigOverride\), API interfaces (like \LinterOptions\, \LintResult\, and \LinterResult\), and rule-related types (\Rule\, \RuleMeta\, \Warning\). The accompanying \type-test.ts\ file validates these definitions against common usage patterns, including linting code, resolving configuration, and creating custom rules, ensuring type safety for users integrating Stylelint into TypeScript projects.
types · high confidence
Initial implementation of selector-class-pattern rule
This change introduces the \selector-class-pattern\ rule, which allows users to enforce a specific naming convention for CSS class selectors via a regular expression. The rule checks the class name portion of selectors (excluding the leading dot) against the provided pattern and reports violations, including precise source locations for the offending class. It also handles escaped selectors by accounting for double-escaping in the regex match.
lib/rules/selector-class-pattern · high confidence
Introduce at-rule-allowed-list rule with consistent vendor prefix and case handling
The \at-rule-allowed-list\ rule is now available to specify a list of allowed at-rules, replacing the deprecated \at-rule-whitelist\. This implementation ensures consistent behavior for vendor prefixes (e.g., \-webkit-\, \-moz-\) and case sensitivity, allowing patterns like \/^(-webkit-\|-moz-)?keyframes$/i\ to match \@keyframes\, \@KEYFRAMES\, and \@-moz-keyframes\. The rule explicitly ignores \@charset\ and supports a \message\ argument to report the specific disallowed at-rule.
lib/rules/at-rule-allowed-list · high confidence
Introduce disallowed-list rules for property-unit and property-value pairs
Adds the \declaration-property-unit-disallowed-list\ and \declaration-property-value-disallowed-list\ rules, allowing users to specify disallowed unit or value pairs for specific CSS properties. These rules support object-based configuration where keys can be property names or regular expressions, enabling precise control over which declarations trigger warnings.
lib/rules/declaration-property-unit-disallowed-list · high confidence
Introduce rule-empty-line-before for CSS rule spacing
A new linting rule, \rule-empty-line-before\, has been added to enforce or disallow empty lines before CSS rules. The rule supports primary options \always\, \never\, \always-multi-line\, and \never-multi-line\ to control spacing behavior. It includes secondary options to ignore specific contexts (such as \first-nested\ or \inside-block\) and to except certain conditions (like \after-rule\ or \inside-block\) from the primary expectation. The rule is automatically fixable, allowing users to resolve violations with a single click.
lib/rules/rule-empty-line-before · high confidence
Introduce selector-pseudo-element-disallowed-list rule
A new rule, selector-pseudo-element-disallowed-list, is now available to specify a list of disallowed pseudo-element selectors. It accepts an array of strings or regular expressions to match against pseudo-element names (e.g., 'before' or '/^--my-/i'). The rule ignores CSS2 single-colon pseudo-elements and selectors with variable interpolation, and reports violations with precise source ranges for the matched pseudo-element.
(repo-wide) · high confidence
New alpha-value-notation rule enforces consistent alpha value formatting
The new \alpha-value-notation\ rule allows you to enforce whether alpha values in CSS use number notation (e.g., \0.5\) or percentage notation (e.g., \50%\). It automatically fixes violations and supports an \exceptProperties\ option to exclude specific properties like \opacity\ from the rule's enforcement.
lib/rules/alpha-value-notation · high confidence
New at-rule-prelude-no-invalid rule
A new rule, \at-rule-prelude-no-invalid\, has been added to disallow invalid preludes for at-rules by validating them against the CSSTree syntax reference. When enabled, it flags issues such as missing leading \--\ for custom properties in \@property\ or \@font-palette-values\, or incorrect syntax in \@layer\ and \@scope\. The rule includes an \ignoreAtRules\ secondary option to exclude specific at-rules from validation.
lib/rules/at-rule-prelude-no-invalid · high confidence
New import-notation rule enforces consistent @import syntax
A new rule, \import-notation\, has been added to allow users to enforce a specific notation style for \@import\ rules. Configured with either \"string"\ or \"url"\, it ensures that imports consistently use either bare string values (e.g., \@import 'foo.css'\) or URL function syntax (e.g., \@import url('foo.css')\). The rule is automatically fixable, meaning it can correct non-compliant imports to match the configured style.
lib/rules/import-notation · high confidence
New internal performance benchmarking suite
Added a comprehensive internal benchmarking tool under \scripts/benchmarking/\ to measure and compare Stylelint's performance. The suite generates synthetic workspaces of varying complexity (small, medium, large, x-large) with custom rules, plugins, and syntaxes, then runs benchmarks against both the Stylelint API and CLI to track duration, memory usage, and errors. It includes a dedicated script (\run-rule.mjs\) for benchmarking individual rules using the \tinybench\ library, and provides reporters to generate detailed text or JSON summaries, including the ability to save and compare results against baselines.
scripts · high confidence
New rule to detect missing var() for custom properties
The \custom-property-no-missing-var-function\ rule has been added to identify CSS custom properties that are used without the required \var()\ function wrapper. The rule scans for dashed identifiers (e.g., \--foo\) in declaration values and reports them if they are not wrapped in \var()\. It intelligently ignores properties that accept author-defined identifiers (such as \animation-name\, \grid-column\, or \view-transition-name\) and correctly handles complex values involving functions like \running()\, \anchor()\, \anchor-size()\, and \style()\ queries, ensuring that only actual missing references are flagged.
lib/rules/custom-property-no-missing-var-function · high confidence
New rule to detect unknown at-rule descriptors
The \at-rule-descriptor-no-unknown\ rule has been added to disallow unknown descriptors within at-rules (such as \@counter-style\ or \@property\). It validates descriptors against the CSSTree syntax reference and CSS Editor's Drafts, while correctly handling specific contexts like page and margin properties in \@page\ rules and feature-value blocks. Users can extend the known descriptors using the \languageOptions\ configuration property.
lib/rules/at-rule-descriptor-no-unknown · high confidence
New rule to detect unmatchable CSS selectors
Added the \selector-no-unmatchable\ rule, which flags CSS selectors that are syntactically valid but can never match any element in the DOM. The rule identifies issues such as pairing pseudo-classes with incompatible elements (e.g., \label:checked\), combining pseudo-elements with tree-structural pseudo-classes (e.g., \::before:first-child\), placing pseudo-elements inside \:is()\ or \:where()\, and using the nesting selector (\&\) in contexts where it cannot represent a pseudo-element ancestor. It also detects invalid shadow DOM selector patterns like \a :host\. This helps users catch logical errors in their stylesheets that result in rules having no effect.
lib/rules/selector-no-unmatchable · high confidence
New rule to disallow deprecated CSS at-rules
A new rule, \at-rule-no-deprecated\, has been added to flag at-rules that were removed or deprecated in CSS specifications (such as \@viewport\ and \@apply\). The rule automatically fixes the deprecated \@nest\ at-rule by converting it to a standard style rule. Users can configure the rule to ignore specific at-rules using the \ignoreAtRules\ secondary option.
lib/rules/at-rule-no-deprecated · high confidence
New rule to disallow deprecated CSS keywords
Added the \declaration-property-value-keyword-no-deprecated\ rule, which flags CSS property-value pairs that use keywords removed or deprecated in CSS specifications (such as \overflow: overlay\, \text-decoration: blink\, and legacy system color names like \ThreeDDarkShadow\). The rule supports an \ignoreKeywords\ option to exclude specific values and provides automatic fixes for certain deprecated keywords by replacing them with their modern equivalents.
lib/rules/declaration-property-value-keyword-no-deprecated · high confidence
New rule to disallow duplicate custom properties in declaration blocks
A new rule, \declaration-block-no-duplicate-custom-properties\, has been added to detect and report duplicate CSS custom properties (variables) within the same declaration block. By default, it flags any repeated custom property name as an error. Users can configure an \ignoreProperties\ secondary option to specify an array of property names or regular expressions that should be excluded from this check, allowing for intentional overrides or specific use cases.
lib/rules/declaration-block-no-duplicate-custom-properties · high confidence
New rule to disallow invalid declaration positions
Added the \no-invalid-position-declaration\ rule, which flags CSS declarations that appear in invalid locations (such as at the root level or inside certain at-rules without a selector context). The rule includes an optional \ignoreAtRules\ secondary option to exclude specific at-rules from validation, and correctly handles modern nesting syntax and embedded styles.
lib/rules/no-invalid-position-declaration · high confidence
New rule to disallow invalid syntax strings in @property at-rules
A new rule, \syntax-string-no-invalid\, has been added to flag unsupported or invalid syntax definitions within CSS \@property\ at-rules. The rule validates the \syntax\ descriptor against the CSS Properties & Values API specification, rejecting unknown type names (like \\<foo\>\), disallowed types (like \\<alpha-value\>\), and invalid combinators (like \\|\|\ or \\*\). It accepts valid syntax components, keywords, and standard combinators like \\|\, \+\, and \\#\.
lib/rules/syntax-string-no-invalid · high confidence
New rule to disallow unknown CSS functions
The \function-no-unknown\ rule has been added to detect and report the use of CSS functions that are not defined in the CSS specifications. It flags non-standard function calls (e.g., \unknown()\) while ignoring custom functions (those starting with \--\) and standard functions. Users can configure an \ignoreFunctions\ option to whitelist specific function names or regular expressions, allowing for custom or preprocessor-specific functions to be excluded from validation.
lib/rules/function-no-unknown · high confidence
New rule to disallow unknown media feature values
The \media-feature-name-value-no-unknown\ rule has been added to detect and flag invalid values used within CSS media features (e.g., \@media (color: red)\). It validates media feature values against CSS specifications, supporting an \ignoreMediaFeatureNameValues\ option to whitelist specific name-value pairs or use regex patterns for media feature names. This helps users catch typos or unsupported values in their media queries.
lib/rules/media-feature-name-value-no-unknown · high confidence
New rule to disallow unknown values for at-rule descriptors
Added the \at-rule-descriptor-value-no-unknown\ rule, which flags unknown values used within at-rule descriptors (e.g., \system: unknown\ in \@counter-style\ or \syntax: unknown\ in \@property\). The rule leverages the CSSTree lexer to validate descriptor values against CSS specifications and supports extending known syntax via the \languageOptions\ configuration property. It includes documentation on overlapping rules and message arguments.
lib/rules/at-rule-descriptor-value-no-unknown · high confidence
New rule to disallow unmatchable An+B selectors
A new rule, \selector-anb-no-unmatchable\, has been added to detect and report CSS An+B selectors that will never match any elements, such as \nth-child(0)\ or \nth-of-type(0n+0)\. This rule flags selectors where both the 'a' and 'b' components evaluate to zero, which is invalid because CSS pseudo-class selectors are one-indexed. Users can enable this rule to catch these logical errors in their stylesheets.
lib/rules/selector-anb-no-unmatchable · high confidence
New rule to enforce keyword or percentage notation in keyframe selectors
A new \keyframe-selector-notation\ rule has been added to allow users to enforce consistent notation for keyframe selectors. The rule supports three options: \keyword\ (requires \from\/\to\), \percentage\ (requires \0%\/\100%\), and \percentage-unless-within-keyword-only-block\ (requires percentages unless all selectors in the block are keywords). The rule is fixable, automatically converting selectors to the expected format.
lib/rules/keyframe-selector-notation · high confidence
New rule to enforce media feature range notation
The \media-feature-range-notation\ rule is now available to enforce consistent syntax for media feature ranges, allowing users to require either modern context notation (e.g., \width \>= 600px\) or traditional prefix notation (e.g., \min-width: 600px\). The rule includes an \except: \["exact-value"\]\ option to handle exact value comparisons differently, and provides an autofix capability to automatically convert between the two notations.
lib/rules/media-feature-range-notation · high confidence
New rule to enforce scoping roots for CSS nesting selectors
Added the \nesting-selector-no-missing-scoping-root\ rule, which disallows CSS nesting selectors (\&\) when they are used at the top level or within at-rules (like \@media\ or \@scope\) without a valid parent scoping root. This helps prevent unexpected behavior in CSS structures. The rule includes an optional \ignoreAtRules\ secondary option to exclude specific at-rules from this check.
lib/rules/nesting-selector-no-missing-scoping-root · high confidence
New rule to validate media query syntax
The new \media-query-no-invalid\ rule disallows media queries that are not grammatically valid according to the Media Queries Level 5 specification. It detects issues such as incorrect use of \min-\/\max-\ prefixes in range or boolean contexts, improper placement of custom media queries, and general parsing failures. The rule includes an \ignoreFunctions\ secondary option, allowing users to exclude specific functions (e.g., \theme()\, \get-default-width()\) from validation.
lib/rules/media-query-no-invalid · high confidence
New rule: value-keyword-layout-mappings
A new lint rule, \value-keyword-layout-mappings\, has been added to enforce the use of either physical (e.g., \left\, \top\) or flow-relative (e.g., \inline-start\, \block-start\) keywords in CSS layout properties. The rule supports two modes: \flow-relative\ (defaulting to flagging physical keywords) and \physical\ (flagging flow-relative keywords). It includes automatic fixing capabilities when the \languageOptions.directionality\ configuration is provided, allowing users to seamlessly convert between physical and logical values based on their writing direction. Secondary options allow ignoring specific properties or keywords.
lib/rules/value-keyword-layout-mappings · high confidence
New rules for enforcing flow-relative or physical property and unit mappings
Added the \property-layout-mappings\ and \unit-layout-mappings\ rules, which allow you to enforce the use of either flow-relative (logical) or physical CSS properties and units. Configured with \"flow-relative"\ or \"physical"\, these rules flag mismatches (e.g., using \margin-left\ instead of \margin-inline-start\ or \vw\ instead of \vi\). When set to \"flow-relative"\ and paired with the \languageOptions.directionality\ configuration, the rules support automatic fixing to convert physical properties/units to their logical equivalents based on the specified block and inline directions.
lib/rules/property-layout-mappings · high confidence
New selector-max-universal rule with ignoreAfterCombinators support
The new selector-max-universal rule allows you to limit the number of universal selectors (\*) in a CSS selector. It includes an optional secondary option, ignoreAfterCombinators, which lets you specify combinators (like \> or +) after which universal selectors should be ignored, providing more granular control over selector complexity checks.
lib/rules/selector-max-universal · high confidence
New selector-no-deprecated rule to flag and fix obsolete CSS selectors
A new lint rule, \selector-no-deprecated\, has been added to detect and automatically fix deprecated CSS selectors. The rule identifies obsolete pseudo-classes (such as \:focus-ring\, \:matches\, and \:top-layer\) and pseudo-elements (such as \::content\ and \::shadow\), replacing them with their modern equivalents (e.g., \:focus-visible\, \:is\, \::slotted\) where possible. It also flags deprecated HTML type selectors (like \popup\) and SVG type selectors. Users can configure the rule to ignore specific selectors via the \ignoreSelectors\ option.
lib/rules/selector-no-deprecated · high confidence
font-weight-notation rule now supports autofix and relative keyword ignoring
The \font-weight-notation\ rule now automatically fixes violations by converting between numeric values (400/700) and their named equivalents (normal/bold) when using the \numeric\ or \named-where-possible\ options. Additionally, a new \ignore: \["relative"\]\ secondary option allows users to exclude the relative keywords \bolder\ and \lighter\ from validation, preventing false positives in contexts where these relative weights are valid.
lib/rules/font-weight-notation · high confidence
no-duplicate-selectors rule gains ignoreSelectors option
The no-duplicate-selectors rule now supports an ignoreSelectors secondary option, allowing users to specify an array of selector strings or regular expressions to exclude from duplicate detection. This enables more flexible linting configurations where certain selectors (e.g., utility classes or framework-specific patterns) can be permitted to repeat without triggering rule violations.
lib/rules/no-duplicate-selectors · high confidence
Behavioural changes
29 commits (4 fixes) modifying lib/rules/length-zero-no-unit
A change to existing behaviour in lib/rules/length-zero-no-unit — 29 commits (4 fixs), 2 files.
lib/rules/length-zero-no-unit · medium confidence · unverified
Add \`except: \["after-block"\]\` option to \`declaration-empty-line-before\` rule
The \declaration-empty-line-before\ rule now supports an \except: \["after-block"\]\ secondary option. When configured, this allows declarations that immediately follow a CSS block (such as a nested rule or at-rule) to bypass the primary \always\ or \never\ empty-line requirement, providing finer control over spacing in nested structures.
lib/rules/declaration-empty-line-before · high confidence
Add autofix support to function-calc-no-unspaced-operator
The \function-calc-no-unspaced-operator\ rule now automatically fixes violations by inserting the required single whitespace around \+\ and \-\ operators within CSS math functions like \calc()\, \min()\, and \max()\. This change also extends the rule's coverage to include other math functions beyond just \calc()\ and improves the handling of unspaced operators following multiplication or division, reducing false negatives in complex expressions.
lib/rules/function-calc-no-unspaced-operator · high confidence
Add ignoreMediaFeatureNames option to media-feature-name-no-vendor-prefix rule
The \media-feature-name-no-vendor-prefix\ rule now supports an \ignoreMediaFeatureNames\ secondary option, allowing users to specify an array of strings or regular expressions to exclude specific vendor-prefixed media feature names from being flagged. This enables more granular control over which prefixes are considered violations, complementing the existing autofix capability that removes standard vendor prefixes like \-webkit-\, \-moz-\, and \-o-\.
lib/rules/media-feature-name-no-vendor-prefix · high confidence
Add regex support to ignoreSelectors option in selector-no-vendor-prefix
The \selector-no-vendor-prefix\ rule now accepts regular expressions in its \ignoreSelectors\ secondary option, allowing users to ignore vendor-prefixed selectors using pattern matching in addition to exact string matches. The rule implementation has been migrated to ESM and utilizes the \fix\ callback for autofixing, while the \autoprefixer\ dependency has been removed in favor of internal utility functions for handling prefix removal.
lib/rules/selector-no-vendor-prefix · high confidence
Add support for @page rules in selector-pseudo-class-disallowed-list
The \selector-pseudo-class-disallowed-list\ rule now checks for disallowed pseudo-classes within \@page\ at-rules, in addition to standard CSS rules. This ensures that style violations inside page selectors are reported consistently with other selector contexts.
lib/rules/selector-pseudo-class-disallowed-list · high confidence
Autofix support added to selector-attribute-quotes rule
The selector-attribute-quotes rule now automatically fixes violations by adding or removing quotes around attribute values when the fix option is enabled. This change also introduces a message argument that allows the specific attribute value to be included in the reported error message, improving clarity for users.
lib/rules/selector-attribute-quotes · high confidence
Autofix support for comment-whitespace-inside rule
The \comment-whitespace-inside\ rule now automatically fixes violations when the \fix\ option is enabled. It corrects missing or extra whitespace inside CSS comment markers (\/\\ and \\/\) according to the configured \always\ or \never\ setting, handling both standard comments and those with leading/trailing asterisks.
lib/rules/comment-whitespace-inside · high confidence
Document at-rule-property-required-list and clarify property vs. descriptor terminology
The \at-rule-property-required-list\ rule now includes official documentation explaining that it validates required properties or descriptors for at-rules, and the rule's message has been updated to accurately refer to "property or descriptor" rather than just "property". This change clarifies the rule's behavior for users configuring requirements for at-rules like \@font-face\.
lib/rules/at-rule-property-required-list · high confidence
Expanded ignore and except options for custom-property-empty-line-before
The \custom-property-empty-line-before\ rule now supports additional configuration options to fine-tune when empty lines are required before CSS custom properties. Users can use the new \ignore\ options \after-custom-property\, \first-nested\, and \inside-single-line-block\ to skip validation in specific contexts. Additionally, the \except\ option now supports \after-custom-property\ and \first-nested\, allowing users to reverse the primary rule's expectation for these cases. The rule also includes an \ignore\ option for \after-comment\ and \except\ options for \after-block\ and \after-comment\, providing more granular control over formatting.
lib/rules/custom-property-empty-line-before · high confidence
Expanded support for logical properties and new CSS shorthands in shorthand-property-no-redundant-values
The \shorthand-property-no-redundant-values\ rule now detects redundant values in logical properties (\inset\, \inset-block\, \inset-inline\, \scroll-margin\, \scroll-margin-block\, \scroll-margin-inline\, \scroll-padding\, \scroll-padding-block\, \scroll-padding-inline\) and additional shorthands (\overflow\, \overscroll-behavior\). It also supports the \ignore: \["four-into-three-edge-values"\]\ option to suppress warnings for four-value edge shorthands that could be condensed to three, and includes fixes for false negatives involving CSS functions and border-radius slash syntax.
lib/rules/shorthand-property-no-redundant-values · high confidence
Fix false positives for @layer and add ignoreAtRules option
The no-invalid-position-at-import-rule now correctly handles @layer at-rules, preventing false positives when @import follows @layer declarations. Additionally, a new ignoreAtRules secondary option allows users to specify at-rules that should be ignored when determining the validity of @import positioning.
lib/rules/no-invalid-position-at-import-rule · high confidence
Fix reported ranges for invalid double-slash comments
The \no-invalid-double-slash-comments\ rule now accurately reports the start and end positions of invalid double-slash comments in CSS selectors, ensuring that the highlighted error ranges in your editor or CLI output precisely match the problematic code segments.
lib/rules/no-invalid-double-slash-comments · high confidence
Formatter module migration to ESM and output enhancements
The formatter modules in \lib/formatters\ have been migrated to native ESM (\.mjs\), with the index now using dynamic imports to load formatters on demand. The \verbose\ formatter now includes a dedicated section tallying problems that were automatically fixed, and the \string\ formatter displays a count of fixable problems. Additionally, the \tap\ formatter has been updated to support the TAP14 specification, and the \json\ formatter now omits internal properties (those starting with \\_\) from its output.
lib/formatters · high confidence
Git pre-commit hook now uses npx lint-staged
The pre-commit hook has been updated to execute lint-staged via npx, replacing the previous implementation. This change ensures that code linting and formatting checks run automatically before each commit, leveraging the npx command to invoke the tool without requiring a global installation.
.githooks · high confidence
Improved accuracy and autofix for the function-url-quotes rule
The function-url-quotes rule now uses a CSS tokenizer to accurately determine whether a URL requires quotes, preventing false positives for URLs with special characters or modifiers. It also provides an autofix that correctly handles multiple url() functions and ensures quotes are added or removed as configured.
lib/rules/function-url-quotes · high confidence
Improved accuracy for selector-max-compound-selectors reporting and ignoreSelectors
The selector-max-compound-selectors rule now correctly reports the start and end positions of violations, ensuring the highlighted code in your editor matches the actual offending selector. Additionally, the ignoreSelectors option has been refined to properly handle class selectors, preventing false positives when ignoring specific patterns like Vue's ::v-deep or Angular's ::ng-deep.
lib/rules/selector-max-compound-selectors · high confidence
Improved accuracy for webkit-scrollbar pseudo-classes and regex-based ignore patterns
The \selector-pseudo-class-no-unknown\ rule now correctly handles nested \::webkit-scrollbar\ parts, preventing false positives for standard pseudo-classes used within those specific contexts. Additionally, the \ignorePseudoClasses\ option now supports regular expressions, allowing users to ignore pseudo-classes using pattern matching (e.g., \/^--my-/\) in addition to exact string matches.
lib/rules/selector-pseudo-class-no-unknown · high confidence
Improved detection and autofix for CSS shorthand properties
The \declaration-block-no-redundant-longhand-properties\ rule now correctly identifies redundant longhand properties for a wider range of CSS shorthands, including \font-variant\, \font-synthesis\, \inset\, \overflow\, \overscroll-behavior\, \scroll-margin\, \scroll-padding\, and various Box Alignment properties. It also fixes false negatives where longhand properties appeared after a shorthand, and resolves issues with autofixing \background\ (specifically with \background-size\), \font\, \grid-column\, and \grid-row\. Additionally, the rule now properly handles CSS-wide keywords like \inherit\ and \!important\ to avoid false positives.
lib/rules/declaration-block-no-redundant-longhand-properties · high confidence
Improved duplicate property detection and autofix for the declaration-block-no-duplicate-properties rule
The \declaration-block-no-duplicate-properties\ rule now correctly handles named colors with different syntaxes (e.g., \red\ vs \\#ff0000\) and interleaved non-consecutive duplicates when using the \ignore\ options. It also provides an automatic fix to remove duplicate properties, and supports a functional \message\ secondary option for customizable error reporting.
lib/rules/declaration-block-no-duplicate-properties · high confidence
Improved handling of CSS nesting and modern pseudo-classes in selector-max-type
The selector-max-type rule now correctly evaluates functional pseudo-classes (such as :not() and :is()) and resolves nested selectors according to modern CSS standards, rather than processing them separately or in a nonstandard way as it did in versions prior to 17.0.0. This change ensures that type selector counts are accurate in the presence of CSS nesting and complex selector structures, preventing false positives or negatives that arose from the previous parsing logic.
lib/rules/selector-max-type · high confidence
Improved validation of CSS math functions and custom properties in declaration-property-value-no-unknown
The \declaration-property-value-no-unknown\ rule now correctly handles CSS math functions (such as \calc()\, \min()\, \max()\, and \clamp()\) and typed custom properties defined via \@property\. It integrates \@csstools/css-calc\ and \@csstools/css-tokenizer\ to parse and validate complex expressions, preventing false positives for valid math syntax and ensuring that custom properties with defined syntaxes are validated against their specific constraints. Additionally, the rule now supports a cache for valid matches to improve performance and deprecates the \propertiesSyntax\ and \typesSyntax\ options in favor of the shared \languageOptions\ configuration.
lib/rules/declaration-property-value-no-unknown · high confidence
Migrate color-no-invalid-hex rule to ESM and add message argument support
The color-no-invalid-hex rule has been migrated to an ES module (index.mjs) and now supports a functional message secondary option, allowing users to customize the error message text via a message argument. The rule implementation uses type guards and node field index utilities for validation, and the documentation has been updated to reflect the new message argument capability.
lib/rules/color-no-invalid-hex · high confidence
Migrate lib/utils to ESM and introduce MemoryCache
The utility modules in lib/utils have been migrated from CommonJS to ES modules (ESM), including the addition of a new MemoryCache utility for in-memory caching with TTL and size limits, alongside comprehensive test coverage for the new and refactored utilities.
lib/utils · high confidence
Migrate selector-combinator-allowed-list rule to ESM and update naming
The selector-combinator-allowed-list rule implementation has been migrated to ES modules (index.mjs) and now uses the standardized 'allowed-list' naming convention, replacing the legacy 'whitelist' terminology. The rule logic remains consistent, validating CSS combinators against a provided list and reporting disallowed ones with improved message argument support.
lib/rules/selector-combinator-allowed-list · high confidence
Modernize development environment and remove legacy tooling
The project has removed legacy configuration files and CI services, replacing them with modern equivalents. JSCS and Travis CI/AppVeyor configurations have been deleted in favor of ESLint (via eslint.config.mjs) and GitHub Actions. The TypeScript configuration (tsconfig.json) has been updated to target ES2023 and enable strict type-checking options like noUncheckedIndexedAccess. Additionally, the CommonJS entry point (index.js) has been removed, and the project now relies on ESM modules, with Jest setup files updated to import from the new module structure.
(repo-wide) · high confidence
Refactor named-grid-areas validation utility to ESM
The utility function for detecting non-contiguous or non-rectangular named grid areas has been converted from CommonJS to ES Modules (ESM). This change updates the internal implementation and its associated test suite to use ESM import/export syntax, ensuring consistency with the project's module system while preserving the existing validation logic for CSS Grid named areas.
lib/rules/named-grid-areas-no-invalid/utils · high confidence
Refactored font-family-name-quotes rule to use fix callback and resolve false negatives
The \font-family-name-quotes\ rule has been refactored to use a dedicated \fix\ callback instead of \context.fix\, which resolves previous false negatives where the linter failed to report or fix certain violations. The implementation now correctly handles the \always-unless-keyword\, \always-where-required\, and \always-where-recommended\ options by accurately detecting when quotes are required or recommended for font family names, while properly ignoring CSS variables and system font keywords.
lib/rules/font-family-name-quotes · high confidence
Rename URL scheme rules to use allowed-list/disallowed-list naming
The \function-url-scheme-whitelist\ and \function-url-scheme-blacklist\ rules have been renamed to \function-url-scheme-allowed-list\ and \function-url-scheme-disallowed-list\ respectively. This change updates the rule names and their corresponding documentation files to use inclusive terminology, while the underlying logic for validating URL schemes in CSS \url()\ functions remains the same.
lib/rules/function-url-scheme-allowed-list, lib/rules/function-url-scheme-disallowed-list · high confidence
Rename media-feature-name-value-allowed-list rule to replace deprecated naming
The rule previously known as media-feature-name-value-blacklist (or similar deprecated \-blacklist/\-whitelist variants) has been renamed to media-feature-name-value-allowed-list. This change aligns with the project's broader effort to deprecate blacklist/whitelist terminology in favor of inclusive language. The rule's functionality remains the same: it allows users to specify a list of allowed media feature name and value pairs, rejecting any values not explicitly permitted for a given feature name.
lib/rules/media-feature-name-value-allowed-list · high confidence
Rename selector-attribute-operator-allowed-list rule
The rule previously known as selector-attribute-operator-whitelist has been renamed to selector-attribute-operator-allowed-list to align with inclusive language standards. The functionality remains the same: it specifies a list of allowed attribute operators (e.g., =, \|=) and reports errors for disallowed ones.
lib/rules/selector-attribute-operator-allowed-list · high confidence
Rename selector-combinator-blacklist to selector-combinator-disallowed-list
The rule previously known as selector-combinator-blacklist has been renamed to selector-combinator-disallowed-list to align with inclusive language standards. The functionality remains the same: it specifies a list of disallowed CSS combinators (such as descendant, child, or adjacent sibling combinators) and normalizes whitespace in the descendant combinator. Users must update their configuration to use the new rule name.
lib/rules/selector-attribute-operator-disallowed-list, lib/rules/selector-combinator-disallowed-list · high confidence
Renamed media-feature-name rules to use allowed-list/disallowed-list naming
The \media-feature-name-whitelist\ and \media-feature-name-blacklist\ rules have been renamed to \media-feature-name-allowed-list\ and \media-feature-name-disallowed-list\ respectively. This change aligns the rule names with inclusive language standards and updates the corresponding configuration keys, documentation, and error messages to reflect the new naming convention while preserving the existing functionality for specifying allowed or disallowed media feature names.
lib/rules/media-feature-name-allowed-list, lib/rules/media-feature-name-disallowed-list · high confidence
Rules are now loaded lazily via ESM imports with caching
The rules registry has been migrated to use dynamic ESM imports instead of static requires. Rules are now loaded on demand when first accessed and cached in memory, which reduces initial startup overhead and improves performance for users who do not utilize every available rule.
lib/rules · high confidence
Safer autofix for -webkit-background-size in property-no-vendor-prefix
The property-no-vendor-prefix rule now avoids automatically removing the -webkit-background-size vendor prefix when doing so would be unsafe. Specifically, the autofix is suppressed if the property value contains more than two components, or if it has one component that is not 'auto' or a basic keyword. This prevents the rule from breaking CSS layouts that rely on the prefixed property's specific behavior, while still allowing safe removals and reporting the issue to the user.
lib/rules/property-no-vendor-prefix · high confidence
Stylelint v9.0.0: ESM migration, stricter fix defaults, and new configuration options
This release migrates the core library to ES modules (ESM) and deprecates the CommonJS Node.js API, requiring users to adopt ESM-compatible configurations and plugins. The default behavior for the \--fix\ flag has shifted from \lax\ to \strict\, meaning autofixes will only be applied when no syntax errors are present, and a new \lax\ mode is available to restore the previous behavior. Configuration is now supported via a \formatter\ property and a \languageOptions\ object, while the CLI now prints fixed code to stdout and problems to stderr. Additionally, the \--validate\ flag and option have been added to control rule option validation, and the \maxWarnings\ configuration option allows builds to fail when a specific number of warnings is exceeded.
lib · high confidence
Support for @page pseudo-classes in selector-pseudo-class-allowed-list
The selector-pseudo-class-allowed-list rule now validates pseudo-classes within @page at-rules in addition to standard CSS rules. This change allows users to enforce allowed pseudo-class lists (such as :first, :left, :right) on page selectors, ensuring consistent linting coverage across both regular selectors and page context selectors.
lib/rules/selector-pseudo-class-allowed-list · high confidence
Support for custom at-rules via languageOptions
The at-rule-no-unknown rule now recognizes at-rules defined in the configuration's languageOptions.syntax.atRules setting, allowing users to register custom at-rule syntax without needing to ignore them individually. This change enables more precise control over unknown at-rules by integrating with the language options system rather than relying solely on the ignoreAtRules secondary option.
lib/rules/at-rule-no-unknown · high confidence
Support for custom units via languageOptions and new ignore options
The unit-no-unknown rule now allows users to extend the set of recognized units by defining them in the \languageOptions.syntax.units\ configuration, enabling support for custom or language-specific unit constructs. Additionally, the rule introduces two new secondary options: \ignoreUnits\ and \ignoreFunctions\, which let users explicitly exclude specific unit names or CSS functions from validation, providing finer control over what constitutes an unknown unit.
lib/rules/unit-no-unknown · high confidence
Test utilities migrated to ESM and updated for Node.js compatibility
The test utilities in lib/testUtils have been converted from CommonJS to ES modules (ESM), with files renamed to .mjs. This migration includes replacing the external strip-ansi dependency with the native node:util.stripVTControlCharacters function in getCleanOutput, and updating internal modules like safeChdir and replaceBackslashes to use native Node.js APIs (node:fs, node:url, node:process). A new test file mergeTestDescriptions.test.mjs was added to verify the mergeTestDescriptions utility, which now uses deepmerge. These changes ensure the test infrastructure is compatible with modern Node.js environments and ESM standards.
lib/testUtils · high confidence
Updated css-tree type definitions to include Lexer units property
The patch for @types/css-tree has been updated to expose the 'units' property on the Lexer class, allowing TypeScript users to access unit definitions as a Record of string arrays. This change improves type safety for code interacting with css-tree's lexer unit mappings.
patches · high confidence
Updated selector-max-specificity rule to support CSS Nesting and modern pseudo-classes
The \selector-max-specificity\ rule now adheres to the CSS Nesting specification when calculating specificity, treating the nesting selector (\&\) as having the same specificity as the \:is()\ pseudo-class. It also correctly handles modern functional pseudo-classes like \:is()\ and \:where()\, fixing previous false positives where these selectors were not properly ignored or calculated. Additionally, the rule now supports a custom specificity callback for the \ignoreSelectors\ option, allowing more precise control over which selectors to exclude from specificity checks, including partial matches for pseudo-classes with arguments.
lib/rules/selector-max-specificity · high confidence
at-rule-empty-line-before rule gains autofix and new configuration options
The \at-rule-empty-line-before\ rule now automatically fixes reported issues (removing or adding empty lines as needed) and supports several new secondary options: \except: \["first-nested"\]\ to reverse the primary option for the first nested at-rule, and \ignore: \["first-nested"\]\ to ignore the first nested at-rule entirely. The rule also now supports regex patterns in the \ignoreAtRules\ option for more flexible at-rule exclusion.
lib/rules/at-rule-empty-line-before · high confidence
at-rule-no-vendor-prefix rule now supports ignoreAtRules option and ESM module format
The at-rule-no-vendor-prefix rule has been migrated to an ES module (index.mjs) and now includes support for the ignoreAtRules secondary option, allowing users to specify at-rules to exclude from vendor-prefix checks. The rule continues to provide automatic fixing for vendor-prefixed at-rules, with the fix logic implemented via a dedicated fix callback.
lib/rules/at-rule-no-vendor-prefix · high confidence
comment-empty-line-before rule adds ignoreComments option and ESM migration
The \comment-empty-line-before\ rule has been migrated to ESM and now supports a new \ignoreComments\ secondary option, allowing users to specify strings or regular expressions to exclude specific comments from the rule's checks. The rule also retains support for ignoring stylelint configuration comments via the \stylelint-commands\ ignore option and comments following other comments via \after-comment\, while automatically fixing violations by adding or removing empty lines as configured.
lib/rules/comment-empty-line-before · high confidence
function-name-case rule now supports automatic fixing and regex-based function ignores
The function-name-case rule now includes an autofix capability that automatically corrects function names to match the configured case (lower or upper), handling camel-case exceptions for standard CSS functions when 'lower' is selected. Additionally, users can now use regular expressions in the ignoreFunctions secondary option to exclude specific function patterns from case checking, providing more flexible configuration for custom or vendor-prefixed functions.
lib/rules/function-name-case · high confidence
no-descending-specificity rule now supports ignoring selectors within lists
The \no-descending-specificity\ rule now accepts a secondary option \ignore: \["selectors-within-list"\]\. When enabled, the rule will skip checking rules that contain multiple selectors (e.g., \.a, .b { ... }\), preventing false positives or noise when multiple selectors are grouped together. This change is part of a broader migration of the rule to ESM and includes updates to how nested selectors and specificity are calculated, adhering to the CSS Nesting specification.
lib/rules/no-descending-specificity · high confidence
no-unknown-animations rule now supports referenceFiles and ESM
The no-unknown-animations rule has been migrated to ESM and now recognizes @keyframes definitions in external files specified via the referenceFiles configuration option, in addition to those in the current source. It also provides a customizable message argument for the unknown animation name.
lib/rules/no-unknown-animations · high confidence
number-max-precision rule gains ignoreUnits, ignoreProperties, and insideFunctions options
The number-max-precision rule now supports three secondary options that allow more precise control over which numbers are checked. You can use ignoreProperties to exclude specific CSS properties from the rule, ignoreUnits to exclude numbers with certain units (including regex patterns), and insideFunctions to specify different precision limits for numbers inside specific CSS functions like oklch or lab. These options are validated and integrated into the rule's core logic, which has been refactored to use the @csstools/css-parser-algorithms walk helper for parsing and traversing CSS values.
lib/rules/number-max-precision · high confidence
property-no-unknown rule adds ignoreSelectors and ignoreAtRules options
The property-no-unknown rule now supports two new configuration options: ignoreSelectors and ignoreAtRules. Users can specify selectors or at-rules to exclude from unknown property checks, allowing for more granular control over which CSS contexts are validated. The rule also continues to support ignoreProperties for specific property names and checkPrefixed for vendor-prefixed properties.
lib/rules/property-no-unknown · high confidence
selector-type-no-unknown rule ignores specific pseudo-elements and pseudo-classes
The \selector-type-no-unknown\ rule now excludes type selectors that appear as arguments to certain pseudo-elements and pseudo-classes from being flagged as unknown. Specifically, it ignores type selectors inside \::highlight\, \::view-transition-group\, \::view-transition-image-pair\, \::view-transition-new\, and \::view-transition-old\, as well as those inside \:active-view-transition-type\, \:dir\, \:-moz-locale-dir\, \:state\, and \:lang\. This prevents false positives for valid type selectors used within these functional contexts.
lib/rules/selector-type-no-unknown · high confidence
value-keyword-case rule gains ignoreProperties, ignoreFunctions, and camelCaseSvgKeywords options
The \value-keyword-case\ rule now supports three new secondary options to refine case enforcement: \ignoreProperties\ allows excluding specific CSS properties from case checking, \ignoreFunctions\ lets you specify functions whose arguments should be ignored, and \camelCaseSvgKeywords\ enables camelCase validation for SVG-specific keywords. These additions provide finer control over which CSS values are validated against the primary \lower\ or \upper\ case setting.
lib/rules/value-keyword-case · high confidence
value-no-vendor-prefix rule now supports regex patterns in ignoreValues
The \value-no-vendor-prefix\ rule has been updated to allow the \ignoreValues\ secondary option to accept regular expressions in addition to strings. This enables users to ignore vendor-prefixed values using pattern matching (e.g., \/^-moz-all$/\) rather than only exact string matches. The rule also includes an autofix capability that removes vendor prefixes from values, though it does not remove duplicate values produced by the fix.
lib/rules/value-no-vendor-prefix · high confidence
Fixes
Fix false negatives for custom properties in @property at-rules
The custom-property-pattern rule now correctly validates custom property names defined within @property at-rules, resolving previous false negatives where these declarations were ignored. The implementation also extends validation to custom property names used inside var() functions within declaration values, ensuring that patterns are checked in these contexts as well.
lib/rules/custom-property-pattern · high confidence
Fix false negatives for font and border shorthand overrides
The rule now correctly detects when shorthand properties like \font\ and \border\ override previously defined longhand properties (e.g., \font-weight\ or \border-top-width\). Previously, these specific cases were missed, but the updated logic in \index.mjs\ now checks against the full set of sub-properties and resettable properties, ensuring authors are alerted to these overrides.
lib/rules/declaration-block-no-shorthand-property-overrides · high confidence
Fix false negatives for scheme-relative URLs in @import statements
The \function-url-no-scheme-relative\ rule now correctly detects and reports scheme-relative URLs (those starting with \//\) when they appear inside \@import\ at-rules. Previously, the rule only checked CSS declarations, meaning patterns like \@import url('//example.com/style.css')\ were incorrectly allowed. This change ensures consistent enforcement across both property values and import statements.
lib/rules/function-url-no-scheme-relative · high confidence
Fix false positives and negatives for selector-no-qualifying-type with modern pseudo-classes
The selector-no-qualifying-type rule now correctly handles CSS nesting and modern functional pseudo-classes like :is(), :where(), and :has(). It no longer reports false negatives when a type selector qualifies a selector inside these pseudo-classes, and it avoids false positives when :has() is used. The rule also properly resolves nested selectors according to the CSS Nesting specification.
lib/rules/selector-no-qualifying-type · high confidence
Fix false positives for CSS variables in linear-gradient direction validation
The \function-linear-gradient-no-nonstandard-direction\ rule now correctly ignores the first argument of \linear-gradient\ when it is a CSS variable (e.g., \var(--my-direction)\). Previously, if a CSS variable's name contained a substring matching a direction keyword (like \top\ or \left\), the rule would incorrectly flag it as a non-standard direction. This change ensures that dynamic direction values defined via CSS variables are no longer reported as errors.
lib/rules/function-linear-gradient-no-nonstandard-direction · high confidence
Migrate lib/reference to ESM and update CSS reference data
The reference data files in lib/reference (including atKeywords, functions, keywords, mediaFeatures, mediaTypes, prefixes, properties, selectors, and units) have been migrated from CommonJS to ES modules (.mjs). This change also updates the underlying CSS reference data to include newer and experimental features, such as modern viewport units (dv\, lv\, sv\*), new color functions (oklab, oklch, color-mix), and updated HTML type selectors, ensuring the linter recognizes the latest CSS specifications.
lib/reference · high confidence
Test coverage
Added ESM test suite for at-rule-no-unknown rule; Added ESM test suite for the unit-no-unknown rule; Added ESM test suites for all formatters; Added ESM test suites for color-no-invalid-hex and declaration-block-no-duplicate-custom-properties rules; Added ESM tests for color-named rule and colord utilities; Added comprehensive test coverage for configuration overrides, CLI suppressions, and disable ranges; Added comprehensive tests for the no-irregular-whitespace rule; Added comprehensive validation tests for all linting rules; Added test fixture for globby-options flag; Added test fixtures for broken and correct CSS syntax; Added test fixtures for complex glob patterns; Added test fixtures for config overrides and rule extension; Added test fixtures for configuration, plugins, and syntaxes; Added test fixtures for disable options; Added test fixtures for per-file config resolution; Added test fixtures for standalone no-parsing and no-duplicate-selectors rules; Added test fixtures for stylelint ignore functionality; Added test fixtures for the --quiet-deprecation-warnings flag; Added tests for .stylelintignore handling in the standalone API; Added tests for EditInfo support in selector-pseudo-element-colon-notation; Added tests for \computeEditInfo\ in \at-rule-empty-line-before\ rule; Added tests for at-rule-no-vendor-prefix rule with ignoreAtRules support; Added tests for atKeywords reference data; Added tests for color-hex-length rule with EditInfo computation; Added tests for comment-empty-line-before rule fix and EditInfo computation; Added tests for comment-whitespace-inside rule with EditInfo support; Added tests for custom-property-empty-line-before rule options; Added tests for font-weight-notation EditInfo computation; Added tests for glob patterns with parent directory references; Added tests for hue-degree-notation rule's EditInfo computation; Added tests for keyframe-selector-notation timeline-range-name support and fix ranges; Added tests for max-nesting-depth ignore options; Added tests for media-feature-name-no-vendor-prefix rule configuration and autofix behavior; Added tests for media-feature-range-notation rule behavior and autofix; Added tests for property-no-vendor-prefix autofix safety and EditInfo computation; Added tests for selector-attribute-quotes EditInfo and reported ranges; Added tests for selector-no-vendor-prefix autofix ranges and EditInfo support; Added tests for selector-pseudo-class-allowed-list rule behavior; Added tests for selector-type-no-unknown rule; Added tests for string-no-newline rule behavior and configuration; Added tests for the at-rule-descriptor-value-no-unknown rule; Added valid CSS fixture for cache tests; Migrate rule test suites to ESM; Removed placeholder test file; System tests migrated to ESM and expanded with new test cases; Tests for the declaration-property-value-keyword-no-deprecated rule; Updated CLI help snapshot with new options; Updated test suite for selector-pseudo-class-no-unknown rule; Updated tests for font-family-no-missing-generic-family-keyword rule.
Dependencies
2050 commits updating dependencies (6 manifests)
A dependency / build maintenance change in (dependencies) — 2050 commits (143 fixs), 6 files.
(dependencies) · high confidence · unverified
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
This is the PUBLIC form of this artifact. Findings are listed in full, but the details of SECURITY findings — which rule fired, in which file, on which line, and how to fix it — are deliberately withheld, and any secret-scanner results are excluded entirely. Where detail is absent here it was REMOVED FOR PUBLICATION; it is not missing from the analysis. The complete artifact is available from the repository owner.
Score
- CAI 66 → 61 (-5.0)
- Rubric changed (rubric-2026.09.12 → rubric-2026.09.18) — scores are not directly comparable.
Lenses
- Code Health 72 → 72 (+0.0)
- Architecture 99 → 93 (-5.9)
- Maturity 58 → 46 (-11.7)
- Readiness 76 → 70 (-6.6)
- Security 67 → 73 (+5.3)
- Performance 86 (new)
Resolved (11)
- Dependency hygiene PARTLY measured — npm pinning read, dependency currency not (no pnpm-resolved versions to grade)
- Documentation: no installation or build instructions
- Documentation: no installation or build instructions (README.md)
- Hotspot: lib/rules/custom-property-no-missing-var-function/index.mjs (lib/rules/custom-property-no-missing-var-function/index.mjs)
- Hotspot: lib/rules/declaration-block-no-redundant-longhand-properties/index.mjs (lib/rules/declaration-block-no-redundant-longhand-properties/index.mjs)
- Hotspot: lib/rules/function-calc-no-unspaced-operator/index.mjs (lib/rules/function-calc-no-unspaced-operator/index.mjs)
- Hotspot: lib/rules/max-nesting-depth/index.mjs (lib/rules/max-nesting-depth/index.mjs)
- Hotspot: lib/rules/property-layout-mappings/index.mjs (lib/rules/property-layout-mappings/index.mjs)
- Hotspot: lib/rules/selector-no-qualifying-type/index.mjs (lib/rules/selector-no-qualifying-type/index.mjs)
- Hotspot: lib/rules/selector-no-unmatchable/index.mjs (lib/rules/selector-no-unmatchable/index.mjs)
- Off-boarding risk: anonymized user #1
New (69)
- Further sole-owners (lower concentration)
- High CVE: [GHSA redacted] (package-lock.json)
- High CVE: [GHSA redacted] (package-lock.json)
- Medium CVE: [GHSA redacted] (package-lock.json)
- Medium: security finding (details withheld)
- Medium: security finding (details withheld)
- Off-boarding risk: anonymized user #1
- Outdated (npm): @babel/code-frame
- Outdated (npm): @babel/helper-validator-identifier
- Outdated (npm): @csstools/css-calc
- Outdated (npm): @csstools/css-parser-algorithms
- Outdated (npm): @csstools/css-syntax-patches-for-csstree
- Outdated (npm): @csstools/css-tokenizer
- Outdated (npm): @csstools/media-query-list-parser
- Outdated (npm): @csstools/selector-resolve-nested
- Outdated (npm): @nodelib/fs.scandir
- Outdated (npm): @nodelib/fs.stat
- Outdated (npm): @nodelib/fs.walk
- Outdated (npm): ajv
- Outdated (npm): ansi-regex
- …and 49 more
Changes since last survey
- 1 commits — 1 feature/other, 0 fixes
By area
- (root) — 1 commit
Notable commits
- change: Release 17.16.0 (#9551)
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
stylelint/stylelint was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 2 October 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit bc06c7cdb1413de3d8dc939b33af138ab7e59df1 — the exact code this score is about.
- Scored under rubric-2026.09.18 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-e569280dd5e2.