GN.*_*GN. 4 visual-studio-code prettier
在 VSCode 中使用Prettier扩展。
设置Single Quote为单人。
format onSave设置为 true。
还是... 当我点击保存时,单引号会转换为双引号..
为什么?为什么?为什么?为什么?
此外...
// in .eslint file
"quotes": [2, "single", { "avoidEscape": true }],
Run Code Online (Sandbox Code Playgroud)
还是... 当我点击保存时,单引号会转换为双引号..
我已经追踪到问题的根源。
当 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
Run Code Online (Sandbox Code Playgroud)
在上面的文件中根本没有提到间距首选项。所以我假设双引号有一些默认值。
| 归档时间: |
|
| 查看次数: |
3831 次 |
| 最近记录: |