-
Notifications
You must be signed in to change notification settings - Fork 97
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 scss/function-no-unknown
rule
#591
Add scss/function-no-unknown
rule
#591
Conversation
export const ALL_FUNCTIONS = Object.freeze([ | ||
...GLOBAL_FUNCTIONS, | ||
...COLOR_FUNCTIONS | ||
]); |
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.
[ask] Is this a smart way to get all Sass functions?
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.
not sure if there is a better way than to manually list them like you have done.
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 will keep as-is if there is no objection.
code: "a { color: adjust-color(#6b717f, $red: 15); }" | ||
}, | ||
{ | ||
code: "a { color: color.adjust(#6b717f, $red: 15); }" |
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.
[ask] This case fails now with the following message:
Unexpected unknown function "color.adjust" (scss/function-no-unknown)
If supporting a {module}.{func}
notation, is there a smart way? I'm concerned about the following case:
@use "sass:color" as c;
a { color: c.adjust(#6b717f, $red: 15); }
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.
One option is simply not to support @use "sass:color" as c
if it gets too difficult to implement.
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.
Indeed, as the first implementation, not supporting as
sounds good. 👍🏼
I'm not familiar with Sass, so I have some questions about the implementation. |
stylelint/stylelint#5916 (maybe
|
I've bumped |
@ybiquitous Does this rule now depend on stylelint version 14.5.1 or newer or is there backwards compatibility? |
Yes. The new rule requires
Yes. Unless users don't enable the new rule, their stylelint analysis should not change. |
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 good now! 👍
Thanks @ybiquitous ! Released now in https://github.com/stylelint-scss/stylelint-scss/releases/tag/v4.2.0 |
@kristerkari Thank you! 😊 |
@kristerkari Hi, any plan to include this rule to |
@chalkygames123 Here is a reason not to include this rule to |
I see. Thanks for letting me know! |
scss/function-no-unknown
#581function-no-unknown
rule not working well with SCSS #589