echo "Running ESLint check..."
npm run lint

if [ $? -ne 0 ]; then
  echo "❌ ESLint check failed. Please fix the linting errors before committing."
  exit 1
fi

echo "Running Prettier check..."
npm run format:check

if [ $? -ne 0 ]; then
  echo "❌ Prettier check failed. Please format your code before committing."
  echo "Run 'npm run format' to automatically format your files."
  exit 1
fi

echo "✅ All checks passed!"

