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

fix closing generic with open brace same line caused by Prettier #14

Closed seangwright closed 3 years ago

seangwright commented 5 years ago

Fixes #13

I couldn't get npm run lint to pass - it keeps checking node_modules, I think the command options might be wrong?

Also most of the fix tests failed for me even though I didn't change anything that should effect them.

seangwright commented 5 years ago

I'm seeing more and more cases where the constructor() line fails validation because of how Prettier can format the class definition.

Maybe checking if the current line is a constructor is a better option than checking the previous line?

chinchiheather commented 5 years ago

Hi, sorry, I have been absent for quite a while, just working through the issues...

I made some changes so there are conflicts now, but I am happy to try and implement this fix if you don't want to anymore. I added a contributing.md which may help you with your issues around linting/testing

With regards to just checking if the line is a constructor, I'm not sure that will work as we don't want to just ignore checking constructor functions, do you have any other examples where Prettier has formatted it in a way that causes failures? I am happy to try and fix those too

seangwright commented 5 years ago

It seems mostly to be in the situations where the class definition line gets really long and breaks into 2 or more.

I'll take a look at the PR again soon.

Thanks!

chinchiheather commented 5 years ago

I ended up fixing this myself as it was raised by someone else too.

Thanks for raising your PR though 🙂