Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Expects blank line at overloading #17

Open
Xenya0815 opened this issue Feb 1, 2019 · 3 comments
Open

Bug: Expects blank line at overloading #17

Xenya0815 opened this issue Feb 1, 2019 · 3 comments

Comments

@Xenya0815
Copy link

Xenya0815 commented Feb 1, 2019

Used versions

  • tslint-lines-between-class-members@1.3.1
  • tslint@5.12.0

Code

class X {
  foo(x: number, y: string): string;
  foo( y: string): number;
  foo(...args: any): string | number {
    return 42;
  }
}

Expected behavior
No error

Actual behavior
It wants to have a blank line between the function declarations.

fix changes it to

class X {
  foo(x: number, y: string): string;
  
  foo( y: string): number;
  
  foo(...args: any): string | number {
    return 42;
  }
}
@chinchiheather
Copy link
Owner

Hi @Xenya0815 , sorry for the late reply...
If this is still an issue for you, can I ask if you have configured the rule to have 0 lines?

@Xenya0815
Copy link
Author

Xenya0815 commented Jun 17, 2019

hi @chinchiheather
yes it is still a blocker why we can't use that rule :-(

I configured it to 1 line. I want to have 1 line between different members but between the different declarations of an overloaded method I want to have 0 lines. I think my example from the topic is easier to understand if I add an additional class member:

expected behavior with configuration "lines-between-class-members": [true, 1]

class X {
  bar() {
    return 'hello world';
  }

  foo(x: number, y: string): string;
  foo( y: string): number;
  foo(...args: any): string | number {
    return 42;
  }
}

@chinchiheather
Copy link
Owner

Hmm okay, yeah I understand what you are after now.

I think this might be a bit too niche for me to implement right now, but I will be open to accepting pull requests if anyone else wants to work on it.

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

No branches or pull requests

2 participants