Skip to content

Conversation

EduardAkhmetshin
Copy link
Contributor

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

Closes #8446

Is there anything in the PR that needs further explanation?

No, please read the README file.

Copy link

changeset-bot bot commented Mar 30, 2025

🦋 Changeset detected

Latest commit: d3daf20

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

@EduardAkhmetshin
Copy link
Contributor Author

Hi @jeddy3, could you please have a look when you have time? Thanks!

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.

@EduardAkhmetshin Thank you for the pull request. It's a fantastic start, especially the:

  • autofix incorporating computeEditInfo
  • cheap check to avoid unnecessary parsing

Having seen the implementation and the documentation, I think color-function-alias-notation is a more appropriate and consistent name. Would you mind changing it, please?

I've made some commitable suggestions to the docs to make them consistent with our other rule READMEs.

The code looks amazing for a first stab, and I've made only one suggestion: revise the range to the function name.

@jeddy3 jeddy3 changed the title Add color-alias-function-notation Add color-function-alias-notation Mar 31, 2025
@jeddy3 jeddy3 changed the title Add color-function-alias-notation Add color-function-alias-notation Mar 31, 2025
@EduardAkhmetshin
Copy link
Contributor Author

@jeddy3 thank you for your review! I addressed all the comments. Let me know what you think. Thanks!

Copy link
Contributor

github-actions bot commented Mar 31, 2025

PR packaged and instant preview available.

View demo website

Install locally:

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

(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.

@EduardAkhmetshin Thank you for making the changes. It's looking great.

The range is better now. You can see it in action in this demo. The red line is just under the function name. You can also hover over the function name and select "Quick Fix..." to see autofix in action.

I've made one additional suggestion (that should fix one of the tests).

Adding the rule to the user guide should fix another.

EduardAkhmetshin and others added 2 commits March 31, 2025 21:45
Co-authored-by: Richard Hallows <jeddy3@users.noreply.github.com>
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.

Excellent, thank you. LGTM.

(We typically wait for a 2nd review on new rules before merging, as a second pair of eyes usually spots things the first missed.)

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.

LGTM, too 👍🏼

Personally, "with-alpha"/"without-alpha" seems a bit more understandable than "with-a"/"without-a" ("a" slightly looks like the indefinite article), but it's just my preference. If anyone else doesn't mind it, I'm okay. 👍🏼

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.

Personally, "with-alpha"/"without-alpha" seems a bit more understandable than "with-a"/"without-a" ("a" slightly looks like the indefinite article)

SGTM. I hoped someone would suggest something better, and I agree that alpha is more understandable.

@EduardAkhmetshin Can you update the option names, please? I think we'll be good to merge after that.

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.

Looks better, thanks! 👍🏼

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.

@EduardAkhmetshin Thanks for making the changes. LGTM.

Thank you for your first contribution to Stylelint. Many users will benefit from it as we'll turn this rule on in our standard config.

@jeddy3 jeddy3 merged commit a0df0b0 into stylelint:main Apr 2, 2025
19 checks passed
renovate bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Apr 9, 2025
| datasource | package   | from    | to      |
| ---------- | --------- | ------- | ------- |
| npm        | stylelint | 16.17.0 | 16.18.0 |


## [v16.18.0](https://github.com/stylelint/stylelint/blob/HEAD/CHANGELOG.md#16180---2025-04-06)

It adds 2 new rules and fixes 2 bugs. We've turned on these rules, and the `syntax-string-no-invalid` and `layer-name-pattern` ones from recent releases, in our [standard config](https://www.npmjs.com/package/stylelint-config-standard).

-   Added: `color-function-alias-notation` rule ([#8499](stylelint/stylelint#8499)) ([@EduardAkhmetshin](https://github.com/EduardAkhmetshin)).
-   Added: `container-name-pattern` rule ([#8498](stylelint/stylelint#8498)) ([@nate10j](https://github.com/nate10j)).
-   Fixed: `declaration-property-value-no-unknown` false positives for `math` of `font-size` ([#8495](stylelint/stylelint#8495)) ([@otomad](https://github.com/otomad)).
-   Fixed: `font-family-no-missing-generic-family-keyword` false positives for `math` ([#8489](stylelint/stylelint#8489)) ([@otomad](https://github.com/otomad)).
renovate bot added a commit to andrei-picus-tink/auto-renovate that referenced this pull request Apr 9, 2025
| datasource | package   | from    | to      |
| ---------- | --------- | ------- | ------- |
| npm        | stylelint | 16.17.0 | 16.18.0 |


## [v16.18.0](https://github.com/stylelint/stylelint/blob/HEAD/CHANGELOG.md#16180---2025-04-06)

It adds 2 new rules and fixes 2 bugs. We've turned on these rules, and the `syntax-string-no-invalid` and `layer-name-pattern` ones from recent releases, in our [standard config](https://www.npmjs.com/package/stylelint-config-standard).

-   Added: `color-function-alias-notation` rule ([#8499](stylelint/stylelint#8499)) ([@EduardAkhmetshin](https://github.com/EduardAkhmetshin)).
-   Added: `container-name-pattern` rule ([#8498](stylelint/stylelint#8498)) ([@nate10j](https://github.com/nate10j)).
-   Fixed: `declaration-property-value-no-unknown` false positives for `math` of `font-size` ([#8495](stylelint/stylelint#8495)) ([@otomad](https://github.com/otomad)).
-   Fixed: `font-family-no-missing-generic-family-keyword` false positives for `math` ([#8489](stylelint/stylelint#8489)) ([@otomad](https://github.com/otomad)).
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 color-function-alias-notation
4 participants