chinchiheather / tslint-lines-between-class-members

Custom rule for TSLint to enforce blank lines between class methods - achieves a similar thing to lines-between-class-members in ESLint
18 stars 5 forks source link

Not supporting arrow functions in a class? #26

Open stlst opened 5 years ago

stlst commented 5 years ago

I use arrow functions within my class, but "lines-between-class-members" doesn't work.

code:

class user {
    public func1 = () => {
        // some codes
    }
    public func2 = () => {
        // some codes
    }
    public func3(){
        // some codes
    }
}

what I expect:

class user {
    public func1 = () => {
        // some codes
    }

    public func2 = () => {
        // some codes
    }

    public func3(){
        // some codes
    }
}

However, the output now is:

class user {
    public func1 = () => {
        // some codes
    }
    public func2 = () => {
        // some codes
    }

    public func3(){
        // some codes
    }
}

We see that func1 and func2 are not formatted correctly while func3 can be formatted. It seems that "lines-between-class-members" doesn't support arrow functions.

zhoudqa commented 5 years ago

My friend found this issue too, and she want to know when this issue can be fixed. Can you fork and fix it?