visual-studio-code - 更漂亮的 VSCode。单引号设置,但总是将其更改为双引号
问题描述
Prettier
在 VSCode 中使用扩展。设置
Single Quote
为单。format onSave
设置为真。
仍然...... 当我点击保存时,单引号被转换为双引号......
为什么?为什么?为什么?为什么?
此外...
- 我已将 eslint 设置为使用单引号
- 我什至从 VSCode 中删除了 eslint 扩展。
// in .eslint file
"quotes": [2, "single", { "avoidEscape": true }],
仍然...... 当我点击保存时,单引号被转换为双引号......
为什么?
解决方案
我已经追查到问题的根源。
当 VSCode 在检查时尝试重新格式化文本时,似乎有一些配置级别将被format on save
检查。
- 更漂亮的扩展配置
- .eslintrc
- .editorconfig
我仍然不确定他们按什么顺序运行,因此谁说了算。
但就我而言,一个非常基本.editorconfig
的问题。删除此文件修复了它。
# EditorConfig https://editorconfig.org/
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_size = 2
indent_style = space
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false
在文件 ^^ 中根本没有提到间距首选项。所以我假设双引号有一些默认值。
推荐阅读
- react-native - 如何在 react-native 中退出我的 Android 应用程序?
- python - Selenium window_handles 不适用于 javascript 按钮
- docker - Docker Hub:自动构建的存储库链接
- powerbi - 有没有办法将实时 powerBi 连接转换为导入数据?
- python - 为什么 Unicode '\u0332' 不会在空格 '\u0020' 下划线?
- java - 删除 Java 版本并保留其他已安装的版本
- node.js - 散列通过,比较结果
- android - 从 Unity Google Play 游戏服务插件调用 games.players.get 时出错
- php - 如何通过父对象的关系过滤laravel中的数据
- android - 浓缩咖啡,查找对话框并关闭它