openOutpaint/.devtools/lint.sh
Victor Seiji Hariki dd2dc5deb0 Add test hook
Signed-off-by: Victor Seiji Hariki <victorseijih@gmail.com>
2022-12-28 23:32:02 -03:00

21 lines
No EOL
725 B
Bash
Executable file

#!/usr/bin/bash
if ! which npx 2>&1 > /dev/null; then
echo "[lint] npm/npx is not installed"
exit 1
fi
npx prettier > /dev/null || npm install prettier && echo "[lint] We have 'prettier'"
npx eslint > /dev/null || npm install eslint && echo "[lint] We have 'eslint'"
npx prettier-eslint > /dev/null || npm install prettier-eslint-cli && echo "[lint] We have 'prettier-eslint'"
echo "[lint] Linting JavaScript files..."
npx prettier-eslint --write "**/*.js"
echo "[lint] Linting HTML files..."
npx prettier-eslint --write "**/*.html"
echo "[lint] Linting CSS files..."
npx prettier-eslint --write "**/*.css"
echo "[lint] Linting MarkDown files"
npx prettier-eslint --write "**/*.md"
echo "[lint] Finished Linting."