Automated code formatting #437
Replies: 8 comments
-
I've been a fan of using Prettier in other projects. It's nice for automating away code formatting debates. |
Beta Was this translation helpful? Give feedback.
-
Do you have examples of reviews that inspired this issue? I am curious as to what our current setup is not catching. I mean, we have ALL the linters and there is a editor config file? |
Beta Was this translation helpful? Give feedback.
-
Yeah I was running auro-suggest the other day and it reminded me. I think I run into this on all the repos (on windows). My first step after opening vs code is to change all the line breaks to In this case at least, I had to turn off the linters to even get the project to run. Whereas when I use projects with prettier (that other people way smarter than me set up), like this one I've never had a problem. It was setup to do formatting on save which was great and the settings seemed to actually work in vs code on windows or mac, either one, without any fancy environment setup. It's using eslint along with prettier. The other example that I remember from the past was an issue with the sass linter not working. Maybe that was my problem in the case above? Prettier can format scss. With the current linters I believe we do them as a pre-commit, right? The downside there is when you do have issues you have to go back and fix them one by one. With prettier it would just keep it pretty in the first place. We could still have the pre-commit linters if we still think they are valuable but at least they wouldn't fail very often. |
Beta Was this translation helpful? Give feedback.
-
I am not really up to speed on the issues we have with Windows and I am not sure how using prettier will fix issues with Windows formatting or why these linters are not working. From what I remember, the updates you are removing were the things we did to address issues with Windows. @geoffrich can you help shed some light on this? |
Beta Was this translation helpful? Give feedback.
-
@Eliza-Huang @Izook @codetothepoint Have you guys ran into anything similar or have any suggestions? |
Beta Was this translation helpful? Give feedback.
-
I added the |
Beta Was this translation helpful? Give feedback.
-
On Windows, on some of our projects, there are red squiggly lines when there are linting errors that help indicate where and how we should fix it. There is also a My experience with Auro is that instead of being notified of those errors during development, it notifies us afterwards in the commit process. If it is possible to notify us of linting errors during development, it would be good to have documentation or set up instructions for it. Additionally, a |
Beta Was this translation helpful? Give feedback.
-
Adding to this discussion, we could look at using formatting tools in the pre-commit process https://prettier.io/docs/en/precommit.html There is also this issue about creating a stylelint config file |
Beta Was this translation helpful? Give feedback.
-
Is your feature request related to a problem? Please describe.
I've noticed that feedback on PR reviews is sometimes code formatting related and it seems like something that we could automate.
I'd like to explore using something like Prettier to handle basic code formatting with the goal to reduce or eliminate the need to correct those type of issues in a PR review.
Describe the solution you'd like
A solution that allows people to contribute without first having to read and comprehend a large document of contribution rules. Having a good set of contribution rules is of course really valuable, so let's automate the ones we can and consider removing rules that can't be automated or that don't bring clear value.
Describe alternatives you've considered
Yell at people until they do the right thing. :D
Additional context
Not sure to what extent this has already been explored but I'm assuming it has been to some extent.
Beta Was this translation helpful? Give feedback.
All reactions