0

Prettier - Code formatter在 VisualStudio Code 中使用 with node.js 来帮助进行代码格式化。

它几乎是完美的,但坚持在include我在服务器端代码中执行的每个操作后添加一个缩进。

示例(美化后)

<div class="container-fluid">

  <%- include('../partials/billing/currentPlan'); %>

    <%- include('../partials/billing/accountStatus'); %>

      <% if (user.subscriptionActive===true) { %>
      
        <%- include('../partials/billing/paymentPortal'); %>

          <% } else { %>

            <%- include('../partials/pricingMatrix'); %>

              <% } %>

</div>

可以想象,它使跟踪 html 嵌套变得非常困难。

我想要更像的东西

<div class="container-fluid">

  <%- include('../partials/billing/currentPlan'); %>

  <%- include('../partials/billing/accountStatus'); %>

  <% if (user.subscriptionActive===true) { %>
      
    <%- include('../partials/billing/paymentPortal'); %>

  <% } else { %>

    <%- include('../partials/pricingMatrix'); %>

  <% } %>

</div>

我必须更改哪个设置才能使其忽略 %> 符号?

4

0 回答 0