-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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: can not parse style in '.vue' #8489
Comments
I tried setting parser to vue in overrides, but it didn't work. like that: module.exports = {
endOfLine: 'auto',
trailingComma: 'none',
arrowParens: 'avoid',
singleQuote: true,
insertPragma: false,
HTMLWhitespaceSensitivity: 'ignore',
overrides: [
{
files: ['*.less', '*.css'],
options: {
parser: 'vue',
singleQuote: false,
insertPragma: false
}
}
]
}; |
Prettier 2.0.5 --parser vue
--single-quote Input: <template>
<div class="container"></div>
</template>
<style lang="less" scoped>
.container {
content: "i want double quotes";
}
</style> Output: <template>
<div class="container"></div>
</template>
<style lang="less" scoped>
.container {
content: 'i want double quotes';
}
</style>
|
Settings should be
|
@fisker I have tried this configuration, but if set this way, then the JS in the VUE file will also be asked to use double quotes at the same time, I just want to set double quotes in the CSS and single quotes in the JS |
I understand your problem now, we can't do this now. |
Work around for now, you can use
|
Duplicate of #5378 |
May I know if there are plans to mention this task, or not. Emm...... It's embarrassing. I have to give up use it in my project. |
There are no immediate plans to address this issue. It's pretty complex. |
Hey thorn0, |
Sorry, I didn't find the settings I needed on https://prettier.io/playground.
I want to set the style support for
vue
files in prettier, but I always set it incorrectly. I can formatless
andcss
files, but always not forvue
files.Prettier 2.0.5
I can't provide that.
.pretterrc.js
Input:
Output:
package.json
Expected behavior:
can use double quotes in style tag
The text was updated successfully, but these errors were encountered: