Files
speckle-server/.husky/pre-commit
T
Kristaps Fabians Geikins 83d8035dc2 chore: upgrade to eslint 9 (#2348)
* root + server

* frontend

* frontend-2

* dui3

* dui3

* tailwind theme

* ui-components

* preview service

* viewer

* viewer-sandbox

* fileimport-service

* webhook service

* objectloader

* shared

* ui-components-nuxt

* WIP full config

* WIP full linter

* eslint projectwide util

* minor fix

* removing redundant ci

* clean up test errors

* fixed prettier formatting

* CI improvements

* TSC lint fix

* 'buildBatch' needs to be async since some batch types (like Text) require it. Removed a disabled liniting rule from ObjLoader

* removed unnecessary void

---------

Co-authored-by: AlexandruPopovici <alexandrupopoviciioan@gmail.com>
2024-06-12 14:38:02 +03:00

42 lines
878 B
Bash
Executable File

#!/usr/bin/env sh
# shellcheck disable=SC1091
set -e
if [ -n "$CI" ]
then
echo "running eslint"
yarn eslint:projectwide
echo "...eslint done"
echo "running prettier"
yarn prettier:check
echo "...prettier done"
else
# shellcheck disable=SC1090
. "$(dirname "$0")/_/husky.sh"
yarn lint-staged
fi
echo "🔍 looking for additional linter dependencies"
check_dependencies_available() {
for i in "${@}"
do
if ! command -v "${i}"; then
echo "No ${i} executable found skipping additional checks" >&2
exit 0
fi
done
}
additional_dependencies=""
if [ -z "${CI}" ]; then
additional_dependencies=" ggshield"
fi
# shellcheck disable=SC2086
check_dependencies_available pre-commit hadolint helm shellcheck circleci${additional_dependencies}
echo "All systems functional, running additional pre-commit checks..."
pre-commit run --all-files