diff --git a/.gitignore b/.gitignore index a3062be..e9ef3a2 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,9 @@ .vscode/* + +# NPM things +package.json +package-lock.json +node_modules/ + +# Yarn things +yarn.lock \ No newline at end of file diff --git a/lint.sh b/lint.sh new file mode 100644 index 0000000..d803fcf --- /dev/null +++ b/lint.sh @@ -0,0 +1,21 @@ +#!/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." \ No newline at end of file