I think it's not necessary to create a var if u use it only once.
It's better to either remove it or use it in `cd kafka-ui-react-app && npm run pre-commit` `if git diff --cached --name-only | grep --quiet "kafka-ui-react-app"`
Something like that?
Do not run frontend tests upon git hooks
kafka-ui-react-app/.husky/pre-commit
kafka-ui-react-app/.husky/pre-commit
diff --git a/kafka-ui-react-app/.husky/pre-commit b/kafka-ui-react-app/.husky/pre-commit
index 0664e92c6fa..b10cf37b9c2 100755
--- a/kafka-ui-react-app/.husky/pre-commit
+++ b/kafka-ui-react-app/.husky/pre-commit
@@ -1,4 +1,11 @@
 #!/bin/sh
 . "$(dirname "$0")/_/husky.sh"
 
-cd kafka-ui-react-app && npm run pre-commit
+
+if git diff --cached --name-only | grep --quiet "kafka-ui-react-app"
+then
+  cd kafka-ui-react-app && npm run pre-commit
+else 
+  echo "Skipping frontend tests"
+  exit 0
+fi
