-
-
Notifications
You must be signed in to change notification settings - Fork 986
Fix *-no-unknown false positives for latest specs by integrating @csstools/css-syntax-patches-for-csstree
#8850
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix *-no-unknown false positives for latest specs by integrating @csstools/css-syntax-patches-for-csstree
#8850
Conversation
…csstools/css-syntax-patches-for-csstree`
🦋 Changeset detectedLatest commit: b092024 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 |
|
This PR is packaged and the instant preview is available (b092024). View the demo website. Install it locally: npm i -D https://pkg.pr.new/stylelint@b092024 |
…grating-csstools-css-syntax-patches-for-csstree--adaptable-jaguar-e2fb11b478' of https://github.com/stylelint/stylelint into fix-no-unknown-false-positives-for-latest-specs-by-integrating-csstools-css-syntax-patches-for-csstree--adaptable-jaguar-e2fb11b478
|
This is fantastic, thank you! It's great to see all the issues resolved in the demo.
I've added this to the Prepare 17.0.0 task list. |
lib/utils/mergeSyntaxDefinitions.mjs
Outdated
| if (typeof source1 === 'undefined' || typeof source2 === 'undefined') | ||
| return source1 ?? source2 ?? {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've built in a lot of checks for undefined. (Maybe these should be extended to cover null?)
My thinking is that we want to be really forgiving in these objects and configs and allow authors to pass only those definitions they want to override.
If you see ways we can improve this code, feedback is welcome :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This specific instance was unreachable and could be removed, but the pattern repeats itself a few times in this file :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My thinking is that we want to be really forgiving in these objects and configs and allow authors to pass only those definitions they want to override.
That sounds appropriate to me.
jeddy3
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you!
|
I'll wait a bit before merging in case other maintainers have feedback |
…ecs-by-integrating-csstools-css-syntax-patches-for-csstree--adaptable-jaguar-e2fb11b478
| }, | ||
| "dependencies": { | ||
| "@csstools/css-parser-algorithms": "^3.0.5", | ||
| "@csstools/css-syntax-patches-for-csstree": "^1.0.19", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| datasource | package | from | to | | ---------- | --------- | ------- | ------- | | npm | stylelint | 16.26.0 | 16.26.1 | ## [v16.26.1](https://github.com/stylelint/stylelint/blob/HEAD/CHANGELOG.md#16261---2025-11-28) It fixes numerous false positive bugs, including many in the `declaration-property-value-no-unknown` rule for the latest CSS specifications. - Fixed: `*-no-unknown` false positives for latest specs by integrating `@csstools/css-syntax-patches-for-csstree` ([#8850](stylelint/stylelint#8850)) ([@romainmenke](https://github.com/romainmenke)). - Fixed: `at-rule-no-unknown` false positives for `@function` ([#8851](stylelint/stylelint#8851)) ([@jeddy3](https://github.com/jeddy3)). - Fixed: `declaration-property-value-no-unknown` false positives for `attr()`, `if()` and custom functions ([#8853](stylelint/stylelint#8853)) ([@jeddy3](https://github.com/jeddy3)). - Fixed: `function-url-quotes` false positives when URLs require quoting ([#8804](stylelint/stylelint#8804)) ([@taearls](https://github.com/taearls)). - Fixed: `selector-pseudo-element-no-unknown` false positives for `::scroll-button()` ([#8856](stylelint/stylelint#8856)) ([@Mouvedia](https://github.com/Mouvedia)).
| datasource | package | from | to | | ---------- | --------- | ------- | ------- | | npm | stylelint | 16.26.0 | 16.26.1 | ## [v16.26.1](https://github.com/stylelint/stylelint/blob/HEAD/CHANGELOG.md#16261---2025-11-28) It fixes numerous false positive bugs, including many in the `declaration-property-value-no-unknown` rule for the latest CSS specifications. - Fixed: `*-no-unknown` false positives for latest specs by integrating `@csstools/css-syntax-patches-for-csstree` ([#8850](stylelint/stylelint#8850)) ([@romainmenke](https://github.com/romainmenke)). - Fixed: `at-rule-no-unknown` false positives for `@function` ([#8851](stylelint/stylelint#8851)) ([@jeddy3](https://github.com/jeddy3)). - Fixed: `declaration-property-value-no-unknown` false positives for `attr()`, `if()` and custom functions ([#8853](stylelint/stylelint#8853)) ([@jeddy3](https://github.com/jeddy3)). - Fixed: `function-url-quotes` false positives when URLs require quoting ([#8804](stylelint/stylelint#8804)) ([@taearls](https://github.com/taearls)). - Fixed: `selector-pseudo-element-no-unknown` false positives for `::scroll-button()` ([#8856](stylelint/stylelint#8856)) ([@Mouvedia](https://github.com/Mouvedia)).
| datasource | package | from | to | | ---------- | --------- | ------- | ------- | | npm | stylelint | 16.26.0 | 16.26.1 | ## [v16.26.1](https://github.com/stylelint/stylelint/blob/HEAD/CHANGELOG.md#16261---2025-11-28) It fixes numerous false positive bugs, including many in the `declaration-property-value-no-unknown` rule for the latest CSS specifications. - Fixed: `*-no-unknown` false positives for latest specs by integrating `@csstools/css-syntax-patches-for-csstree` ([#8850](stylelint/stylelint#8850)) ([@romainmenke](https://github.com/romainmenke)). - Fixed: `at-rule-no-unknown` false positives for `@function` ([#8851](stylelint/stylelint#8851)) ([@jeddy3](https://github.com/jeddy3)). - Fixed: `declaration-property-value-no-unknown` false positives for `attr()`, `if()` and custom functions ([#8853](stylelint/stylelint#8853)) ([@jeddy3](https://github.com/jeddy3)). - Fixed: `function-url-quotes` false positives when URLs require quoting ([#8804](stylelint/stylelint#8804)) ([@taearls](https://github.com/taearls)). - Fixed: `selector-pseudo-element-no-unknown` false positives for `::scroll-button()` ([#8856](stylelint/stylelint#8856)) ([@Mouvedia](https://github.com/Mouvedia)).
| datasource | package | from | to | | ---------- | --------- | ------- | ------- | | npm | stylelint | 16.26.0 | 16.26.1 | ## [v16.26.1](https://github.com/stylelint/stylelint/blob/HEAD/CHANGELOG.md#16261---2025-11-28) It fixes numerous false positive bugs, including many in the `declaration-property-value-no-unknown` rule for the latest CSS specifications. - Fixed: `*-no-unknown` false positives for latest specs by integrating `@csstools/css-syntax-patches-for-csstree` ([#8850](stylelint/stylelint#8850)) ([@romainmenke](https://github.com/romainmenke)). - Fixed: `at-rule-no-unknown` false positives for `@function` ([#8851](stylelint/stylelint#8851)) ([@jeddy3](https://github.com/jeddy3)). - Fixed: `declaration-property-value-no-unknown` false positives for `attr()`, `if()` and custom functions ([#8853](stylelint/stylelint#8853)) ([@jeddy3](https://github.com/jeddy3)). - Fixed: `function-url-quotes` false positives when URLs require quoting ([#8804](stylelint/stylelint#8804)) ([@taearls](https://github.com/taearls)). - Fixed: `selector-pseudo-element-no-unknown` false positives for `::scroll-button()` ([#8856](stylelint/stylelint#8856)) ([@Mouvedia](https://github.com/Mouvedia)).
| datasource | package | from | to | | ---------- | --------- | ------- | ------- | | npm | stylelint | 16.26.0 | 16.26.1 | ## [v16.26.1](https://github.com/stylelint/stylelint/blob/HEAD/CHANGELOG.md#16261---2025-11-28) It fixes numerous false positive bugs, including many in the `declaration-property-value-no-unknown` rule for the latest CSS specifications. - Fixed: `*-no-unknown` false positives for latest specs by integrating `@csstools/css-syntax-patches-for-csstree` ([#8850](stylelint/stylelint#8850)) ([@romainmenke](https://github.com/romainmenke)). - Fixed: `at-rule-no-unknown` false positives for `@function` ([#8851](stylelint/stylelint#8851)) ([@jeddy3](https://github.com/jeddy3)). - Fixed: `declaration-property-value-no-unknown` false positives for `attr()`, `if()` and custom functions ([#8853](stylelint/stylelint#8853)) ([@jeddy3](https://github.com/jeddy3)). - Fixed: `function-url-quotes` false positives when URLs require quoting ([#8804](stylelint/stylelint#8804)) ([@taearls](https://github.com/taearls)). - Fixed: `selector-pseudo-element-no-unknown` false positives for `::scroll-button()` ([#8856](stylelint/stylelint#8856)) ([@Mouvedia](https://github.com/Mouvedia)).
| datasource | package | from | to | | ---------- | --------- | ------- | ------- | | npm | stylelint | 16.26.0 | 16.26.1 | ## [v16.26.1](https://github.com/stylelint/stylelint/blob/HEAD/CHANGELOG.md#16261---2025-11-28) It fixes numerous false positive bugs, including many in the `declaration-property-value-no-unknown` rule for the latest CSS specifications. - Fixed: `*-no-unknown` false positives for latest specs by integrating `@csstools/css-syntax-patches-for-csstree` ([#8850](stylelint/stylelint#8850)) ([@romainmenke](https://github.com/romainmenke)). - Fixed: `at-rule-no-unknown` false positives for `@function` ([#8851](stylelint/stylelint#8851)) ([@jeddy3](https://github.com/jeddy3)). - Fixed: `declaration-property-value-no-unknown` false positives for `attr()`, `if()` and custom functions ([#8853](stylelint/stylelint#8853)) ([@jeddy3](https://github.com/jeddy3)). - Fixed: `function-url-quotes` false positives when URLs require quoting ([#8804](stylelint/stylelint#8804)) ([@taearls](https://github.com/taearls)). - Fixed: `selector-pseudo-element-no-unknown` false positives for `::scroll-button()` ([#8856](stylelint/stylelint#8856)) ([@Mouvedia](https://github.com/Mouvedia)).
*-no-unknownfalse positives for latest specs by integrating@csstools/css-syntax-patches-for-csstree#8100declaration-property-value-no-unknownfalse positives forcalc-sizeandshapefunctions #8320declaration-property-value-no-unknownfalse positives for color function relative syntax #8347declaration-property-value-no-unknownfalse positives forlinear()#8379declaration-property-value-no-unknownfalse positives forscroll-stateoncontainer-type#8607declaration-property-value-no-unknownfalse positives foranchor()ofinset#8609declaration-property-value-no-unknownfalse positives forgradient(in color space)ofbackground#8610declaration-property-value-no-unknownfalse positives forbase-selectofappearance#8778JSDOM recently adopted
@csstools/css-syntax-patches-for-csstreewhich made me less reluctant to integrate it directly here. It seems to work well there and nothing surprising or alarming surfaced.The merging of various configs wasn't entirely correct before.
CSSTree supports appending definitions by leading with a pipe symbol
|.While our code always did overrides with the spread operator.
This matters when we are combining multiple sources (syntax patches from csstools, language options, rule config)