ota-meshi / stylelint-config-recommended-vue

The recommended shareable Vue config for Stylelint.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`function-no-unknown` reported in SCSS

rchl opened this issue · comments

After updating to latest version, I've noticed that the SCSS blocks like:

<style lang="scss" scoped>
@use 'sass:math';

.foo {
    .bar {
        color: #bbb;
        padding-right: math.div(4, 2)
    }
}
</style>

now report an function-no-unknown error for math.div.

Probably because of this added code:

...(semver.gte(stylelintVersion, "14.5.0")
? {
"function-no-unknown": [true, { ignoreFunctions: ["v-bind"] }],
}

My config looks like this (+ some extra custom rules):

    extends: [
        'stylelint-config-standard',
        'stylelint-config-recommended-scss',
        'stylelint-config-recommended-vue/scss',
    ],

Thank you for posting this issue!

Hmmm... In the first place, I think that using stylelint-config-standard (stylelint-config-recommended) will report math.div.
https://github.com/stylelint/stylelint-config-recommended/blob/0a507c3bb0371725f83470fe52c87619b1e04dde/index.js#L22
stylelint-config-recommended-vue overrides this and allows v-bind.

It looks like stylelint-config-recommended-scss hasn't been modified to allow math.div.
https://github.com/stylelint-scss/stylelint-config-recommended-scss/blob/master/index.js

Maybe you need to open an issue in stylelint-config-recommended-scss as well.
This package should follow the changes in stylelint-config-recommended-scss.

Yeah, sounds reasonable that stylelint-config-recommended-scss should override that.
I would think that it should just disable function-no-unknown though, because whitelisting all functions that scss supports would probably not be very practical.

If stylelint-config-recommended-scss turns it off, I think stylelint-config-recommended-vue/scss should follow it 👍