-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
Prettier's parser why not just "css" #2
Comments
I met this problem,too |
Sorry for the long wait for a reply. I did not realize I was not watching my own repo. That has now been fixed. Thank you both for your interest in stylelint-prettier. Prettier and Stylelint both supports multiple css syntaxes - css, scss, sass, less. Each of these syntaxes have their own parser. If I were to tell prettier to always use the css parser then for example, it would never use the scss parser for scss files and thus scss-specific functionality such as formatting maps would not work. You can teach Prettier to use a particular parser for a file extension it does not already know about by using configuration overrides. Adding the following to your .prettierrc should tell it to use the css parer for .wxss files {
"overrides": [
{
"files": "*.wxss",
"options": { "parser": "css" }
}
]
} Because stylelint-prettier reads prettier's config I would expect that these files would then be checked using the css parser within prettier. I'll leave this issue open for now. Could you please let me know if specifying the overrides in your .prettierrc works for you? |
I have just released |
thanks! |
Problem solved, thanks |
Question
This plugin use
prettier.getFileInfo
to decide which parser to use. But this plugin is work with stylelint, so the parser maybe only need becss
?Problem
In China there is someting called miniProgram. It's style file use css syntax but use
wxss
as the extension. I want use this plugin inminiProgram
, but Prettier don't know*.wxss
file. If I told Prettier usecss
parser, it will work fine.Or
If the parser can not just be
css
, maybe usecss
as default parser wheninferredParser
is null is a idea.I'm happy to send a PR :)
The text was updated successfully, but these errors were encountered: