stylelint-stylistic / stylelint-stylistic

A collection of stylistic rules for Stylelintin in a form of a plugin.

Home Page:https://www.npmjs.com/package/@stylistic/stylelint-plugin

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problem with unknown rule errors

lubomirblazekcz opened this issue · comments

Describe the documentation issue

https://stackblitz.com/edit/vitejs-vite-zfhnbk?file=.stylelintrc&terminal=dev

Currently I use @stylistic/stylelint-plugin and add some rules to the config, it throws unknown rule errors. I am not sure if this is a doc issue or not, because I followed the instructions. Then I noticed that there is @stylistic/stylelint-config and with that it works correctly.

What solution would you like to see?

If this is intended behaviour maybe it should be more clear in the instructions? I've come from https://github.com/elirasza/stylelint-stylistic and my first move was to change the plugin extend and prefix the rules and that didn't work as expected.

Oh I see now, I used extends in the config, not plugins. In that case it would be good to make the usage little more clear, it easily missable when people migrate from other plugins/configs.

Thanks for your feedback!

Yes, there is a significant difference between a plugin and a config.

A config uses some of the rules already available in Stylelint or added by plugins. It applies specific settings to them, which may or may not suit you (and then you can override them).

A plugin does not provide specific settings. It only adds rules not present in Stylelint itself, giving you the ability to customize them to suit your needs.

I'll think about how to be more explicit about which section of the project config the stylistic plugin or config should be specified in.