Reputation: 6157
I created a Vue project via Quasar, picking Prettier as ESLint preset.
When I try the "reformat code" command, it doesn't follow completely the prettier rules. In the specific, I found problems when it has to ignore stuff.
For example:
Having these prettier rules (.prettierrc file):
{
"singleQuote": true,
"semi": false
}
when I try "reformat code" with this code
//prettier-ignore
name: "App"
it will convert double quotes to single quotes.
If I use "reformat with prettier" everything works fine, but is there a way to override the reformat code behavior?
I'm asking this also because in the commit changes dialog there is the "reformat code" option that I would like to use. I don't know if it's maybe possible to add a "reformat code with prettier" option there
Upvotes: 2
Views: 3740
Reputation: 93868
The IDEA code formatter is not supposed to respect //prettier-ignore
comments. But you can set up Prettier as the default formatter per instructions in https://www.jetbrains.com/help/idea/2021.1/prettier.html#ws_prettier_default_formatter to be used on Code > Reformat Code
Upvotes: 3