V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
17681880207
V2EX  ›  问与答

各位大佬,求问一个 Prettier 配置问题。

  •  
  •   17681880207 · Oct 23, 2023 · 1024 views
    This topic created in 931 days ago, the information mentioned may be changed or developed.

    vscode 使用 prettier 进行格式化。
    有一个 eslint-plugin-vue 的配置 “vue/singleline-html-element-content-newline”:

    <template>
      <div>
        aaa
      </div>
    </template>
    

    格式化之后:

    <template>
      <div>aaa</div>
    </template>
    

    有没有 prettier 配置,有办法让 aaa 保留在新的一行?

    相关文档: https://eslint.vuejs.org/rules/singleline-html-element-content-newline.html

    2 replies    2023-11-06 11:06:25 +08:00
    stardewValley
        1
    stardewValley  
       Oct 23, 2023
    "htmlWhitespaceSensitivity": "ignore"
    17681880207
        2
    17681880207  
    OP
       Nov 6, 2023
    @stardewValley
    额,老哥这个方法试过了,并没有什么效果,依旧是会换行。😗
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2842 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 15:34 · PVG 23:34 · LAX 08:34 · JFK 11:34
    ♥ Do have faith in what you're doing.