-
-
Notifications
You must be signed in to change notification settings - Fork 975
Add color-function-alias-notation
#8499
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
Add color-function-alias-notation
#8499
Conversation
🦋 Changeset detectedLatest commit: d3daf20 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 |
Hi @jeddy3, could you please have a look when you have time? Thanks! |
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.
@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.
color-function-alias-notation
Co-authored-by: Richard Hallows <jeddy3@users.noreply.github.com>
@jeddy3 thank you for your review! I addressed all the comments. Let me know what you think. Thanks! |
PR packaged and instant preview available. Install locally:
|
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.
@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.
Co-authored-by: Richard Hallows <jeddy3@users.noreply.github.com>
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.
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.)
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, 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. 👍🏼
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.
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.
Co-authored-by: Richard Hallows <jeddy3@users.noreply.github.com>
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.
Looks better, thanks! 👍🏼
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.
@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.
| 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)).
| 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)).
Closes #8446
No, please read the README file.