mrcrowl / vscode-hg

Integrated Mercurial source control for Visual Studio Code
MIT License
71 stars 37 forks source link

Fix #112: Add Prettier as code formatter and format all files #119

Closed hdpoliveira closed 4 years ago

hdpoliveira commented 4 years ago

About 1, I don't see any options on prettier to disable that. They do say it is an opinionated formatter haha Breaking things in multiple lines is very good for refactoring and blaming, since you can simply remove one line and things will keep working (no need to worry about removing/placing commas in the last line)

About 2, this is really cool! I'll do that on a separate PR.

About 3, definitely! Once this is merged, I have to update the Git actions to run it (although by integrating with the linter we get that for free, I guess), and mention it in the wiki as well.

hdpoliveira commented 4 years ago

Actually, let me try 2 now.

hdpoliveira commented 4 years ago

Ok, did 2 and 3 now :) I believe I'll add automation for formatting anyway, because ESLint is run only on the Typescript files, and we want consistent formatting for Markdown and JSON files as well.

incidentist commented 4 years ago

Breaking things in multiple lines is very good for refactoring and blaming, since you can simply remove one line and things will keep working (no need to worry about removing/placing commas in the last line)

Good point.

When you integrated prettier into ESLint, did you re-run it to see if that affected the code files? I'm surprised it didn't have any effect on the code files at all. If you didn't re-run it, please do, as I'd like to keep these "we changed every line of every file" merges to a minimum :P.

It's going to be really nice to have consistent formatting though.

incidentist commented 4 years ago

Crap, I forgot to wait until these merges were done before merging other stuff. Now there are conflicts. Ugh. Sorry about that.

hdpoliveira commented 4 years ago

No problem, I can resolve the conflicts tomorrow. I'll just drop the commit formatting all files and run it again.

There may be an issue though, with Windows and line endings... I'll take a look.