是否可以在Prettier的IDE中的一行中设置简单代码块?

时间:2019-04-03 00:33:01

标签: intellij-idea visual-studio-code prettier

我们想与VSCode和Intellij等不同的IDE一起使用。为了使代码样式尽可能接近,我们现在开始使用漂亮的样式。

不幸的是,对于简单的代码块,Intellij和VSCode之间看起来更漂亮的工作原理完全不同。

在Intellij中更漂亮

def max_elements_ids(ary)
  ary.
    map.
    with_index(1).
    select { |a| a.first == b.max }.
    map(&:last).
    join(", ")
end

puts max_elements_ids([2, 3, 4, 4]) # will print 3, 4
puts max_elements_ids([2, 4, 3, 4, 4]) # will print 2, 4, 5

vs。发生在VSCode中更漂亮的

public dispatch() {
}

我知道Intellij中有“一行中的简单块”标志,但是它会被Prettier插件覆盖。

现在,我想问一问。.prettierrc是否有一个选项标志可以管理这种行为?您将如何解决这个问题?

0 个答案:

没有答案