Skip to content

Conversation

ryo-manba
Copy link
Member

Which issue, if any, is this issue related to?

Closes #8405

Is there anything in the PR that needs further explanation?

No, it's self-explanatory.

Copy link

changeset-bot bot commented Mar 15, 2025

🦋 Changeset detected

Latest commit: 72bb54d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
stylelint Minor

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

Copy link
Contributor

github-actions bot commented Mar 15, 2025

Try the Instant Preview in Online Demo

Stylelint Online Demo

Install the Instant Preview to Your Local

npm i -D https://pkg.pr.new/stylelint@8472

View Commit

Copy link
Member

@jeddy3 jeddy3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ryo-manba Thank you for working on this. Looking good.

I've added a couple of suggestions.

ryo-manba and others added 6 commits March 16, 2025 21:10
Co-authored-by: Richard Hallows <jeddy3@users.noreply.github.com>
Co-authored-by: Richard Hallows <jeddy3@users.noreply.github.com>
Co-authored-by: Richard Hallows <jeddy3@users.noreply.github.com>
Co-authored-by: Richard Hallows <jeddy3@users.noreply.github.com>
Co-authored-by: Richard Hallows <jeddy3@users.noreply.github.com>
@ryo-manba ryo-manba changed the title Add ignoreAtRulePreludes: [] to length-zero-no-unit Add ignorePreludeOfAtRules: [] to length-zero-no-unit` Mar 16, 2025
@ryo-manba ryo-manba changed the title Add ignorePreludeOfAtRules: [] to length-zero-no-unit` Add ignorePreludeOfAtRules: [] to length-zero-no-unit Mar 16, 2025
@ryo-manba ryo-manba requested review from Mouvedia and jeddy3 March 16, 2025 12:23
@ryo-manba
Copy link
Member Author

@jeddy3 @Mouvedia
Thanks for the suggestion. Fixed!
Rename ignoreAtRulePreludes to ignorePreludeOfAtRules

Copy link
Member

@ybiquitous ybiquitous left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM, but I've left a few minor suggestions. Can you take a look?

