visual-studio-code - 如何配置 svelte 格式化程序以尊重 HTML 中的换行符?
问题描述
我有以下苗条的文件:
<script>
import { text } from 'svelte/internal';
</script>
<style lang="scss">
form {
label, input {
font-weight: 800;
}
}
</style>
<form>
<label for="list">List</label>
<input type="text" id="list" />
<label for="password">Password</label>
<input type="password" id="password" />
</form>
当我在这个文件上使用 shift + alt + f 这是我的输出:
<script>
import { text } from 'svelte/internal';
</script>
<style lang="scss">
form {
label,
input {
font-weight: 800;
}
}
</style>
<form><label for="list">List</label> <input type="text" id="list" /> <label for="password">Password</label> <input type="password" id="password" /></form>
所以现在我的标签,CSS 中的输入在不同的行中,而我的 HTML 都在一行中。这与我想要的完全相反。
如何设置 vscode 以正确格式化此文件?
解决方案
推荐阅读
- scala - 基于 Spark Scala 特定时间窗口的组计数
- javascript - 递归函数中的异步等待不起作用?
- pandas - 如何替换 DataFrame 列中的字符串(例如:[12-12-12] io [12/12/12])
- python - Django - 单元测试对象的选择不像预期的那样工作
- javascript - android webview 在 PWA 框架中变为空白
- sql - SQL 按计数和日期分组
- html - 如何在css的一页中创建不同的位置背景
- android - 在浏览器中启动 vue 移动网站时重定向到 android 应用程序
- javascript - JavaScript 函数不会执行函数中的所有代码
- python - 擦除 matplotlib 3D 条形图的地板