Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test/static-code: tweak Typescript config again
Having `checkLib: false` in `tsconfig.conf` is a bad idea: it means that if we want to check `.d.ts` files, we need a separate invocation of the typescript compiler to do that. It also means that `.d.ts` files won't be checked in your editor by default. Our workaround for this in `test/static-code` only checks `cockpit.d.ts`, and we'll soon have other declaration files. We've been using `checkLib: false` as a crutch to avoid reporting errors against `node_modules/`. The relevant TypeScript issue is still unaddressed: microsoft/TypeScript#30511 Modify `test/static-code` to only report errors if errors were found on something outside of node_modules, but in that case, report all errors. We do this with two invocations of `tsc`, to keep things simple, but we'll only do the second invocation if we're reporting errors. To keep things speedy, we turn on "incremental" mode (which writes a cache file to speed things up). `.gitignore` that. It now takes only ~2s to do an incremental check in the "no errors" case. By default, `tsc` outputs a very nice format that shows the exact content of errors, but this doesn't work by default in `test/static-code` because we capture the output before displaying it. Detect if we're running on a TTY (or if `FORCE_COLOR=1` as from our workflows) and enable the "pretty" output in that case.
- Loading branch information