tutorbookapp / old-tutorbook

Source available code for Tutorbook's progressive web app (PWA).
https://tutorbook.app
Other
13 stars 10 forks source link

Enforce code formatting #248

Closed nicholaschiang closed 4 years ago

nicholaschiang commented 4 years ago

Enforce code formatting

Created: Feb 24, 2020 1:08 PM Priority: P5 Timeline: Mar 23, 2020 Type: Task 🔨

kartikcho commented 4 years ago

How about using an enforced code formatter like Prettier ?

kartikcho commented 4 years ago

Prettier can be configured to a pre-commit hook using this. Pretty-quick will use rules from .prettierrc files. This will enforce formatting on commits which seems like the best solution.

This would require settling on a code format pattern. The options guide is here Also when this is added to codebase, all the files would need to be processed for formatting.

nicholaschiang commented 4 years ago

@kartik918 Thanks for the help!

I'm going to take a look at the options guide, but feel free to fork this repository (off of develop) and add that configuration file (with what you think will be best) yourself. Then just make sure to open a PR and we'll get this merged.

I'm looking for three commits in that PR (one to add the config, one to modify the README or add a tutorial (under tutorials) and update our build/docs by running make docs, and finally one to reformat the existing codebase).

kartikcho commented 4 years ago

I'll start off with some basic formatting rules, if you find any options to enforce in particular, you can update here.