angular - 有没有办法在 VS Code 快速修复中将双引号更改为单引号?

标签 angular visual-studio-code

在 Angular 中使用 VSCode 时,我将我的导入语句列表写成这样:

import { AppComponent } from './app.component';

VSCode Quick Fix 像这样添加它们:

import { WelcomeComponent } from "app/home/welcome.component";

有没有办法通过 VS Code 设置更改 VS Code Quick Fix 以使用单引号而不是双引号?

最佳答案

如果您的项目有一个 .editorconfig 文件,请尝试添加以下行:

[*]
...
quote_type = single

我发现 .editorconfig 文件似乎覆盖了 vscode、prettier、tslint 等的任何设置,而且它似乎默认为单引号以外的内容。

如果不需要,也可以删除该文件。

有关 editorconfig 的更多信息.

关于angular - 有没有办法在 VS Code 快速修复中将双引号更改为单引号?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44716087/

相关文章:

angular - QueryList 未使用动态组件更新

Angular - 模型之间的循环依赖

python - 在 Visual-studio-code 中设置 python virtualEnv 时出错

visual-studio-code - 用户定义代码段中的 vscode if/else 条件

visual-studio-code - VS Code 显示缺少对 AzureFunctions v1 fsx 文件的 netstandard 的引用

angular - 强制 Angular2 在导航时重新加载组件

javascript - 当我在同一浏览器上对另一个选项卡进行任何更改时如何刷新选项卡数据

go - 如何使用 Angular2 访问请求 header ?

node.js - Pop-OS/Ubuntu 更新后找不到模块 '../build/Release/zmq.node'

visual-studio-code - 用于 html 的 Vscode 编辑器 emmet 在 twig 文件中不起作用。如何启用此功能?