Closed jeremychone closed 7 years ago
you can add "postcss.validate": false
to the config, combined with smth like stylelint for custom validation, should work
Thanks very much for the quick replace. I get the postcssvalidate: false
in the user config, but not sure about the combined with smth like styleint for custom validation. Not very familiar with it right now. Ideally, I would like to only exlude the @define-mixing and @mixin for validation and keep everything else, which I assume your proposal will take care of.
Any pointer for the "smth like styleint..."
So, it is interesting, in the postcss.tmLanguage
file there is <string>@mixin|@function</string>
so it seems to have some support for mixin. Just missing the @define-mixin
support.
Is postcss.tmLanguage
the right place to add this support? (to still have the postcss validation but with mixin support) or am I missing something?
Well no, the .tmLanguage files have nothing to do with validation. And since there are some questions from time to time about validation in this plugin I'm feeling it is a necessity to shed some light on it. At first place, the plugin was made to provide syntax highlighting for postcss so you can use files with extension .css or .pcss or w'e and have syntax highlighting and the files being recognized by vscode as a postcss files, and that's what .tmLanguage files for. Later I've being asked to add validation, so here you go, you now have validation, tho it's very strict about any "postcss" only constructions like @define-mixin, @custom-media etc, and the reason for it: behind the scene, it's scss validator, and ideally it needs its own with the custom rules mentioned above. I'm honestly not planning to write separate validator for this plugin, partly because it would require time, partly because the plugin was made for syntax highlighting in the first place.
closing since question is answered
Sorry for the delay answer. Thank you for your details answer. Sorry for the confusion about the tmLanguage. I get it now and I can manage with turning validation off or looking at forking the scss validator, but as you said, it seems to be quite a bit of work.
Thanks a lot for this extension, it is very helpful.
We are using postcss-mixins and we are getting some highlighting errors.
Is that to be expected or something we should add/configure.
What would it take to add postcss-mixins support? We can try to see if we can help.