Skip to content

Instantly share code, notes, and snippets.

@sirbrillig
Created August 23, 2021 23:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sirbrillig/425c89040bb51e04ce5c2f8f854a66bd to your computer and use it in GitHub Desktop.
Save sirbrillig/425c89040bb51e04ce5c2f8f854a66bd to your computer and use it in GitHub Desktop.
A way to run tsc on a single file in my project; copied from https://stackoverflow.com/a/60950355/2615868
#!/bin/bash -e
TMP=.tsconfig-lint.json
cat >$TMP <<EOF
{
"extends": "./tsconfig.json",
"include": [
EOF
for file in "$@"; do
echo " \"$file\"," >> $TMP
done
cat >>$TMP <<EOF
"unused"
]
}
EOF
yarn tsc --project $TMP --skipLibCheck --noEmit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment