[eslint] autofix fixable lint errors on ci (#129147)

This commit is contained in:
Spencer 2022-03-31 22:51:18 -06:00 committed by GitHub
parent 6a44f1f725
commit e0928efac0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -9,7 +9,25 @@ source .buildkite/scripts/common/util.sh
echo '--- Lint: stylelint'
checks-reporter-with-killswitch "Lint: stylelint" \
node scripts/stylelint
echo "stylelint ✅"
# disable "Exit immediately" mode so that we can run eslint, capture it's exit code, and respond appropriately
# after possibly commiting fixed files to the repo
set +e;
echo '--- Lint: eslint'
checks-reporter-with-killswitch "Lint: eslint" \
node scripts/eslint --no-cache
node scripts/eslint --no-cache --fix
eslint_exit=$?
# re-enable "Exit immediately" mode
set -e;
check_for_changed_files 'node scripts/eslint --no-cache --fix' true
if [[ "${eslint_exit}" != "0" ]]; then
exit 1
fi
echo "eslint ✅"