austinbaccus / forza-telemetry

Record and Display Telemetry from Forza Motorsport 7, Horizon 4, and Horizon 5.
MIT License
235 stars 36 forks source link

Added Husky Precommit, ESLint, and Prettier Code Formatting #36

Closed Eastonco closed 3 years ago

Eastonco commented 3 years ago

Overview 🌎

Okay, first of all, don't be scared. While yes, this is PR does change over 21k lines of code, there's no logic changes taking place. It's all style and checks to make maintaining the repo easier

What is Husky? πŸ•

Husky is a framework that enables you to easily setup githooks. They're super useful for having mandatory checks pass before you're able to push add, commit, push, or any other git step. In this case, I only have it setup to run a pre-commit hook that makes sure the project builds and the following two programs run. Mind you you're always able to override these checks if you so desire.

What is ESLint? πŸ“

ESLint program that scans over your code to enforce a set of rules. In this case I'm just using Google's standard with some of the more annoying checks turned off. These rules are things like, "if a variable is never reassigned, it should be initialized as a const rather than a let" -- I went though and made sure all the checks pass

What is Prettier? 🌷

Prettier is an awesome code formatter and sterilizer. It works similarly to ESLint but instead of enforcing rules, it enforces style, things like 4 spaces = a tab, using single quotes over double quotes, and other "style" options to maintain a consistent code format across the repo.