bluek1te / feed-txstate

Food Tracking Application created for the Hays County Food Bank
5 stars 0 forks source link

Linter #13

Closed smashwilson closed 5 years ago

smashwilson commented 5 years ago

Would anyone mind if I configured a linter on this repository before we go much further? It's really helpful for making style, indentation, and formatting fade into the background.

Prettier is nice - very little setup, supports both TS and JS, and has integrations for most popular editors.

It's also good to set something like this up early, before we have a lot of PRs in flight, because doing that initial format pass will make every existing PR conflict :see_no_evil:


I'm going to introduce this in two distinct PRs. In the first, I'll add and configure the linter dependency, and add npm run-scripts to trigger and verify it, but I won't touch any source or CI. When that's merged, I'll push a branch linter-tools to mark when the linter tools have first become available. Then, I'll open a second PR that runs the linter on everything and introduces CI checks to verify that it's maintained.

That way, PRs that are open when the second, giant, conflicts-with-everything PR is merged will have a path forward to deconflict cleanly. Here's how it'll look on the command-line of a Mac or Linux system:

git checkout ${MY_OPEN_PR_BRANCH}  # If you aren't already there.
git status # Make sure you have no uncommitted changes.

# Fetch and merge the "linter-tools" marker branch to get access to the lint and format scripts
git pull origin linter-tools

# Run the scripts in each subdirectory.
pushd hcfb-fe
npm ci   # Install new dependencies
npm run format   # Run prettier to reformat everything
popd

pushd hcfb-be
npm ci
npm run format
popd

# Commit the formatter's changes.
git add .
git commit -m 'format everything yo'

# Now merge the formatted development branch.
git pull origin develop

# Push up the now fixed-up branch
git push
bluek1te commented 5 years ago

No objections from me, let me know if you need any help!

smashwilson commented 5 years ago

🆒 I'll likely wait until #12 is merged so we don't complicate that too much.

bluek1te commented 5 years ago

12 is all merged

smashwilson commented 5 years ago

Okay, incoming.

bluek1te commented 5 years ago

Merged in #17