Fix declaration-property-value-no-unknown false negatives/positives for math functions#9064
Conversation
🦋 Changeset detectedLatest commit: 8434197 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
…ersistent-emperor-tamarin-9df3ed4648
|
This PR is packaged and the instant preview is available (8434197). View the demo website. Install it locally: npm i -D https://pkg.pr.new/stylelint@8434197 |
There was a problem hiding this comment.
@romainmenke Thanks for working on this. It's looking great!
Is it intentionally marked as a draft?
I've added a second changeset.
I suggest we first merge:
Then resolve the conflicts here and merge this PR next, before looking at:
Yes, I wanted to work on coverage and add comments in the PR to better explain some choices
Thank you 🙇
Perfect! I am going to take a look at updating |
…mperor-tamarin-9df3ed4648' of https://github.com/stylelint/stylelint into fix-declaration-property-value-no-unknown--persistent-emperor-tamarin-9df3ed4648
…rty-value-no-unknown--persistent-emperor-tamarin-9df3ed4648
| message: messages.rejectedMath('height', 'calc(2 * 2)'), | ||
| message: messages.rejectedMath('height', '2 * 2'), |
There was a problem hiding this comment.
The reported range is narrower for operations like +, -, /, ... but not for functions like min() or clamp().
Any result has source indices that trace back to the expression.
- for math functions this is the function itself
- for operations these are the outermost operands
| code: 'a { margin-inline: calc(3px - 1px) calc(3 - 1px); }', | ||
| message: messages.rejectedMath('margin-inline', '3 - 1px'), |
There was a problem hiding this comment.
Test that the last calc() function is reported and not the first.
| code: 'a { margin-inline: calc((3px + 2px) - (1)); }', | ||
| message: messages.rejectedMath('margin-inline', '3px + 2px) - (1'), |
There was a problem hiding this comment.
These are newly reported errors.
@csstools/css-calc will recursively find all issues, and it will also handle expressions wrapped in parenthesis.
| { | ||
| code: 'a { top: calc(0.3 * 100% + 10px); }', | ||
| description: 'mixed units and percentages checking respects operator precedence', | ||
| }, | ||
| { | ||
| code: 'a { top: calc(0.3 * 100vh + 15px); }', | ||
| description: 'mixed units and percentages checking respects operator precedence', | ||
| }, |
| const SYNTAX_DESCRIPTOR = /^syntax$/i; | ||
|
|
||
| const UNSUPPORTED_FUNCTIONS = new Set(['env']); | ||
| const UNSUPPORTED_FUNCTIONS_IN_CSSTREE = new Set(['clamp', 'min', 'max', 'env']); |
There was a problem hiding this comment.
We still need the list that previously existed here.
I've renamed it to make it clearer why we consider these unsupported. @csstools/css-calc for example does support these.
| // TODO: csstree treats any value containing `var()` as valid, even if the `var()` expression itself is invalid. | ||
| // csstree should be updated to mark invalidate values that contain invalid `var()` expressions. | ||
| // skipping parsing by returning early until this is resolved upstream. | ||
| if (/\bvar\s*\(/i.test(value)) return; |
There was a problem hiding this comment.
Moved this check up to speedup this rule.
| * @param {ReturnType<import('css-tree')['fork']>['lexer']} lexer - The csstree lexer | ||
| * @param {Map<string, string>} typedCustomPropertyNames - Map of typed custom property names | ||
| * @returns {'skip' | 'invalid' | 'continue'} - The validation result | ||
| * @returns {['undetermined' | 'valid' | 'invalid' | 'skip-validation', number, number]} - The validation result |
There was a problem hiding this comment.
I found skip and continue to be ambiguous and I think this naming also caused an oversight in the original implementation.
I've refactored it to cover these states:
valid: the value is fine and no further checking is neededinvalid: already found an issue, report and stopskip-validation: something was detected that we can't validate, and neither can the rest of this rule, stopundetermined: we don't know, run the regular validation after this step
| switch (calcParseError.message) { | ||
| case ParseErrorMessage.UnexpectedAdditionOfDimensionOrPercentageWithNumber: | ||
| case ParseErrorMessage.UnexpectedSubtractionOfDimensionOrPercentageWithNumber: | ||
| return ['invalid', calcParseError.sourceStart, calcParseError.sourceEnd + 1]; | ||
|
|
||
| default: | ||
| break; | ||
| } |
There was a problem hiding this comment.
Only handling very specific errors here.
This allows updates in @csstools/css-calc without causing new errors to be reported downstream in Stylelint.
| const startOffset = error.loc.start.offset; | ||
| const endOffset = error.loc.end.offset; | ||
|
|
||
| // Lookup the original source position of the invalid expression | ||
| // by finding the tokens that correspond to the positions reported by csstree | ||
| const solvedTokens = solvedNodes.flatMap((componentValues) => | ||
| componentValues.flatMap((node) => node.tokens()), | ||
| ); | ||
| let counter = 0; | ||
| let startToken; | ||
| let endToken; |
There was a problem hiding this comment.
This allows us to trace the error:
css-tree report -> @csstools tokens -> original source
| { | ||
| code: 'a { margin-inline: calc(10px)calc(20px); }', | ||
| skip: true, | ||
| description: 'functions can be written without separating white space', | ||
| }, |
There was a problem hiding this comment.
This is converted to 10px20px which is a dimension with value 10 and unit px20px.
This is quite obscure, but something that we should fix.
I am running out of time today and given that no one writes such source code it seems fine for now.
Need to find a way to inject some whitespace between such values.
There was a problem hiding this comment.
Does it make sense to leave a comment for this skip so that others can understand? E.g.
skip: true, // TODO: ...There was a problem hiding this comment.
It does make sense to add such a comment :)
Going to do quick follow up PR to remove the skip instead.
jeddy3
left a comment
There was a problem hiding this comment.
A fantastic effort upstream and here in this PR!
LGTM, thank you.
declaration-property-value-no-unknown false negatives for math functionsdeclaration-property-value-no-unknown false negatives/positives for math functions
ybiquitous
left a comment
There was a problem hiding this comment.
LGTM, thank you 👍🏼
My minor comment is ignorable.
|
Thank you for the reviews 🙇 |
| datasource | package | from | to | | ---------- | --------- | ------ | ------ | | npm | stylelint | 17.1.0 | 17.3.0 | ## [v17.3.0](https://github.com/stylelint/stylelint/blob/HEAD/CHANGELOG.md#1730---2026-02-13) It fixes 17 bugs. 3 related to supporting `calc()` in `declaration-property-value-no-unknown`, and 13 performance ones that make Stylelint a further 3x faster when using the rules in our [standard config](https://www.npmjs.com/package/stylelint-config-standard). - Fixed: performance of rule sequencing ([#9055](stylelint/stylelint#9055)) ([@jeddy3](https://github.com/jeddy3)). - Fixed: `*-list` performance ([#9056](stylelint/stylelint#9056)) ([@jeddy3](https://github.com/jeddy3)). - Fixed: `*-notation` performance ([#9044](stylelint/stylelint#9044)) ([@jeddy3](https://github.com/jeddy3)). - Fixed: `declaration-property-max-values` performance ([#9057](stylelint/stylelint#9057)) ([@jeddy3](https://github.com/jeddy3)). - Fixed: `declaration-property-value-keyword-no-deprecated` performance ([#9058](stylelint/stylelint#9058)) ([@jeddy3](https://github.com/jeddy3)). - Fixed: `declaration-property-value-no-unknown` false negatives for math functions inside of non-math functions ([#9064](stylelint/stylelint#9064)) ([@romainmenke](https://github.com/romainmenke)). - Fixed: `declaration-property-value-no-unknown` false positives for `calc()` with mixed operations ([#9064](stylelint/stylelint#9064)) ([@romainmenke](https://github.com/romainmenke)). - Fixed: `declaration-property-value-no-unknown` performance ([#9062](stylelint/stylelint#9062)) ([@jeddy3](https://github.com/jeddy3)). - Fixed: `declaration-property-value-no-unknown` reported ranges for multiple math functions ([#9064](stylelint/stylelint#9064)) ([@romainmenke](https://github.com/romainmenke)). - Fixed: `length-zero-no-unit` performance ([#9046](stylelint/stylelint#9046)) ([@jeddy3](https://github.com/jeddy3)). - Fixed: `named-grid-areas-no-invalid` false positives for mix of tabs and spaces ([#9039](stylelint/stylelint#9039)) ([@adalinesimonian](https://github.com/adalinesimonian)). - Fixed: `no-unknown-custom-media` performance ([#9059](stylelint/stylelint#9059)) ([@jeddy3](https://github.com/jeddy3)). - Fixed: `selector-max-*` performance ([#9042](stylelint/stylelint#9042)) ([@jeddy3](https://github.com/jeddy3)). - Fixed: `shorthand-property-no-redundant-values` performance ([#9047](stylelint/stylelint#9047)) ([@jeddy3](https://github.com/jeddy3)). - Fixed: `syntax-string-no-invalid` performance ([#9061](stylelint/stylelint#9061)) ([@jeddy3](https://github.com/jeddy3)). - Fixed: `time-min-milliseconds` performance ([#9060](stylelint/stylelint#9060)) ([@jeddy3](https://github.com/jeddy3)). - Fixed: `value-keyword-case` performance ([#9048](stylelint/stylelint#9048)) ([@jeddy3](https://github.com/jeddy3)). ## [v17.2.0](https://github.com/stylelint/stylelint/blob/HEAD/CHANGELOG.md#1720---2026-02-10) It fixes 7 bugs, including 5 performance ones that make Stylelint 7x faster and use 3x less memory on larger codebases such as design systems and monorepos. We also restructured our docs to create a [contributor guide](CONTRIBUTING.md). If you'd like to help out and contribute to Stylelint, that's the place to start. - Fixed: performance of config augmentation and module imports ([#9021](stylelint/stylelint#9021)) ([@adalinesimonian](https://github.com/adalinesimonian)). - Fixed: performance of config override matching ([#9023](stylelint/stylelint#9023)) ([@adalinesimonian](https://github.com/adalinesimonian)). - Fixed: performance of config resolution ([#9033](stylelint/stylelint#9033)) ([@adalinesimonian](https://github.com/adalinesimonian)). - Fixed: performance of rule resolution ([#9022](stylelint/stylelint#9022)) ([@adalinesimonian](https://github.com/adalinesimonian)). - Fixed: `declaration-property-value-no-unknown` false negatives for math functions ([#9011](stylelint/stylelint#9011)) ([@ragini-pandey](https://github.com/ragini-pandey)). - Fixed: `no-duplicate-selectors` false negatives for matching escaped selectors ([#8953](stylelint/stylelint#8953)) ([@bjnewman](https://github.com/bjnewman)). - Fixed: `no-invalid-position-at-import-rule` false negatives for layers with blocks ([#9026](stylelint/stylelint#9026)) ([@romainmenke](https://github.com/romainmenke)). ## [v17.1.1](https://github.com/stylelint/stylelint/blob/HEAD/CHANGELOG.md#1711---2026-02-03) It fixes 2 bugs. - Fixed: resolution of configs, plugins, processors, and custom syntaxes in Yarn PnP environments ([#9010](stylelint/stylelint#9010)) ([@adalinesimonian](https://github.com/adalinesimonian)). - Fixed: `lightness-notation` autofix for decimals ([#9009](stylelint/stylelint#9009)) ([@IlyaSemenov](https://github.com/IlyaSemenov)).
| datasource | package | from | to | | ---------- | --------- | ------ | ------ | | npm | stylelint | 17.1.0 | 17.3.0 | ## [v17.3.0](https://github.com/stylelint/stylelint/blob/HEAD/CHANGELOG.md#1730---2026-02-13) It fixes 17 bugs. 3 related to supporting `calc()` in `declaration-property-value-no-unknown`, and 13 performance ones that make Stylelint a further 3x faster when using the rules in our [standard config](https://www.npmjs.com/package/stylelint-config-standard). - Fixed: performance of rule sequencing ([#9055](stylelint/stylelint#9055)) ([@jeddy3](https://github.com/jeddy3)). - Fixed: `*-list` performance ([#9056](stylelint/stylelint#9056)) ([@jeddy3](https://github.com/jeddy3)). - Fixed: `*-notation` performance ([#9044](stylelint/stylelint#9044)) ([@jeddy3](https://github.com/jeddy3)). - Fixed: `declaration-property-max-values` performance ([#9057](stylelint/stylelint#9057)) ([@jeddy3](https://github.com/jeddy3)). - Fixed: `declaration-property-value-keyword-no-deprecated` performance ([#9058](stylelint/stylelint#9058)) ([@jeddy3](https://github.com/jeddy3)). - Fixed: `declaration-property-value-no-unknown` false negatives for math functions inside of non-math functions ([#9064](stylelint/stylelint#9064)) ([@romainmenke](https://github.com/romainmenke)). - Fixed: `declaration-property-value-no-unknown` false positives for `calc()` with mixed operations ([#9064](stylelint/stylelint#9064)) ([@romainmenke](https://github.com/romainmenke)). - Fixed: `declaration-property-value-no-unknown` performance ([#9062](stylelint/stylelint#9062)) ([@jeddy3](https://github.com/jeddy3)). - Fixed: `declaration-property-value-no-unknown` reported ranges for multiple math functions ([#9064](stylelint/stylelint#9064)) ([@romainmenke](https://github.com/romainmenke)). - Fixed: `length-zero-no-unit` performance ([#9046](stylelint/stylelint#9046)) ([@jeddy3](https://github.com/jeddy3)). - Fixed: `named-grid-areas-no-invalid` false positives for mix of tabs and spaces ([#9039](stylelint/stylelint#9039)) ([@adalinesimonian](https://github.com/adalinesimonian)). - Fixed: `no-unknown-custom-media` performance ([#9059](stylelint/stylelint#9059)) ([@jeddy3](https://github.com/jeddy3)). - Fixed: `selector-max-*` performance ([#9042](stylelint/stylelint#9042)) ([@jeddy3](https://github.com/jeddy3)). - Fixed: `shorthand-property-no-redundant-values` performance ([#9047](stylelint/stylelint#9047)) ([@jeddy3](https://github.com/jeddy3)). - Fixed: `syntax-string-no-invalid` performance ([#9061](stylelint/stylelint#9061)) ([@jeddy3](https://github.com/jeddy3)). - Fixed: `time-min-milliseconds` performance ([#9060](stylelint/stylelint#9060)) ([@jeddy3](https://github.com/jeddy3)). - Fixed: `value-keyword-case` performance ([#9048](stylelint/stylelint#9048)) ([@jeddy3](https://github.com/jeddy3)). ## [v17.2.0](https://github.com/stylelint/stylelint/blob/HEAD/CHANGELOG.md#1720---2026-02-10) It fixes 7 bugs, including 5 performance ones that make Stylelint 7x faster and use 3x less memory on larger codebases such as design systems and monorepos. We also restructured our docs to create a [contributor guide](CONTRIBUTING.md). If you'd like to help out and contribute to Stylelint, that's the place to start. - Fixed: performance of config augmentation and module imports ([#9021](stylelint/stylelint#9021)) ([@adalinesimonian](https://github.com/adalinesimonian)). - Fixed: performance of config override matching ([#9023](stylelint/stylelint#9023)) ([@adalinesimonian](https://github.com/adalinesimonian)). - Fixed: performance of config resolution ([#9033](stylelint/stylelint#9033)) ([@adalinesimonian](https://github.com/adalinesimonian)). - Fixed: performance of rule resolution ([#9022](stylelint/stylelint#9022)) ([@adalinesimonian](https://github.com/adalinesimonian)). - Fixed: `declaration-property-value-no-unknown` false negatives for math functions ([#9011](stylelint/stylelint#9011)) ([@ragini-pandey](https://github.com/ragini-pandey)). - Fixed: `no-duplicate-selectors` false negatives for matching escaped selectors ([#8953](stylelint/stylelint#8953)) ([@bjnewman](https://github.com/bjnewman)). - Fixed: `no-invalid-position-at-import-rule` false negatives for layers with blocks ([#9026](stylelint/stylelint#9026)) ([@romainmenke](https://github.com/romainmenke)). ## [v17.1.1](https://github.com/stylelint/stylelint/blob/HEAD/CHANGELOG.md#1711---2026-02-03) It fixes 2 bugs. - Fixed: resolution of configs, plugins, processors, and custom syntaxes in Yarn PnP environments ([#9010](stylelint/stylelint#9010)) ([@adalinesimonian](https://github.com/adalinesimonian)). - Fixed: `lightness-notation` autofix for decimals ([#9009](stylelint/stylelint#9009)) ([@IlyaSemenov](https://github.com/IlyaSemenov)).
| datasource | package | from | to | | ---------- | --------- | ------ | ------ | | npm | stylelint | 17.1.0 | 17.3.0 | ## [v17.3.0](https://github.com/stylelint/stylelint/blob/HEAD/CHANGELOG.md#1730---2026-02-13) It fixes 17 bugs. 3 related to supporting `calc()` in `declaration-property-value-no-unknown`, and 13 performance ones that make Stylelint a further 3x faster when using the rules in our [standard config](https://www.npmjs.com/package/stylelint-config-standard). - Fixed: performance of rule sequencing ([#9055](stylelint/stylelint#9055)) ([@jeddy3](https://github.com/jeddy3)). - Fixed: `*-list` performance ([#9056](stylelint/stylelint#9056)) ([@jeddy3](https://github.com/jeddy3)). - Fixed: `*-notation` performance ([#9044](stylelint/stylelint#9044)) ([@jeddy3](https://github.com/jeddy3)). - Fixed: `declaration-property-max-values` performance ([#9057](stylelint/stylelint#9057)) ([@jeddy3](https://github.com/jeddy3)). - Fixed: `declaration-property-value-keyword-no-deprecated` performance ([#9058](stylelint/stylelint#9058)) ([@jeddy3](https://github.com/jeddy3)). - Fixed: `declaration-property-value-no-unknown` false negatives for math functions inside of non-math functions ([#9064](stylelint/stylelint#9064)) ([@romainmenke](https://github.com/romainmenke)). - Fixed: `declaration-property-value-no-unknown` false positives for `calc()` with mixed operations ([#9064](stylelint/stylelint#9064)) ([@romainmenke](https://github.com/romainmenke)). - Fixed: `declaration-property-value-no-unknown` performance ([#9062](stylelint/stylelint#9062)) ([@jeddy3](https://github.com/jeddy3)). - Fixed: `declaration-property-value-no-unknown` reported ranges for multiple math functions ([#9064](stylelint/stylelint#9064)) ([@romainmenke](https://github.com/romainmenke)). - Fixed: `length-zero-no-unit` performance ([#9046](stylelint/stylelint#9046)) ([@jeddy3](https://github.com/jeddy3)). - Fixed: `named-grid-areas-no-invalid` false positives for mix of tabs and spaces ([#9039](stylelint/stylelint#9039)) ([@adalinesimonian](https://github.com/adalinesimonian)). - Fixed: `no-unknown-custom-media` performance ([#9059](stylelint/stylelint#9059)) ([@jeddy3](https://github.com/jeddy3)). - Fixed: `selector-max-*` performance ([#9042](stylelint/stylelint#9042)) ([@jeddy3](https://github.com/jeddy3)). - Fixed: `shorthand-property-no-redundant-values` performance ([#9047](stylelint/stylelint#9047)) ([@jeddy3](https://github.com/jeddy3)). - Fixed: `syntax-string-no-invalid` performance ([#9061](stylelint/stylelint#9061)) ([@jeddy3](https://github.com/jeddy3)). - Fixed: `time-min-milliseconds` performance ([#9060](stylelint/stylelint#9060)) ([@jeddy3](https://github.com/jeddy3)). - Fixed: `value-keyword-case` performance ([#9048](stylelint/stylelint#9048)) ([@jeddy3](https://github.com/jeddy3)). ## [v17.2.0](https://github.com/stylelint/stylelint/blob/HEAD/CHANGELOG.md#1720---2026-02-10) It fixes 7 bugs, including 5 performance ones that make Stylelint 7x faster and use 3x less memory on larger codebases such as design systems and monorepos. We also restructured our docs to create a [contributor guide](CONTRIBUTING.md). If you'd like to help out and contribute to Stylelint, that's the place to start. - Fixed: performance of config augmentation and module imports ([#9021](stylelint/stylelint#9021)) ([@adalinesimonian](https://github.com/adalinesimonian)). - Fixed: performance of config override matching ([#9023](stylelint/stylelint#9023)) ([@adalinesimonian](https://github.com/adalinesimonian)). - Fixed: performance of config resolution ([#9033](stylelint/stylelint#9033)) ([@adalinesimonian](https://github.com/adalinesimonian)). - Fixed: performance of rule resolution ([#9022](stylelint/stylelint#9022)) ([@adalinesimonian](https://github.com/adalinesimonian)). - Fixed: `declaration-property-value-no-unknown` false negatives for math functions ([#9011](stylelint/stylelint#9011)) ([@ragini-pandey](https://github.com/ragini-pandey)). - Fixed: `no-duplicate-selectors` false negatives for matching escaped selectors ([#8953](stylelint/stylelint#8953)) ([@bjnewman](https://github.com/bjnewman)). - Fixed: `no-invalid-position-at-import-rule` false negatives for layers with blocks ([#9026](stylelint/stylelint#9026)) ([@romainmenke](https://github.com/romainmenke)). ## [v17.1.1](https://github.com/stylelint/stylelint/blob/HEAD/CHANGELOG.md#1711---2026-02-03) It fixes 2 bugs. - Fixed: resolution of configs, plugins, processors, and custom syntaxes in Yarn PnP environments ([#9010](stylelint/stylelint#9010)) ([@adalinesimonian](https://github.com/adalinesimonian)). - Fixed: `lightness-notation` autofix for decimals ([#9009](stylelint/stylelint#9009)) ([@IlyaSemenov](https://github.com/IlyaSemenov)).
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [eslint](https://eslint.org) ([source](https://github.com/eslint/eslint)) | devDependencies | patch | [`9.39.2` -> `9.39.3`](https://renovatebot.com/diffs/npm/eslint/9.39.2/9.39.3) | | [prettier](https://prettier.io) ([source](https://github.com/prettier/prettier)) | devDependencies | patch | [`3.8.0` -> `3.8.1`](https://renovatebot.com/diffs/npm/prettier/3.8.0/3.8.1) | | [stylelint](https://stylelint.io) ([source](https://github.com/stylelint/stylelint)) | devDependencies | minor | [`17.0.0` -> `17.4.0`](https://renovatebot.com/diffs/npm/stylelint/17.0.0/17.4.0) | --- ### Release Notes <details> <summary>eslint/eslint (eslint)</summary> ### [`v9.39.3`](https://github.com/eslint/eslint/releases/tag/v9.39.3) [Compare Source](eslint/eslint@v9.39.2...v9.39.3) #### Bug Fixes - [`791bf8d`](eslint/eslint@791bf8d) fix: restore TypeScript 4.0 compatibility in types ([#​20504](eslint/eslint#20504)) (sethamus) #### Chores - [`8594a43`](eslint/eslint@8594a43) chore: upgrade [@​eslint/js](https://github.com/eslint/js)@​9.39.3 ([#​20529](eslint/eslint#20529)) (Milos Djermanovic) - [`9ceef92`](eslint/eslint@9ceef92) chore: package.json update for [@​eslint/js](https://github.com/eslint/js) release (Jenkins) - [`af498c6`](eslint/eslint@af498c6) chore: ignore `/docs/v9.x` in link checker ([#​20453](eslint/eslint#20453)) (Milos Djermanovic) </details> <details> <summary>prettier/prettier (prettier)</summary> ### [`v3.8.1`](https://github.com/prettier/prettier/blob/HEAD/CHANGELOG.md#381) [Compare Source](prettier/prettier@3.8.0...3.8.1) [diff](prettier/prettier@3.8.0...3.8.1) ##### Include available `printers` in plugin type declarations ([#​18706](prettier/prettier#18706) by [@​porada](https://github.com/porada)) <!-- prettier-ignore --> ```ts // Input import * as prettierPluginEstree from "prettier/plugins/estree"; // Prettier 3.8.0 // Property 'printers' does not exist on type 'typeof import("prettier/plugins/estree")'. ts(2339) prettierPluginEstree.printers.estree; //=> any // Prettier 3.8.1 prettierPluginEstree.printers.estree; //=> Printer prettierPluginEstree.printers["estree-json"]; //=> Printer ``` </details> <details> <summary>stylelint/stylelint (stylelint)</summary> ### [`v17.4.0`](https://github.com/stylelint/stylelint/blob/HEAD/CHANGELOG.md#1740---2026-02-25) [Compare Source](stylelint/stylelint@17.3.0...17.4.0) It adds 2 options to the rules and fixes 7 bugs. - Added: `ignoreAtRules: []` to `at-rule-no-vendor-prefix` ([#​9096](stylelint/stylelint#9096)) ([@​theacrat](https://github.com/theacrat)). - Added: `ignoreMediaFeatureNames: []` to `media-feature-name-no-vendor-prefix` ([#​9097](stylelint/stylelint#9097)) ([@​theacrat](https://github.com/theacrat)). - Fixed: performance of selector cloning rules ([#​9089](stylelint/stylelint#9089)) ([@​jeddy3](https://github.com/jeddy3)). - Fixed: `*-empty-line-before` performance ([#​9092](stylelint/stylelint#9092)) ([@​jeddy3](https://github.com/jeddy3)). - Fixed: `declaration-property-value-no-unknown` performance ([#​9090](stylelint/stylelint#9090)) ([@​jeddy3](https://github.com/jeddy3)). - Fixed: `no-irregular-whitespace` performance ([#​9091](stylelint/stylelint#9091)) ([@​jeddy3](https://github.com/jeddy3)). - Fixed: `property-no-unknown` false negatives for at-rule descriptors ([#​9109](stylelint/stylelint#9109)) ([@​jeddy3](https://github.com/jeddy3)). - Fixed: `property-no-unknown` false positives for `corner-shape` ([#​9099](stylelint/stylelint#9099)) ([@​jeddy3](https://github.com/jeddy3)). - Fixed: `property-no-unknown` false positives for double-slashed properties ([#​9099](stylelint/stylelint#9099)) ([@​jeddy3](https://github.com/jeddy3)). ### [`v17.3.0`](https://github.com/stylelint/stylelint/blob/HEAD/CHANGELOG.md#1730---2026-02-13) [Compare Source](stylelint/stylelint@17.2.0...17.3.0) It fixes 17 bugs. 3 related to supporting `calc()` in `declaration-property-value-no-unknown`, and 13 performance ones that make Stylelint a further 3x faster when using the rules in our [standard config](https://www.npmjs.com/package/stylelint-config-standard). - Fixed: performance of rule sequencing ([#​9055](stylelint/stylelint#9055)) ([@​jeddy3](https://github.com/jeddy3)). - Fixed: `*-list` performance ([#​9056](stylelint/stylelint#9056)) ([@​jeddy3](https://github.com/jeddy3)). - Fixed: `*-notation` performance ([#​9044](stylelint/stylelint#9044)) ([@​jeddy3](https://github.com/jeddy3)). - Fixed: `declaration-property-max-values` performance ([#​9057](stylelint/stylelint#9057)) ([@​jeddy3](https://github.com/jeddy3)). - Fixed: `declaration-property-value-keyword-no-deprecated` performance ([#​9058](stylelint/stylelint#9058)) ([@​jeddy3](https://github.com/jeddy3)). - Fixed: `declaration-property-value-no-unknown` false negatives for math functions inside of non-math functions ([#​9064](stylelint/stylelint#9064)) ([@​romainmenke](https://github.com/romainmenke)). - Fixed: `declaration-property-value-no-unknown` false positives for `calc()` with mixed operations ([#​9064](stylelint/stylelint#9064)) ([@​romainmenke](https://github.com/romainmenke)). - Fixed: `declaration-property-value-no-unknown` performance ([#​9062](stylelint/stylelint#9062)) ([@​jeddy3](https://github.com/jeddy3)). - Fixed: `declaration-property-value-no-unknown` reported ranges for multiple math functions ([#​9064](stylelint/stylelint#9064)) ([@​romainmenke](https://github.com/romainmenke)). - Fixed: `length-zero-no-unit` performance ([#​9046](stylelint/stylelint#9046)) ([@​jeddy3](https://github.com/jeddy3)). - Fixed: `named-grid-areas-no-invalid` false positives for mix of tabs and spaces ([#​9039](stylelint/stylelint#9039)) ([@​adalinesimonian](https://github.com/adalinesimonian)). - Fixed: `no-unknown-custom-media` performance ([#​9059](stylelint/stylelint#9059)) ([@​jeddy3](https://github.com/jeddy3)). - Fixed: `selector-max-*` performance ([#​9042](stylelint/stylelint#9042)) ([@​jeddy3](https://github.com/jeddy3)). - Fixed: `shorthand-property-no-redundant-values` performance ([#​9047](stylelint/stylelint#9047)) ([@​jeddy3](https://github.com/jeddy3)). - Fixed: `syntax-string-no-invalid` performance ([#​9061](stylelint/stylelint#9061)) ([@​jeddy3](https://github.com/jeddy3)). - Fixed: `time-min-milliseconds` performance ([#​9060](stylelint/stylelint#9060)) ([@​jeddy3](https://github.com/jeddy3)). - Fixed: `value-keyword-case` performance ([#​9048](stylelint/stylelint#9048)) ([@​jeddy3](https://github.com/jeddy3)). ### [`v17.2.0`](https://github.com/stylelint/stylelint/blob/HEAD/CHANGELOG.md#1720---2026-02-10) [Compare Source](stylelint/stylelint@17.1.1...17.2.0) It fixes 7 bugs, including 5 performance ones that make Stylelint 7x faster and use 3x less memory on larger codebases such as design systems and monorepos. We also restructured our docs to create a [contributor guide](CONTRIBUTING.md). If you'd like to help out and contribute to Stylelint, that's the place to start. - Fixed: performance of config augmentation and module imports ([#​9021](stylelint/stylelint#9021)) ([@​adalinesimonian](https://github.com/adalinesimonian)). - Fixed: performance of config override matching ([#​9023](stylelint/stylelint#9023)) ([@​adalinesimonian](https://github.com/adalinesimonian)). - Fixed: performance of config resolution ([#​9033](stylelint/stylelint#9033)) ([@​adalinesimonian](https://github.com/adalinesimonian)). - Fixed: performance of rule resolution ([#​9022](stylelint/stylelint#9022)) ([@​adalinesimonian](https://github.com/adalinesimonian)). - Fixed: `declaration-property-value-no-unknown` false negatives for math functions ([#​9011](stylelint/stylelint#9011)) ([@​ragini-pandey](https://github.com/ragini-pandey)). - Fixed: `no-duplicate-selectors` false negatives for matching escaped selectors ([#​8953](stylelint/stylelint#8953)) ([@​bjnewman](https://github.com/bjnewman)). - Fixed: `no-invalid-position-at-import-rule` false negatives for layers with blocks ([#​9026](stylelint/stylelint#9026)) ([@​romainmenke](https://github.com/romainmenke)). ### [`v17.1.1`](https://github.com/stylelint/stylelint/blob/HEAD/CHANGELOG.md#1711---2026-02-03) [Compare Source](stylelint/stylelint@17.1.0...17.1.1) It fixes 2 bugs. - Fixed: resolution of configs, plugins, processors, and custom syntaxes in Yarn PnP environments ([#​9010](stylelint/stylelint#9010)) ([@​adalinesimonian](https://github.com/adalinesimonian)). - Fixed: `lightness-notation` autofix for decimals ([#​9009](stylelint/stylelint#9009)) ([@​IlyaSemenov](https://github.com/IlyaSemenov)). ### [`v17.1.0`](https://github.com/stylelint/stylelint/blob/HEAD/CHANGELOG.md#1710---2026-01-30) [Compare Source](stylelint/stylelint@17.0.0...17.1.0) It fixes 5 bugs and adds the `display-notation` rule. Before we turn it on in our [standard config](https://www.npmjs.com/package/stylelint-config-standard), we'd like to [hear the community's thoughts](stylelint/stylelint-config-standard#387) on which options to use. - Added: `display-notation` rule ([#​8981](stylelint/stylelint#8981)) ([@​romainmenke](https://github.com/romainmenke)). - Fixed: `GlobbyOptions` TypeScript errors ([#​8992](stylelint/stylelint#8992)) ([@​zalishchuk](https://github.com/zalishchuk)). - Fixed: `hue-degree-notation` false negatives and positives for relative colors ([#​8985](stylelint/stylelint#8985)) ([@​jamesnw](https://github.com/jamesnw)). - Fixed: `lightness-notation` false negatives for relative colors ([#​8987](stylelint/stylelint#8987)) ([@​jamesnw](https://github.com/jamesnw)). - Fixed: `selector-type-no-unknown` false positives for `geolocation` and `usermedia` ([#​9004](stylelint/stylelint#9004)) ([@​Mouvedia](https://github.com/Mouvedia)). - Fixed: `selector-type-no-unknown` false positives for `rb`, `rtc` and `menuitem` ([#​8972](stylelint/stylelint#8972)) ([@​Mouvedia](https://github.com/Mouvedia)). </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://github.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS42MS4wIiwidXBkYXRlZEluVmVyIjoiNDEuNjEuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==--> Reviewed-on: https://git.robbevp.be/robbevp/website-robbevanpetegem/pulls/505 Co-authored-by: Renovate Bot <renovate@robbevp.be> Co-committed-by: Renovate Bot <renovate@robbevp.be>
declaration-property-value-no-unknownfalse negatives for math functions inside non-math functions #9052declaration-property-value-no-unknownreported ranges for multiple math functions #9053declaration-property-value-no-unknownfalse positives for calc() with mixed operations #9066This is a pretty extensive rewrite of the changes introduced in: #9011
The intention of the rewrite is not to change behavior but to fix the two mentioned bugs and also to reduce the amount of times we tokenize/parse values.