Disable function-no-unknown rule
rchl opened this issue · comments
The function-no-unknown
rule will complain about scss functions like math.div
and other.
Would it make sense to explicitly disable it in this config to cater for cases when extending a config that enables it?
Makes sense for SCSS indeed.
Hi there,
stylelint-scss@4.2.0
now has the scss/function-no-unknown
rule, so enabling the new rule seems to make sense:
{
"rules": {
"function-no-unknown": null,
"scss/function-no-unknown": true
}
}
It might seem like it does but it's one of those rules that will easily trigger in various projects and would need manual adjustments so IMO it's not something that should be enabled by default.
For example it triggers on this line:
in this repo because the custom
remove-where
function is not whitelisted.Surely. @rchl's idea seems to make sense to me. 👍🏼
Yeah, let's not enable the SCSS version as it would just trigger errors for any custom functions that the users are using.
I think this doesn't work for negative values
margin-left: -#{$value} /* Unexpected unknown function "-" scss/function-no-unknown */
margin-left: -#{math.div($value, 2)} /* Unexpected unknown function "-#{math.div" scss/function-no-unknown */
@amk221 could you please open a new Github issue about the bug? :)
Sure, is there a way I can write a failing test? I'm not familiar with the project and I couldn't find any
@amk221 the rule and the tests can be found from the stylelint-scss
repo: https://github.com/stylelint-scss/stylelint-scss/tree/master/src/rules/function-no-unknown