mirror of
https://github.com/tridactyl/tridactyl.git
synced 2026-09-10 07:16:33 -04:00
Move prettier to linter rather than pre-commit
This commit is contained in:
parent
06457ee187
commit
5cddc889fa
15
ci/lint.sh
15
ci/lint.sh
|
|
@ -12,3 +12,18 @@ if [ "$incompatible_sed" ]; then
|
||||||
fi
|
fi
|
||||||
yarn run lint
|
yarn run lint
|
||||||
"$(yarn bin)/eslint" --rulesdir custom-eslint-rules --ext .ts .
|
"$(yarn bin)/eslint" --rulesdir custom-eslint-rules --ext .ts .
|
||||||
|
|
||||||
|
if [ "$(git rev-parse --abbrev-ref HEAD)" = "master" ]; then
|
||||||
|
if ! yarn prettier --check '**/*.ts' ; then
|
||||||
|
echo "Warning: the files above have prettier formatting issues. Run 'yarn run prettier -w [files]' to fix them."
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
git fetch origin master 2>/dev/null || true
|
||||||
|
changed=$(git diff --name-only origin/master...HEAD -- '*.ts' 2>/dev/null || true)
|
||||||
|
if [ -n "$changed" ]; then
|
||||||
|
if ! yarn prettier --check $changed; then
|
||||||
|
echo "The files above have prettier formatting issues. Run 'yarn run prettier -w [files]' to fix them."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
|
||||||
|
|
@ -30,17 +30,19 @@ if [ -n "$consoleFiles" ]; then
|
||||||
echo
|
echo
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$jsfiles" ]; then
|
# # disabled because it was too noisy
|
||||||
yarn git-format-staged \
|
#
|
||||||
--formatter "yarn --silent prettier --stdin-filepath \"{}\"" \
|
# if [ -n "$jsfiles" ]; then
|
||||||
"*.ts" "*.tsx"
|
# yarn git-format-staged \
|
||||||
fi
|
# --formatter "yarn --silent prettier --stdin-filepath \"{}\"" \
|
||||||
|
# "*.ts" "*.tsx"
|
||||||
|
# fi
|
||||||
|
|
||||||
if [ -n "$otherfiles" ]; then
|
# if [ -n "$otherfiles" ]; then
|
||||||
yarn git-format-staged \
|
# yarn git-format-staged \
|
||||||
--formatter "yarn --silent prettier --stdin-filepath \"{}\"" \
|
# --formatter "yarn --silent prettier --stdin-filepath \"{}\"" \
|
||||||
"*.md" "*.css"
|
# "*.md" "*.css"
|
||||||
fi
|
# fi
|
||||||
|
|
||||||
if [ -n "$jsfiles" ]; then
|
if [ -n "$jsfiles" ]; then
|
||||||
echo "Linting staged files..."
|
echo "Linting staged files..."
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue