-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathverify-type-assertions.sh
More file actions
executable file
·34 lines (29 loc) · 1.5 KB
/
verify-type-assertions.sh
File metadata and controls
executable file
·34 lines (29 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
set -o xtrace
repo_root="$( dirname "${BASH_SOURCE[0]}" )"
tmp=$(mktemp)
git grep -nrl 'eslint-disable-next-line @typescript-eslint/consistent-type-assertions' | grep -v "$( basename "${BASH_SOURCE[0]}" )" | LC_ALL=C sort --stable > "${repo_root}/consistent-type-assertions.txt"
if [[ -n "${VALIDATE:-}" ]]; then
set +o xtrace
if [[ ! -z "$(git status --short)" ]]; then
echo "##################################################################"
echo "## ##"
echo "## Type assertion opt-out track is out of date. If you're ##"
echo "## removing type assertings, update the tracker with: ##"
echo "## pnpm update-type-assertions ##"
echo "## and commit the result. ##"
echo "## ##"
echo "## If you've added new \`as\` assertions and ESLint comments ##"
echo "## to disable the linter, please remove the assertions. This ##"
echo "## repository is no longer allowing contributions with those ##"
echo "## assertions. The tracker lets us work on removing existing ##"
echo "## ones on our own schedules. ##"
echo "## ##"
echo "##################################################################"
git diff
exit 1
fi
fi