-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pre-commit hooks, removed pretest from npm test (#454)
Co-authored-by: rthenhaus <rthenhaus>
- Loading branch information
Showing
35 changed files
with
2,366 additions
and
1,652 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
bash << EOF | ||
sound() { | ||
echo '\a' | ||
} | ||
|
||
echo "Running pre-commit hooks..." | ||
|
||
# Check Prettier standards | ||
npm run format || | ||
( | ||
sound | ||
echo "❌ Prettier Check Failed. Run npm run format, add changes and try commit again."; | ||
exit 1; | ||
) | ||
|
||
# Check ESLint Standards | ||
npm run lint || | ||
( | ||
sound | ||
echo "❌ ESLint Check Failed. Make the required changes listed above, add changes and try to commit again." | ||
exit 1; | ||
) | ||
|
||
# TODO: add typescript checks | ||
|
||
# If everything passes... Now we can commit | ||
echo "✅ Checks passed, trying to build..." | ||
|
||
"npm" run build || | ||
( | ||
sound | ||
echo "❌ Build failed, check errors." | ||
exit 1; | ||
) | ||
|
||
echo "✅ Successful build, running tests..." | ||
# 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 | ||
npm run test || | ||
( | ||
sound | ||
echo "❌ Tests failed: View the logs to see what broke and fix it before re-committing." | ||
exit 1; | ||
) | ||
|
||
# If everything passes... Now we can commit | ||
echo '✅ All tests passed' | ||
|
||
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import globals from "globals"; | ||
import pluginJs from "@eslint/js"; | ||
import tseslint from "typescript-eslint"; | ||
|
||
|
||
export default [ | ||
{languageOptions: { globals: globals.browser }}, | ||
pluginJs.configs.recommended, | ||
...tseslint.configs.recommended, | ||
]; |
Oops, something went wrong.