Comp-490-SeniorProject / site

MIT License
0 stars 1 forks source link

eslint and prettier #22

Closed alinaah closed 2 years ago

alinaah commented 2 years ago

setting up eslint & prettier with pre-commit hooks to enforce typescript best practices and general formatting guidelines

using husky & lint-staged

prettierrc & eslintrc also exist

MarkKoz commented 2 years ago

The log is here https://github.com/Comp-490-SeniorProject/site/runs/4240922090?check_suite_focus=true

It fails for 2 reasons:

  1. It can't find the typescript module. I think this is the same peer dependency issue I had on the other project I worked on. Older versions of npm don't seem to properly install peer dependencies, so I had to specify a newer version in CI to get that working properly. See https://github.com/COMP-380-6/recipes/commit/6e427953b0d5defad4bad3804293743c6fc5e5e9
  2. Some existing files don't meet the format requirements of the new linter, so the linter formats them. Whenever something needs to be formatted, that's considered a failure. The fix is to run poetry run pre-commit run --all-files locally and then create a commit with all the things it fixes. After you fix everything it wants, you should be able to run the command again and see every hook pass.
alinaah commented 2 years ago

@MarkKoz the PL should be good to go now. Passed all checks. Anfter your confirmation I will merge it with main.

MarkKoz commented 2 years ago

Closing this PR since another PR (#26) was opened.