-
-
Notifications
You must be signed in to change notification settings - Fork 986
Add support for customSyntax with function export
#8834
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
Conversation
🦋 Changeset detectedLatest commit: 5b90cc0 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 |
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.
We could update the docs here:
https://github.com/stylelint/stylelint/blob/main/docs/user-guide/options.md?plain=1#L93
Or maybe updating the PostCSS docs would be better? 🤔
https://postcss.org/docs/how-to-write-custom-syntax#syntax
|
I think essentially |
|
I am unsure of we should update the documentation and error message. I think it would be fine to only change this line: if (typeof customSyntax === 'object' || typeof customSyntax === 'function') {Then Stylelint is a bit more graceful in what it accepts but without promoting further proliferation of this pattern that goes outside the documented PostCSS API. |
|
Okay, changeset is minimal now, just the |
ryo-manba
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, thanks!
|
BTW I guess the reason why it worked when passing |
|
This PR is packaged and the instant preview is available (5b90cc0). View the demo website. Install it locally: npm i -D https://pkg.pr.new/stylelint@5b90cc0 |
|
@silverwind |
|
Done, sorry I forgot this repo had generated files checked into source control. |
customSyntax with function exportcustomSyntax with function export
romainmenke
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.
Thank you. LGTM 👍
| datasource | package | from | to | | ---------- | --------- | ------- | ------- | | npm | stylelint | 16.25.0 | 16.26.0 | ## [v16.26.0](https://github.com/stylelint/stylelint/blob/HEAD/CHANGELOG.md#16260---2025-11-21) It adds 1 feature and fixes 2 bugs. - Added: support for `customSyntax` with function export ([#8834](stylelint/stylelint#8834)) ([@silverwind](https://github.com/silverwind)). - Fixed: `custom-property-no-missing-var-function` false positives for style query in `if()` function ([#8813](stylelint/stylelint#8813)) ([@sajdakabir](https://github.com/sajdakabir)). - Fixed: `media-feature-range-notation` false positives for multiple queries and `except: exact-value` ([#8832](stylelint/stylelint#8832)) ([@jeddy3](https://github.com/jeddy3)).
| datasource | package | from | to | | ---------- | --------- | ------- | ------- | | npm | stylelint | 16.25.0 | 16.26.0 | ## [v16.26.0](https://github.com/stylelint/stylelint/blob/HEAD/CHANGELOG.md#16260---2025-11-21) It adds 1 feature and fixes 2 bugs. - Added: support for `customSyntax` with function export ([#8834](stylelint/stylelint#8834)) ([@silverwind](https://github.com/silverwind)). - Fixed: `custom-property-no-missing-var-function` false positives for style query in `if()` function ([#8813](stylelint/stylelint#8813)) ([@sajdakabir](https://github.com/sajdakabir)). - Fixed: `media-feature-range-notation` false positives for multiple queries and `except: exact-value` ([#8832](stylelint/stylelint#8832)) ([@jeddy3](https://github.com/jeddy3)).
Closes #8833
Typescript types are already correct because type
interfacematchesfunction.