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

Disable rule #18

Closed lonix1 closed 5 years ago

lonix1 commented 5 years ago

TSLint allows me to disable rules for "whole file", "next line", or "this line". I assumed this rule could also be disabled.

I tried:

// tslint:disable-next-line:lines-between-class-members

and

// tslint:disable-line:lines-between-class-members

Which don't work. Please advise?

chinchiheather commented 5 years ago

Hi @lonix1, sorry for the delayed response, can you give me an example of how you are trying to disable it? I tried using

/* tslint:disable:lines-between-class-members */

and it worked fine, how are you doing the next line disable?

lonix1 commented 5 years ago

I tried the usual ways in the original post, which didn't work unfortunately.

chinchiheather commented 5 years ago

I mean an example within your code, so I can see exactly how you are trying to disable it I can do this to prevent the linting error and it works fine

class App {
  private a = "b";
  // tslint:disable-line:lines-between-class-members
  constructor() {
    this.a = "c";
  }
}
lonix1 commented 5 years ago

That seems to work for me, maybe an update fixed it? Thanks!

chinchiheather commented 5 years ago

Awesome! Glad to hear it :)