buzinas/tslint-eslint-rules

Unable to make Allman bracing style work for class member declarations

sstchur-zz opened this issue · 0 comments

tslint version 5.9.1
tsc 2.7.2

I'm trying to make tslint enforce Allman style bracing even for members on classes, but it doesn't seem to work:

class Foo
{
   private someObj =
   {
      a: 10,
      b: 20
   };
}

tslint won't allow the above unless I either indent the curly braces for someObj, or move the open curly brace up onto the same line as the member declaration, neither of which I'm willing to do.

It seems that ter-indent has a rule "VariableDeclarator" which I can set to 0, and this works great for variable declarations outside of a class. But any members of a class don't follow the same rule.

Expected:
Member declarations should either follow the same rule as VariableDeclarator, or add a new option for MemberDeclarator.