Javascript VsCode未使用单引号格式化TS/JS文件
对VS代码进行最新更新后,在windows中按Ctrl+Shift+F时,它将自动运行 将所有代码格式化为双引号而不是单引号,尽管我将其设置为仅使用单引号 这是我的设置文件:Javascript VsCode未使用单引号格式化TS/JS文件,javascript,typescript,visual-studio-code,prettier,Javascript,Typescript,Visual Studio Code,Prettier,对VS代码进行最新更新后,在windows中按Ctrl+Shift+F时,它将自动运行 将所有代码格式化为双引号而不是单引号,尽管我将其设置为仅使用单引号 这是我的设置文件: { "[typescript]": { "editor.defaultFormatter": "esbenp.prettier-vscode" }, "typescript.updateImportsOnFileMove.enabled": "always", "[javascript]": { "edit
{
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"typescript.updateImportsOnFileMove.enabled": "always",
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"atlascode.jira.workingSite": {
"baseUrlSuffix": "atlassian.net"
},
"yaml.schemas": {
"file:///c%3A/Users/kevin/.vscode/extensions/atlassian.atlascode-2.1.5/resources/schemas/pipelines-schema.json": "bitbucket-pipelines.yml"
},
"window.zoomLevel": -1,
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"git.autofetch": true,
"javascript.preferences.quoteStyle": "single",
"typescript.preferences.quoteStyle": "single",
"prettier.jsxSingleQuote": true,
"prettier.singleQuote": true
}
还有其他人在处理这件事吗
谢谢 从您的设置文件中,您似乎正在使用prettier进行代码格式化。 在最新更新中,prettier将读取配置从公共设置文件更改为prettier设置的专用文件。您可以通过他们提供的许多选项来配置prettier 示例(JSON): 创建
.prettierrc
文件,用JSON或YAML编写,扩展名可选:.JSON/.YAML/.yml(无扩展名优先)
.prettierrc
{
"singleQuote": true
}
然后在settings.json
(vscode设置文件)中提供.prettierrc
文件的绝对路径
settings.json
...
"prettier.configPath": "./.prettierrc"
...
希望这有帮助 从您的设置文件中,您似乎正在使用prettier进行代码格式化。 在最新更新中,prettier将读取配置从公共设置文件更改为prettier设置的专用文件。您可以通过他们提供的许多选项来配置prettier 示例(JSON): 创建
.prettierrc
文件,用JSON或YAML编写,扩展名可选:.JSON/.YAML/.yml(无扩展名优先)
.prettierrc
{
"singleQuote": true
}
然后在settings.json
(vscode设置文件)中提供.prettierrc
文件的绝对路径
settings.json
...
"prettier.configPath": "./.prettierrc"
...
希望这有帮助 您使用的是prettier吗?是的,正如您从代码段中看到的,我已经检查了prettier中的设置以使用单引号。您是否使用prettier?我是,正如您从代码段中看到的,我已经检查了prettier中的设置以使用单引号