frontend-lint 556 B

1234567891011121314151617
  1. #!/bin/bash -e
  2. DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
  3. . "$DIR/.common.sh"
  4. # Ensure docker-compose exists
  5. if hash docker 2>/dev/null; then
  6. cd "${DIR}/.."
  7. echo -e "${BLUE}❯ ${CYAN}Linting Frontend ...${RESET}"
  8. docker run --rm -e CI=true -v "$(pwd)/frontend:/app/frontend" -w /app/frontend node:20 sh -c "yarn install && yarn eslint src;chown -R $(id -u):$(id -g) /app/frontend"
  9. RES=$?
  10. echo -e "${BLUE}❯ ${GREEN}Linting Frontend Complete${RESET}"
  11. exit $RES
  12. else
  13. echo -e "${RED}❯ docker command is not available${RESET}"
  14. exit 1
  15. fi