EandrewJones commented on issue #446: URL: https://github.com/apache/flagon-useralejs/issues/446#issuecomment-2103132205
Decent blog for setting up eslint and prettier: [https://blog.logrocket.com/linting-typescript-eslint-prettier/](https://blog.logrocket.com/linting-typescript-eslint-prettier/) Example of a `pre-commit` script from my previous start up: ```sh #!/bin/sh . "$(dirname "$0")/_/husky.sh" echo '๐๏ธ๐ท Styling, testing and building your project before committing' # Check Prettier standards yarn run check-format || ( echo "๐ Afraid to look! Your styling needs fixing. ๐ Prettier Check Failed. Run yarn run format, add changes and try commit again."; false; ) # Check ESLint Standards yarn run check-lint || ( echo '๐ค๐ก๐ค Your failure to adhere to our standards is disappointing. Try again. ๐ค๐ก๐ค ESLint Check Failed. Make the required changes listed above, add changes and try to commit again.' false; ) # Check tsconfig standards yarn run check-types || ( echo 'โ๐ Upon closer inspection, your Types failed. ๐โ Are you seriously trying to write that? Make the changes required above.' false; ) # If everything passes... Now we can commit echo '๐ค๐ค๐ค๐ค... Alright... Code looks good to me... Trying to build now. ๐ค๐ค๐ค๐ค' yarn run build || ( echo 'โ๐ท๐จโ Better call Bob... Because your build failed โ๐ท๐จโ Vite build failed: View the errors above to see why. ' false; ) # After build, run unit tests # Right now, runs all tests. Later scope to just unit tets, we can add e2e/integration as github actions on merge yarn run test || ( echo '๐งช๐ฅ๐งช๐ฅ Uh oh! Looks like you broke something or failed to write tests ๐งช๐ฅ๐งช๐ฅ Cypress tests failed: View the logs to see what broke and fix it before re-committing. ' false; ) # If everything passes... Now we can commit echo 'โ ๐โ ๐ QuestStudio approves... Your contribution is appreciated and accepted for commit. โ ๐โ ๐' ``` Obviously, need to switch from `yarn` --> `npm` and change some of the messaging/comments. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@flagon.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@flagon.apache.org For additional commands, e-mail: notifications-h...@flagon.apache.org