VSCode 单双引号自动替换 [英] VSCode single to double quote automatic replace

查看:87
本文介绍了VSCode 单双引号自动替换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在 Vue Component.vue 文件上执行 Format Document 命令时,VSCode 将所有单引号字符串替换为双引号字符串.

When I execute a Format Document command on a Vue Component.vue file VSCode replace all single quoted string with double quoted string.

在我的特定情况下,此规则与需要单引号的 electron-vue lint 配置相冲突.

In my specific case this rule conflicts with electron-vue lint configuration that require singlequote.

我没有安装更漂亮的扩展程序(我的设置中没有 prettier.singleQuote)

I don't have prettier extensions installed (no prettier.singleQuote in my setting)

如何自定义 VSCode 来避免这种情况?

How to customize VSCode to avoid this?

推荐答案

我没有安装 prettier 扩展,但是在阅读了 可能重复 答案我从头开始添加到我的用户设置中 (UserSetting.json, Ctrl+, 快捷键):

I dont have prettier extension installed, but after reading the possible duplicate answer I've added from scratch in my User Setting (UserSetting.json, Ctrl+, shortcut):

"prettier.singleQuote": true

绿色警告的一部分(未知配置设置)不再替换单引号.

A part a green warning (Unknown configuration setting) the single quotes are no more replaced.

我怀疑漂亮的扩展程序不可见,而是嵌入在 Vetur 扩展名.

I suspect that the prettier extension is not visible but is embedded inside the Vetur extension.

这篇关于VSCode 单双引号自动替换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