<!-- prettier-ignore -->
```css
@--bar-baz 0px;
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[suggestion] Would you be willing to add a more practical example? E.g.

"ignorePreludeOfAtRules": ["media"]
@media (height > 0px) {}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's replace --foo with media and keep the ^--bar custom at-rule example to show both use cases.


testRule({
ruleName,
customSyntax: 'postcss-scss',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[suggestion] If possible, we'd like to prefer standard syntaxes over non-standard ones in the codebase. How about testing with standard syntaxes like @media (height > 0px) {} instead of the SCSS syntax?

Copy link
Member

@jeddy3 jeddy3 Mar 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we:

  • add another test case for media without custom syntax
  • change the current test case to only use /^mix/

We do prefer standard syntaxes, but we also typically include non-standard test cases when the original request is in aid of supporting non-standard syntax so that we're confident we've addressed the issue.

This approach will let us do both.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jeddy3 @ybiquitous
Thanks for the review! I've fixed it.
Add media query test case and example

@ryo-manba ryo-manba requested a review from ybiquitous March 20, 2025 08:08
Copy link
Member

@jeddy3 jeddy3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making the changes. LGTM.

@jeddy3 jeddy3 merged commit e63f2f8 into main Mar 20, 2025
19 checks passed
@jeddy3 jeddy3 deleted the issue-8405 branch March 20, 2025 10:24
renovate bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Mar 28, 2025
| datasource | package   | from    | to      |
| ---------- | --------- | ------- | ------- |
| npm        | stylelint | 16.16.0 | 16.17.0 |


## [v16.17.0](https://github.com/stylelint/stylelint/blob/HEAD/CHANGELOG.md#16170---2025-03-26)

It adds 1 new rule, support for `languageOptions` to 2 rules, 1 option to a rule, the `--compute-edit-info` CLI flag (along with support for `EditInfo` in 3 rules), and fixes 1 bug. `EditInfo` is useful for automated fixing tools and editor integrations.

-   Added: `layer-name-pattern` rule ([#8474](stylelint/stylelint#8474)) ([@ryo-manba](https://github.com/ryo-manba)).
-   Added: `--compute-edit-info` CLI flag ([#8473](stylelint/stylelint#8473)) ([@ryo-manba](https://github.com/ryo-manba)).
-   Added: `ignorePreludeOfAtRules: []` to `length-zero-no-unit` ([#8472](stylelint/stylelint#8472)) ([@ryo-manba](https://github.com/ryo-manba)).
-   Added: `at-rule-no-unknown` support for `languageOptions` ([#8475](stylelint/stylelint#8475)) ([@ryo-manba](https://github.com/ryo-manba)).
-   Added: `property-no-unknown` support for `languageOptions` ([#8476](stylelint/stylelint#8476)) ([@ryo-manba](https://github.com/ryo-manba)).
-   Added: `declaration-block-no-redundant-longhand-properties` support for computing `EditInfo` ([#8482](stylelint/stylelint#8482)) ([@pamelalozano16](https://github.com/pamelalozano16)).
-   Added: `function-url-quotes` support for computing `EditInfo` ([#8483](stylelint/stylelint#8483)) ([@pamelalozano16](https://github.com/pamelalozano16)).
-   Added: `selector-attribute-quotes` support for computing `EditInfo` ([#8484](stylelint/stylelint#8484)) ([@pamelalozano16](https://github.com/pamelalozano16)).
-   Fixed: `custom-property-pattern` false negatives for `@property` preludes ([#8468](stylelint/stylelint#8468)) ([@rohitgs28](https://github.com/rohitgs28)).
renovate bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Mar 28, 2025
| datasource | package   | from    | to      |
| ---------- | --------- | ------- | ------- |
| npm        | stylelint | 16.16.0 | 16.17.0 |


## [v16.17.0](https://github.com/stylelint/stylelint/blob/HEAD/CHANGELOG.md#16170---2025-03-26)

It adds 1 new rule, support for `languageOptions` to 2 rules, 1 option to a rule, the `--compute-edit-info` CLI flag (along with support for `EditInfo` in 3 rules), and fixes 1 bug. `EditInfo` is useful for automated fixing tools and editor integrations.

-   Added: `layer-name-pattern` rule ([#8474](stylelint/stylelint#8474)) ([@ryo-manba](https://github.com/ryo-manba)).
-   Added: `--compute-edit-info` CLI flag ([#8473](stylelint/stylelint#8473)) ([@ryo-manba](https://github.com/ryo-manba)).
-   Added: `ignorePreludeOfAtRules: []` to `length-zero-no-unit` ([#8472](stylelint/stylelint#8472)) ([@ryo-manba](https://github.com/ryo-manba)).
-   Added: `at-rule-no-unknown` support for `languageOptions` ([#8475](stylelint/stylelint#8475)) ([@ryo-manba](https://github.com/ryo-manba)).
-   Added: `property-no-unknown` support for `languageOptions` ([#8476](stylelint/stylelint#8476)) ([@ryo-manba](https://github.com/ryo-manba)).
-   Added: `declaration-block-no-redundant-longhand-properties` support for computing `EditInfo` ([#8482](stylelint/stylelint#8482)) ([@pamelalozano16](https://github.com/pamelalozano16)).
-   Added: `function-url-quotes` support for computing `EditInfo` ([#8483](stylelint/stylelint#8483)) ([@pamelalozano16](https://github.com/pamelalozano16)).
-   Added: `selector-attribute-quotes` support for computing `EditInfo` ([#8484](stylelint/stylelint#8484)) ([@pamelalozano16](https://github.com/pamelalozano16)).
-   Fixed: `custom-property-pattern` false negatives for `@property` preludes ([#8468](stylelint/stylelint#8468)) ([@rohitgs28](https://github.com/rohitgs28)).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Add ignoreAtRulePreludes: [] to length-zero-no-unit
4 participants