Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Suggestion: create new rule "new line between class members" #3777

Closed
vyshkant opened this issue Mar 16, 2018 · 2 comments
Closed

Suggestion: create new rule "new line between class members" #3777

vyshkant opened this issue Mar 16, 2018 · 2 comments

Comments

@vyshkant
Copy link

I propose to create a new rule that would allow you us track new lines between class members.

Let's call it newline-between-member. The minimum set of properties is: ["never", "always"].

When never is applied, there should not be new lines between class members:

class A {
    private foo: string;
    private bar: number;
    constructor() {
    }
    public doSomething(): void {
        // do something
    }
    public doSomethingElse(): void {
        // do something else
    }
}

Conversely, when always is applied, there should be a new line between class members:

class A {

    private foo: string;

    private bar: number;

    constructor() {
    }

    public doSomething(): void {
        // do something
    }

    public doSomethingElse(): void {
        // do something else
    }
}
@ball6847
Copy link

ball6847 commented May 6, 2018

I would love to see this rule too.

Also, it should be configurable to apply the rule to which members type, eg. method, property.

@JoshuaKGoldberg
Copy link
Contributor

Duplicate of #3517.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants