0

次の状況のコード例が見つかりませんでした:

"next-line": [
  true,
  "check-catch",
  "check-finally",
  "check-else",
  "check-open-brace",
  "check-whitespace"
],
4

2 に答える 2

0

next-lineコア TSLint のルール部分はありませんがone-lineルールはあります。ドキュメンテーションは優れたものではありませんが、一般的に中括弧とキーワードを配置するよりコンパクトな方法を強制します。

たとえば、これらは良いです:

class My Class {
 // ...
}

if (true) {
 // ...
} else {
 // ...
}

一方、これは悪いでしょう:

class MyClass
{
 // ...
}

if (true){
 // missing whitespace above
}
else
{
  // else is on the wrong line and the brace is also
}
于 2016-04-21T14:49:48.300 に答える