UMM-CSci-3601 / 3601-iteration-template

This template repository is used as a starting point for course projects in CSci 3601: Software Design and Development at the University of Minnesota Morris. It includes an Angular client along with a Javalin server and Mongo database.
MIT License
0 stars 9 forks source link

Use Prettier to format both client and server code #308

Open floogulinc opened 3 years ago

floogulinc commented 3 years ago

We should start using Prettier to enforce a common code format and automatically handle actually formatting the code.

After which we can switch to the recommended set of ESLint rules: https://github.com/angular-eslint/angular-eslint/blob/master/packages/eslint-plugin/src/configs/README.md#recommended

NicMcPhee commented 9 months ago

I really would like to get this set up for next semester. I have become super fond of an enforced formatting convention in Rust over the last year, and in the same way annoyed by the lack of consistent formatting in CSci 1301 this semester.

NicMcPhee commented 8 months ago

This doesn't look too hard. I pretty much had it setup for the intro-to-git lab, but ended up undoing that since it didn't seem to make much sense there (esp. since there's no JS/TS there).

I think there are actually two issues here (although I might leave them together here?):

The first would be enough if you could guarantee that the only way people would ever alter files was through VSCode, but there's no guarantee of that. So we probably want a GitHub Action check using the prettier CLI as well.

I'll probably set things up to ignore Markdown files. Prettier doesn't seem to do a great job when things get complicated. It mangles GitHub emoticons, and apparently has issues with tables as well.