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

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

Closed
wants to merge 3 commits into from

Conversation

seangwright
Copy link

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
Copy link
Author

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
Copy link
Owner

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
Copy link
Author

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
Copy link
Owner

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

Thanks for raising your PR though 🙂

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

Successfully merging this pull request may close these issues.

Linting fails for constructor of generic type after prettier multi-line format
2 participants